10#ifndef _EBC_VM_TEST_PROTOCOL_H_
11#define _EBC_VM_TEST_PROTOCOL_H_
16#define EFI_EBC_VM_TEST_PROTOCOL_GUID \
18 0xAAEACCFD, 0xF27B, 0x4C17, { 0xB6, 0x10, 0x75, 0xCA, 0x1F, 0x2D, 0xFB, 0x52 } \
29#define VM_MAJOR_VERSION 1
30#define VM_MINOR_VERSION 0
35#define STOPFLAG_APP_DONE 0x0001
36#define STOPFLAG_BREAKPOINT 0x0002
37#define STOPFLAG_INVALID_BREAK 0x0004
38#define STOPFLAG_BREAK_ON_CALLEX 0x0008
43#define VMFLAGS_CC 0x0001
44#define VMFLAGS_STEP 0x0002
45#define VMFLAGS_ALL_VALID (VMFLAGS_CC | VMFLAGS_STEP)
50#define VMFLAG_SET(pVM, Flag) (pVM->Flags |= (Flag))
51#define VMFLAG_ISSET(pVM, Flag) ((pVM->Flags & (Flag)) ? 1 : 0)
52#define VMFLAG_CLEAR(pVM, Flag) (pVM->Flags &= ~(Flag))
58#define GETOPERANDS(pVM) (UINT8) (*(UINT8 *) (pVM->Ip + 1))
59#define GETOPCODE(pVM) (UINT8) (*(UINT8 *) pVM->Ip)
64#define OPERAND1_REGDATA(pVM, Op) pVM->Gpr[OPERAND1_REGNUM (Op)]
65#define OPERAND2_REGDATA(pVM, Op) pVM->Gpr[OPERAND2_REGNUM (Op)]
70#define EXCEPTION_FLAG_FATAL 0x80000000
71#define EXCEPTION_FLAG_ERROR 0x40000000
72#define EXCEPTION_FLAG_WARNING 0x20000000
73#define EXCEPTION_FLAG_NONE 0x00000000
80typedef INT64 VM_REGISTER;
81typedef UINT32 EXCEPTION_FLAGS;
168 IN OUT CHAR16 *AsmText,
182extern EFI_GUID gEfiEbcVmTestProtocolGuid;
EFI_STATUS(EFIAPI * EBC_VM_TEST_EXECUTE)(IN EFI_EBC_VM_TEST_PROTOCOL *This, IN VM_CONTEXT *VmPtr, IN OUT UINTN *InstructionCount)
EFI_STATUS(EFIAPI * EBC_VM_TEST_ASM)(IN EFI_EBC_VM_TEST_PROTOCOL *This, IN CHAR16 *AsmText, IN OUT INT8 *Buffer, IN OUT UINTN *BufferLen)
EFI_STATUS(EFIAPI * EBC_VM_TEST_DASM)(IN EFI_EBC_VM_TEST_PROTOCOL *This, IN OUT CHAR16 *AsmText, IN OUT INT8 *Buffer, IN OUT UINTN *Len)
UINT32 CompilerVersion
via break(6)
UINT64 Flags
2..63 Reserved.
UINT64 StackRetAddr
location of final return address on stack
UINTN HighStackBottom
bottom of the upper stack
UINTN * StackMagicPtr
pointer to magic value on stack to detect corruption
UINTN LowStackTop
top of the lower stack
VOID * EntryPoint
entry point of EBC image
VMIP Ip
Instruction pointer.
EFI_HANDLE ImageHandle
for this EBC driver
UINTN LastAddrConverted
for debug
EXCEPTION_FLAGS ExceptionFlags
to keep track of exceptions
UINTN LastAddrConvertedValue
for debug
EFI_SYSTEM_TABLE * SystemTable
for debugging only