TianoCore EDK2 master
Loading...
Searching...
No Matches
EbcVmTest.h File Reference

Go to the source code of this file.

Data Structures

struct  VM_CONTEXT
 
struct  _EFI_EBC_VM_TEST_PROTOCOL
 

Macros

#define EFI_EBC_VM_TEST_PROTOCOL_GUID
 
#define VM_MAJOR_VERSION   1
 
#define VM_MINOR_VERSION   0
 
#define STOPFLAG_APP_DONE   0x0001
 
#define STOPFLAG_BREAKPOINT   0x0002
 
#define STOPFLAG_INVALID_BREAK   0x0004
 
#define STOPFLAG_BREAK_ON_CALLEX   0x0008
 
#define VMFLAGS_CC   0x0001
 
#define VMFLAGS_STEP   0x0002
 
#define VMFLAGS_ALL_VALID   (VMFLAGS_CC | VMFLAGS_STEP)
 
#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 GETOPERANDS(pVM)   (UINT8) (*(UINT8 *) (pVM->Ip + 1))
 
#define GETOPCODE(pVM)   (UINT8) (*(UINT8 *) pVM->Ip)
 
#define OPERAND1_REGDATA(pVM, Op)   pVM->Gpr[OPERAND1_REGNUM (Op)]
 
#define OPERAND2_REGDATA(pVM, Op)   pVM->Gpr[OPERAND2_REGNUM (Op)]
 
#define EXCEPTION_FLAG_FATAL   0x80000000
 
#define EXCEPTION_FLAG_ERROR   0x40000000
 
#define EXCEPTION_FLAG_WARNING   0x20000000
 
#define EXCEPTION_FLAG_NONE   0x00000000
 

Typedefs

typedef struct _EFI_EBC_VM_TEST_PROTOCOL EFI_EBC_VM_TEST_PROTOCOL
 
typedef UINT8 * VMIP
 
typedef INT64 VM_REGISTER
 
typedef UINT32 EXCEPTION_FLAGS
 
typedef EFI_STATUS(EFIAPI * EBC_VM_TEST_EXECUTE) (IN EFI_EBC_VM_TEST_PROTOCOL *This, IN VM_CONTEXT *VmPtr, IN OUT UINTN *InstructionCount)
 
typedef 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)
 
typedef 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)
 

Variables

EFI_GUID gEfiEbcVmTestProtocolGuid
 

Detailed Description

EBC VM Test protocol for test purposes.

Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file EbcVmTest.h.

Macro Definition Documentation

◆ EFI_EBC_VM_TEST_PROTOCOL_GUID

#define EFI_EBC_VM_TEST_PROTOCOL_GUID
Value:
{ \
0xAAEACCFD, 0xF27B, 0x4C17, { 0xB6, 0x10, 0x75, 0xCA, 0x1F, 0x2D, 0xFB, 0x52 } \
}

Definition at line 16 of file EbcVmTest.h.

◆ EXCEPTION_FLAG_ERROR

#define EXCEPTION_FLAG_ERROR   0x40000000

Definition at line 71 of file EbcVmTest.h.

◆ EXCEPTION_FLAG_FATAL

#define EXCEPTION_FLAG_FATAL   0x80000000

Definition at line 70 of file EbcVmTest.h.

◆ EXCEPTION_FLAG_NONE

#define EXCEPTION_FLAG_NONE   0x00000000

Definition at line 73 of file EbcVmTest.h.

◆ EXCEPTION_FLAG_WARNING

#define EXCEPTION_FLAG_WARNING   0x20000000

Definition at line 72 of file EbcVmTest.h.

◆ GETOPCODE

#define GETOPCODE (   pVM)    (UINT8) (*(UINT8 *) pVM->Ip)

Definition at line 59 of file EbcVmTest.h.

◆ GETOPERANDS

#define GETOPERANDS (   pVM)    (UINT8) (*(UINT8 *) (pVM->Ip + 1))

Definition at line 58 of file EbcVmTest.h.

◆ OPERAND1_REGDATA

#define OPERAND1_REGDATA (   pVM,
  Op 
)    pVM->Gpr[OPERAND1_REGNUM (Op)]

Definition at line 64 of file EbcVmTest.h.

◆ OPERAND2_REGDATA

#define OPERAND2_REGDATA (   pVM,
  Op 
)    pVM->Gpr[OPERAND2_REGNUM (Op)]

Definition at line 65 of file EbcVmTest.h.

◆ STOPFLAG_APP_DONE

#define STOPFLAG_APP_DONE   0x0001

