TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
struct | VM_TABLE_ENTRY |
Macros | |
#define | DATA_SIZE_INVALID 0 |
#define | DATA_SIZE_8 1 |
#define | DATA_SIZE_16 2 |
#define | DATA_SIZE_32 4 |
#define | DATA_SIZE_64 8 |
#define | DATA_SIZE_N 48 |
Typedefs | |
typedef UINT64(* | DATA_MANIP_EXEC_FUNCTION) (IN VM_CONTEXT *VmPtr, IN UINT64 Op1, IN UINT64 Op2) |
Variables | |
CONST DATA_MANIP_EXEC_FUNCTION | mDataManipDispatchTable [] |
CONST VM_TABLE_ENTRY | mVmOpcodeTable [] |
CONST UINT8 | mJMPLen [] = { 2, 2, 6, 10 } |
Contains code that implements the virtual machine.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file EbcExecute.c.
#define DATA_SIZE_16 2 |
Definition at line 19 of file EbcExecute.c.
#define DATA_SIZE_32 4 |
Definition at line 20 of file EbcExecute.c.
#define DATA_SIZE_64 8 |
Definition at line 21 of file EbcExecute.c.
#define DATA_SIZE_8 1 |
Definition at line 18 of file EbcExecute.c.
#define DATA_SIZE_INVALID 0 |
Definition at line 17 of file EbcExecute.c.
#define DATA_SIZE_N 48 |
Definition at line 22 of file EbcExecute.c.
typedef UINT64(* DATA_MANIP_EXEC_FUNCTION) (IN VM_CONTEXT *VmPtr, IN UINT64 Op1, IN UINT64 Op2) |
Definition at line 33 of file EbcExecute.c.
UINTN ConvertStackAddr | ( | IN VM_CONTEXT * | VmPtr, |
IN UINTN | Addr | ||
) |
Given an address that EBC is going to read from or write to, return an appropriate address that accounts for a gap in the stack. The stack for this application looks like this (high addr on top) [EBC entry point arguments] [VM stack] [EBC stack] The EBC assumes that its arguments are at the top of its stack, which is where the VM stack is really. Therefore if the EBC does memory accesses into the VM stack area, then we need to convert the address to point to the EBC entry point arguments area. Do this here.
VmPtr | A Pointer to VM context. |
Addr | Address of interest |
Definition at line 5355 of file EbcExecute.c.
EFI_STATUS EbcExecute | ( | IN VM_CONTEXT * | VmPtr | ) |
Execute an EBC image from an entry point or from a published protocol.
VmPtr | A pointer to a VM context. |
EFI_UNSUPPORTED | At least one of the opcodes is not supported. |
EFI_SUCCESS | All of the instructions are executed successfully. |
Definition at line 1418 of file EbcExecute.c.
EFI_STATUS EFIAPI EbcExecuteInstructions | ( | 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 via the EBC VM test protocol.
This | A pointer to the EFI_EBC_VM_TEST_PROTOCOL structure. |
VmPtr | A pointer to a VM context. |
InstructionCount | A 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. |
EFI_UNSUPPORTED | At least one of the opcodes is not supported. |
EFI_SUCCESS | All of the instructions are executed successfully. |
Definition at line 1360 of file EbcExecute.c.
UINT64 ExecuteADD | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3610 of file EbcExecute.c.
UINT64 ExecuteAND | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3876 of file EbcExecute.c.
UINT64 ExecuteASHR | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3999 of file EbcExecute.c.
EFI_STATUS ExecuteBREAK | ( | IN VM_CONTEXT * | VmPtr | ) |
Execute the EBC BREAK instruction.
VmPtr | A pointer to a VM context. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 1828 of file EbcExecute.c.
EFI_STATUS ExecuteCALL | ( | IN VM_CONTEXT * | VmPtr | ) |
R1 {Immed32}
If Rx == R0, then it's a PC relative call to PC = PC + imm32.
VmPtr | A pointer to a VM context. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 2995 of file EbcExecute.c.
EFI_STATUS ExecuteCMP | ( | IN VM_CONTEXT * | VmPtr | ) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
EFI_UNSUPPORTED | The opcodes/operands is not supported. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 3196 of file EbcExecute.c.
EFI_STATUS ExecuteCMPI | ( | IN VM_CONTEXT * | VmPtr | ) |
Rx {Index16}, Immed16|Immed32
VmPtr | A pointer to a VM context. |
EFI_UNSUPPORTED | The opcodes/operands is not supported. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 3370 of file EbcExecute.c.
EFI_STATUS ExecuteDataManip | ( | IN VM_CONTEXT * | VmPtr, |
IN BOOLEAN | IsSignedOp | ||
) |
R2 {Immed16|Index16}
VmPtr | A pointer to VM context. |
IsSignedOp | Indicates whether the operand is signed or not. |
EFI_UNSUPPORTED | The opcodes/operands is not supported. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 4197 of file EbcExecute.c.
UINT64 ExecuteDIV | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3714 of file EbcExecute.c.
UINT64 ExecuteDIVU | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3756 of file EbcExecute.c.
UINT64 ExecuteEXTNDB | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 4026 of file EbcExecute.c.
UINT64 ExecuteEXTNDD | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 4101 of file EbcExecute.c.
UINT64 ExecuteEXTNDW | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 4059 of file EbcExecute.c.
EFI_STATUS ExecuteJMP | ( | IN VM_CONTEXT * | VmPtr | ) |
R1 {Immed32|Index32}
Encoding: b0.7 - immediate data present b0.6 - 1 = 64 bit immediate data 0 = 32 bit immediate data b1.7 - 1 = conditional b1.6 1 = CS (condition set) 0 = CC (condition clear) b1.4 1 = relative address 0 = absolute address b1.3 1 = operand1 indirect b1.2-0 operand 1
VmPtr | A pointer to a VM context. |
EFI_UNSUPPORTED | The opcodes/operands is not supported. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 1958 of file EbcExecute.c.
EFI_STATUS ExecuteJMP8 | ( | IN VM_CONTEXT * | VmPtr | ) |
Execute the EBC JMP8 instruction.
Instruction syntax: JMP8{cs|cc} Offset/2
VmPtr | A pointer to a VM context. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 2135 of file EbcExecute.c.
EFI_STATUS ExecuteLOADSP | ( | IN VM_CONTEXT * | VmPtr | ) |
Execute the EBC LOADSP instruction.
Instruction syntax: LOADSP SP1, R2
VmPtr | A pointer to a VM context. |
EFI_UNSUPPORTED | The opcodes/operands is not supported. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 4352 of file EbcExecute.c.
UINT64 ExecuteMOD | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3800 of file EbcExecute.c.
UINT64 ExecuteMODU | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3838 of file EbcExecute.c.
EFI_STATUS ExecuteMOVI | ( | IN VM_CONTEXT * | VmPtr | ) |
R1 {Index16}, ImmData16|32|64
First variable character specifies the move size Second variable character specifies size of the immediate data
Sign-extend the immediate data to the size of the operation, and zero-extend if storing to a register.
Operand1 direct with index/immed is invalid.
VmPtr | A pointer to a VM context. |
EFI_UNSUPPORTED | The opcodes/operands is not supported. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 2199 of file EbcExecute.c.
EFI_STATUS ExecuteMOVIn | ( | IN VM_CONTEXT * | VmPtr | ) |
R1 {Index16}, Index16|32|64
VmPtr | A pointer to a VM context. |
EFI_UNSUPPORTED | The opcodes/operands is not supported. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 2320 of file EbcExecute.c.
EFI_STATUS ExecuteMOVREL | ( | IN VM_CONTEXT * | VmPtr | ) |
R1 {Index16}, ImmData16|32|64
VmPtr | A pointer to a VM context. |
EFI_UNSUPPORTED | The opcodes/operands is not supported. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 2424 of file EbcExecute.c.
EFI_STATUS ExecuteMOVsnd | ( | IN VM_CONTEXT * | VmPtr | ) |
R2 {Index32|Immed32}
0:7 1=>operand1 index present 0:6 1=>operand2 index present
VmPtr | A pointer to a VM context. |
EFI_UNSUPPORTED | The opcodes/operands is not supported. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 2627 of file EbcExecute.c.
EFI_STATUS ExecuteMOVsnw | ( | IN VM_CONTEXT * | VmPtr | ) |
R2 {Index16|Immed16}
0:7 1=>operand1 index present 0:6 1=>operand2 index present
VmPtr | A pointer to a VM context. |
EFI_UNSUPPORTED | The opcodes/operands is not supported. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 2532 of file EbcExecute.c.
EFI_STATUS ExecuteMOVxx | ( | IN VM_CONTEXT * | VmPtr | ) |
R2 {Index64}
Copies contents of [R2] -> [R1], zero extending where required.
First character indicates the size of the move. Second character indicates the size of the index(s).
Invalid to have R1 direct with index.
VmPtr | A pointer to a VM context. |
EFI_UNSUPPORTED | The opcodes/operands is not supported. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 1554 of file EbcExecute.c.
UINT64 ExecuteMUL | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3660 of file EbcExecute.c.
UINT64 ExecuteMULU | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3687 of file EbcExecute.c.
UINT64 ExecuteNEG | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3587 of file EbcExecute.c.
UINT64 ExecuteNOT | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3564 of file EbcExecute.c.
UINT64 ExecuteOR | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3899 of file EbcExecute.c.
EFI_STATUS ExecutePOP | ( | IN VM_CONTEXT * | VmPtr | ) |
R1 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 2911 of file EbcExecute.c.
EFI_STATUS ExecutePOPn | ( | IN VM_CONTEXT * | VmPtr | ) |
R1 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 2852 of file EbcExecute.c.
EFI_STATUS ExecutePUSH | ( | IN VM_CONTEXT * | VmPtr | ) |
R1 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 2774 of file EbcExecute.c.
EFI_STATUS ExecutePUSHn | ( | IN VM_CONTEXT * | VmPtr | ) |
R1 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 2714 of file EbcExecute.c.
EFI_STATUS ExecuteRET | ( | IN VM_CONTEXT * | VmPtr | ) |
Execute the EBC RET instruction.
Instruction syntax: RET
VmPtr | A pointer to a VM context. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 3144 of file EbcExecute.c.
UINT64 ExecuteSHL | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3945 of file EbcExecute.c.
UINT64 ExecuteSHR | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3972 of file EbcExecute.c.
EFI_STATUS ExecuteSignedDataManip | ( | IN VM_CONTEXT * | VmPtr | ) |
R2 {Immed16|Index16}
VmPtr | A pointer to VM context. |
EFI_UNSUPPORTED | The opcodes/operands is not supported. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 4138 of file EbcExecute.c.
EFI_STATUS ExecuteSTORESP | ( | IN VM_CONTEXT * | VmPtr | ) |
Execute the EBC STORESP instruction.
Instruction syntax: STORESP Rx, FLAGS|IP
VmPtr | A pointer to a VM context. |
EFI_UNSUPPORTED | The opcodes/operands is not supported. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 4405 of file EbcExecute.c.
UINT64 ExecuteSUB | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3633 of file EbcExecute.c.
EFI_STATUS ExecuteUnsignedDataManip | ( | IN VM_CONTEXT * | VmPtr | ) |
R2 {Immed16|Index16}
VmPtr | A pointer to VM context. |
EFI_UNSUPPORTED | The opcodes/operands is not supported. |
EFI_SUCCESS | The instruction is executed successfully. |
Definition at line 4167 of file EbcExecute.c.
UINT64 ExecuteXOR | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT64 | Op1, | ||
IN UINT64 | Op2 | ||
) |
R2 {Index16|Immed16}
VmPtr | A pointer to a VM context. |
Op1 | Operand 1 from the instruction |
Op2 | Operand 2 from the instruction |
Definition at line 3922 of file EbcExecute.c.
UINT64 GetVmVersion | ( | VOID | ) |
Returns the version of the EBC virtual machine.
Definition at line 5418 of file EbcExecute.c.
UINT16 VmReadCode16 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT32 | Offset | ||
) |
Reads 16-bit unsigned data from the code stream.
This routine provides the ability to read raw unsigned data from the code stream.
VmPtr | A pointer to VM context |
Offset | Offset from current IP to the raw data to read. |
Definition at line 5100 of file EbcExecute.c.
UINT32 VmReadCode32 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT32 | Offset | ||
) |
Reads 32-bit unsigned data from the code stream.
This routine provides the ability to read raw unsigned data from the code stream.
VmPtr | A pointer to VM context |
Offset | Offset from current IP to the raw data to read. |
Definition at line 5140 of file EbcExecute.c.
UINT64 VmReadCode64 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT32 | Offset | ||
) |
Reads 64-bit unsigned data from the code stream.
This routine provides the ability to read raw unsigned data from the code stream.
VmPtr | A pointer to VM context |
Offset | Offset from current IP to the raw data to read. |
Definition at line 5175 of file EbcExecute.c.
INT16 VmReadImmed16 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT32 | Offset | ||
) |
Reads 16-bit immediate value at the offset.
This routine is called by the EBC execute functions to read EBC immediate values from the code stream. Since we can't assume alignment, each tries to read in the biggest chunks size available, but will revert to smaller reads if necessary.
VmPtr | A pointer to a VM context. |
Offset | offset from IP of the code bytes to read. |
Definition at line 4980 of file EbcExecute.c.
INT32 VmReadImmed32 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT32 | Offset | ||
) |
Reads 32-bit immediate value at the offset.
This routine is called by the EBC execute functions to read EBC immediate values from the code stream. Since we can't assume alignment, each tries to read in the biggest chunks size available, but will revert to smaller reads if necessary.
VmPtr | A pointer to a VM context. |
Offset | offset from IP of the code bytes to read. |
Definition at line 5022 of file EbcExecute.c.
INT64 VmReadImmed64 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT32 | Offset | ||
) |
Reads 64-bit immediate value at the offset.
This routine is called by the EBC execute functions to read EBC immediate values from the code stream. Since we can't assume alignment, each tries to read in the biggest chunks size available, but will revert to smaller reads if necessary.
VmPtr | A pointer to a VM context. |
Offset | offset from IP of the code bytes to read. |
Definition at line 5059 of file EbcExecute.c.
INT8 VmReadImmed8 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT32 | Offset | ||
) |
Reads 8-bit immediate value at the offset.
This routine is called by the EBC execute functions to read EBC immediate values from the code stream. Since we can't assume alignment, each tries to read in the biggest chunks size available, but will revert to smaller reads if necessary.
VmPtr | A pointer to a VM context. |
Offset | offset from IP of the code bytes to read. |
Definition at line 4954 of file EbcExecute.c.
INT16 VmReadIndex16 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT32 | CodeOffset | ||
) |
Decode a 16-bit index to determine the offset. Given an index value:
b15 - sign bit b14:12 - number of bits in this index assigned to natural units (=a) ba:11 - constant units = ConstUnits b0:a - natural units = NaturalUnits
Given this info, the offset can be computed by: offset = sign_bit * (ConstUnits + NaturalUnits * sizeof(UINTN))
Max offset is achieved with index = 0x7FFF giving an offset of 0x27B (32-bit machine) or 0x477 (64-bit machine). Min offset is achieved with index =
VmPtr | A pointer to VM context. |
CodeOffset | Offset from IP of the location of the 16-bit index to decode. |
Definition at line 4475 of file EbcExecute.c.
INT32 VmReadIndex32 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT32 | CodeOffset | ||
) |
Decode a 32-bit index to determine the offset.
VmPtr | A pointer to VM context. |
CodeOffset | Offset from IP of the location of the 32-bit index to decode. |
Definition at line 4545 of file EbcExecute.c.
INT64 VmReadIndex64 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINT32 | CodeOffset | ||
) |
Decode a 64-bit index to determine the offset.
VmPtr | A pointer to VM context.s |
CodeOffset | Offset from IP of the location of the 64-bit index to decode. |
Definition at line 4607 of file EbcExecute.c.
UINT16 VmReadMem16 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINTN | Addr | ||
) |
Reads 16-bit data form the memory address.
VmPtr | A pointer to VM context. |
Addr | The memory address. |
Definition at line 5238 of file EbcExecute.c.
UINT32 VmReadMem32 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINTN | Addr | ||
) |
Reads 32-bit data form the memory address.
VmPtr | A pointer to VM context. |
Addr | The memory address. |
Definition at line 5270 of file EbcExecute.c.
UINT64 VmReadMem64 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINTN | Addr | ||
) |
Reads 64-bit data form the memory address.
VmPtr | A pointer to VM context. |
Addr | The memory address. |
Definition at line 5306 of file EbcExecute.c.
UINT8 VmReadMem8 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINTN | Addr | ||
) |
Reads 8-bit data form the memory address.
VmPtr | A pointer to VM context. |
Addr | The memory address. |
Definition at line 5213 of file EbcExecute.c.
UINTN VmReadMemN | ( | IN VM_CONTEXT * | VmPtr, |
IN UINTN | Addr | ||
) |
Read a natural value from memory. May or may not be aligned.
VmPtr | current VM context |
Addr | the address to read from |
Definition at line 5374 of file EbcExecute.c.
EFI_STATUS VmWriteMem16 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINTN | Addr, | ||
IN UINT16 | Data | ||
) |
Writes 16-bit data to memory address.
This routine is called by the EBC data movement instructions that write to memory. Since these writes may be to the stack, which looks like (high address on top) this,
[EBC entry point arguments] [VM stack] [EBC stack]
we need to detect all attempts to write to the EBC entry point argument stack area and adjust the address (which will initially point into the VM stack) to point into the EBC entry point arguments.
VmPtr | A pointer to a VM context. |
Addr | Address to write to. |
Data | Value to write to Addr. |
EFI_SUCCESS | The instruction is executed successfully. |
Other | Some error occurs when writing data to the address. |
Definition at line 4720 of file EbcExecute.c.
EFI_STATUS VmWriteMem32 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINTN | Addr, | ||
IN UINT32 | Data | ||
) |
Writes 32-bit data to memory address.
This routine is called by the EBC data movement instructions that write to memory. Since these writes may be to the stack, which looks like (high address on top) this,
[EBC entry point arguments] [VM stack] [EBC stack]
we need to detect all attempts to write to the EBC entry point argument stack area and adjust the address (which will initially point into the VM stack) to point into the EBC entry point arguments.
VmPtr | A pointer to a VM context. |
Addr | Address to write to. |
Data | Value to write to Addr. |
EFI_SUCCESS | The instruction is executed successfully. |
Other | Some error occurs when writing data to the address. |
Definition at line 4782 of file EbcExecute.c.
EFI_STATUS VmWriteMem64 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINTN | Addr, | ||
IN UINT64 | Data | ||
) |
Writes 64-bit data to memory address.
This routine is called by the EBC data movement instructions that write to memory. Since these writes may be to the stack, which looks like (high address on top) this,
[EBC entry point arguments] [VM stack] [EBC stack]
we need to detect all attempts to write to the EBC entry point argument stack area and adjust the address (which will initially point into the VM stack) to point into the EBC entry point arguments.
VmPtr | A pointer to a VM context. |
Addr | Address to write to. |
Data | Value to write to Addr. |
EFI_SUCCESS | The instruction is executed successfully. |
Other | Some error occurs when writing data to the address. |
Definition at line 4844 of file EbcExecute.c.
EFI_STATUS VmWriteMem8 | ( | IN VM_CONTEXT * | VmPtr, |
IN UINTN | Addr, | ||
IN UINT8 | Data | ||
) |
Writes 8-bit data to memory address.
This routine is called by the EBC data movement instructions that write to memory. Since these writes may be to the stack, which looks like (high address on top) this,
[EBC entry point arguments] [VM stack] [EBC stack]
we need to detect all attempts to write to the EBC entry point argument stack area and adjust the address (which will initially point into the VM stack) to point into the EBC entry point arguments.
VmPtr | A pointer to a VM context. |
Addr | Address to write to. |
Data | Value to write to Addr. |
EFI_SUCCESS | The instruction is executed successfully. |
Other | Some error occurs when writing data to the address. |
Definition at line 4682 of file EbcExecute.c.
EFI_STATUS VmWriteMemN | ( | IN VM_CONTEXT * | VmPtr, |
IN UINTN | Addr, | ||
IN UINTN | Data | ||
) |
Writes UINTN data to memory address.
This routine is called by the EBC data movement instructions that write to memory. Since these writes may be to the stack, which looks like (high address on top) this,
[EBC entry point arguments] [VM stack] [EBC stack]
we need to detect all attempts to write to the EBC entry point argument stack area and adjust the address (which will initially point into the VM stack) to point into the EBC entry point arguments.
VmPtr | A pointer to a VM context. |
Addr | Address to write to. |
Data | Value to write to Addr. |
EFI_SUCCESS | The instruction is executed successfully. |
Other | Some error occurs when writing data to the address. |
Definition at line 4906 of file EbcExecute.c.
CONST DATA_MANIP_EXEC_FUNCTION mDataManipDispatchTable[] |
Definition at line 1250 of file EbcExecute.c.
CONST UINT8 mJMPLen[] = { 2, 2, 6, 10 } |
Definition at line 1342 of file EbcExecute.c.
CONST VM_TABLE_ENTRY mVmOpcodeTable[] |
Definition at line 1272 of file EbcExecute.c.