summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Include/Protocol/EbcVmTest.h
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Include/Protocol/EbcVmTest.h')
-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
///