Definition at line 35 of file EbcVmTest.h.

◆ STOPFLAG_BREAK_ON_CALLEX

#define STOPFLAG_BREAK_ON_CALLEX   0x0008

Definition at line 38 of file EbcVmTest.h.

◆ STOPFLAG_BREAKPOINT

#define STOPFLAG_BREAKPOINT   0x0002

Definition at line 36 of file EbcVmTest.h.

◆ STOPFLAG_INVALID_BREAK

#define STOPFLAG_INVALID_BREAK   0x0004

Definition at line 37 of file EbcVmTest.h.

◆ VM_MAJOR_VERSION

#define VM_MAJOR_VERSION   1

Definition at line 29 of file EbcVmTest.h.

◆ VM_MINOR_VERSION

#define VM_MINOR_VERSION   0

Definition at line 30 of file EbcVmTest.h.

◆ VMFLAG_CLEAR

#define VMFLAG_CLEAR (   pVM,
  Flag 
)    (pVM->Flags &= ~(Flag))

Definition at line 52 of file EbcVmTest.h.

◆ VMFLAG_ISSET

#define VMFLAG_ISSET (   pVM,
  Flag 
)    ((pVM->Flags & (Flag)) ? 1 : 0)

Definition at line 51 of file EbcVmTest.h.

◆ VMFLAG_SET

#define VMFLAG_SET (   pVM,
  Flag 
)    (pVM->Flags |= (Flag))

Definition at line 50 of file EbcVmTest.h.

◆ VMFLAGS_ALL_VALID

#define VMFLAGS_ALL_VALID   (VMFLAGS_CC | VMFLAGS_STEP)

Definition at line 45 of file EbcVmTest.h.

◆ VMFLAGS_CC

#define VMFLAGS_CC   0x0001

Definition at line 43 of file EbcVmTest.h.

◆ VMFLAGS_STEP

#define VMFLAGS_STEP   0x0002

Definition at line 44 of file EbcVmTest.h.

Typedef Documentation

◆ EBC_VM_TEST_ASM

typedef 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)

Convert AsmText to the instruction. This function is only used for test purposes.

Parameters
[in]ThisA pointer to the EFI_EBC_VM_TEST_PROTOCOL structure.
[in]AsmTextA pointer to EBC ASM text code.
[out]BufferBuffer to store the instruction.
[out]BufferLenSize of buffer that is required to store data.
Return values
EFI_UNSUPPORTEDThis functionality is unsupported.
EFI_SUCCESSSuccessfully convert AsmText to the instruction.

Definition at line 144 of file EbcVmTest.h.

◆ EBC_VM_TEST_DASM

typedef 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)

Dump the executed instruction. This function is only used for test purposes.

Parameters
[in]ThisA pointer to the EFI_EBC_VM_TEST_PROTOCOL structure.
[out]AsmTextContain the disasm text.
[out]BufferBuffer to store the instruction.
[out]BufferLenSize of buffer that is required to store data.
Return values
EFI_UNSUPPORTEDThis functionality is unsupported.
EFI_SUCCESSSuccessfully dump the executed instruction.

Definition at line 165 of file EbcVmTest.h.

◆ EBC_VM_TEST_EXECUTE

typedef EFI_STATUS(EFIAPI * EBC_VM_TEST_EXECUTE) (IN EFI_EBC_VM_TEST_PROTOCOL *This, IN VM_CONTEXT *VmPtr, IN OUT UINTN *InstructionCount)

Given a pointer to a new VM context, execute one or more instructions. This function is only used for test purposes.

Parameters
[in]ThisA pointer to the EFI_EBC_VM_TEST_PROTOCOL structure.
[in]VmPtrA pointer to a VM context.
[in,out]InstructionCountA pointer to a UINTN value holding the number of instructions to execute. If it holds value of 0, then the instruction to be executed is 1.
Return values
EFI_UNSUPPORTEDAt least one of the opcodes is not supported.
EFI_SUCCESSAll of the instructions are executed successfully.

Definition at line 124 of file EbcVmTest.h.

◆ EFI_EBC_VM_TEST_PROTOCOL

Definition at line 24 of file EbcVmTest.h.

◆ EXCEPTION_FLAGS

typedef UINT32 EXCEPTION_FLAGS

Definition at line 81 of file EbcVmTest.h.

◆ VM_REGISTER

typedef INT64 VM_REGISTER

Definition at line 80 of file EbcVmTest.h.

◆ VMIP

typedef UINT8* VMIP

instruction pointer for the VM

Definition at line 78 of file EbcVmTest.h.