summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Include/Protocol
diff options
context:
space:
mode:
authorPete Batard <pete@akeo.ie>2016-11-16 21:24:10 +0800
committerJiewen Yao <jiewen.yao@intel.com>2016-11-23 10:20:28 +0800
commit3e2c7843022d849971a539387a4ad8b9862dadfb (patch)
treea2d8d5632adf940fecfda6d9b8387163b25cbbdd /MdeModulePkg/Include/Protocol
parent748edcd5eb706b34ffd0af6900a8db19605b0ffd (diff)
downloadedk2-3e2c7843022d849971a539387a4ad8b9862dadfb.tar.gz
edk2-3e2c7843022d849971a539387a4ad8b9862dadfb.tar.bz2
edk2-3e2c7843022d849971a539387a4ad8b9862dadfb.zip
MdeModulePkg/EbcDxe: reorganize EBC header definitions
VM related defs are now in EbcVmTest.h, and opocode related definitions in Ebc.h. Because it is used by both the EBC Debugger and driver, EbcDebugSignalException() sees its definition factorized in EbcDebuggerHook.h. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'MdeModulePkg/Include/Protocol')
-rw-r--r--MdeModulePkg/Include/Protocol/EbcVmTest.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/MdeModulePkg/Include/Protocol/EbcVmTest.h b/MdeModulePkg/Include/Protocol/EbcVmTest.h
index a9bbb3a0a6..9eedca1906 100644
--- a/MdeModulePkg/Include/Protocol/EbcVmTest.h
+++ b/MdeModulePkg/Include/Protocol/EbcVmTest.h
@@ -30,6 +30,55 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
typedef struct _EFI_EBC_VM_TEST_PROTOCOL EFI_EBC_VM_TEST_PROTOCOL;
+//
+// VM major/minor version
+//
+#define VM_MAJOR_VERSION 1
+#define VM_MINOR_VERSION 0
+
+//
+// Bits in the VM->StopFlags field
+//
+#define STOPFLAG_APP_DONE 0x0001
+#define STOPFLAG_BREAKPOINT 0x0002
+#define STOPFLAG_INVALID_BREAK 0x0004
+#define STOPFLAG_BREAK_ON_CALLEX 0x0008
+
+//
+// Masks for working with the VM flags register
+//
+#define VMFLAGS_CC 0x0001 // condition flag
+#define VMFLAGS_STEP 0x0002 // step instruction mode
+#define VMFLAGS_ALL_VALID (VMFLAGS_CC | VMFLAGS_STEP)
+
+//
+// Macros for operating on the VM flags register
+//
+#define VMFLAG_SET(pVM, Flag) (pVM->Flags |= (Flag))
+#define VMFLAG_ISSET(pVM, Flag) ((pVM->Flags & (Flag)) ? 1 : 0)
+#define VMFLAG_CLEAR(pVM, Flag) (pVM->Flags &= ~(Flag))
+
+//
+// Define a macro to get the operand. Then we can change it to be either a
+// direct read or have it call a function to read memory.
+//
+#define GETOPERANDS(pVM) (UINT8) (*(UINT8 *) (pVM->Ip + 1))
+#define GETOPCODE(pVM) (UINT8) (*(UINT8 *) pVM->Ip)
+
+//
+// Macros for operating on the VM GP registers
+//
+#define OPERAND1_REGDATA(pVM, Op) pVM->Gpr[OPERAND1_REGNUM (Op)]
+#define OPERAND2_REGDATA(pVM, Op) pVM->Gpr[OPERAND2_REGNUM (Op)]
+
+//
+// Bits of exception flags field of VM context
+//
+#define EXCEPTION_FLAG_FATAL 0x80000000 // can't continue
+#define EXCEPTION_FLAG_ERROR 0x40000000 // bad, but try to continue
+#define EXCEPTION_FLAG_WARNING 0x20000000 // harmless problem
+#define EXCEPTION_FLAG_NONE 0x00000000 // for normal return
+
///
/// instruction pointer for the VM
///