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

Go to the source code of this file.

Macros

#define ASSERT_ALIGNED(addr, size)   ASSERT (ADDRESS_IS_ALIGNED (addr, size))
 
#define EBCMSG(s)   gST->ConOut->OutputString (gST->ConOut, s)
 

Functions

EFI_STATUS EbcExecute (IN VM_CONTEXT *VmPtr)
 
UINT64 GetVmVersion (VOID)
 
EFI_STATUS VmWriteMemN (IN VM_CONTEXT *VmPtr, IN UINTN Addr, IN UINTN Data)
 
EFI_STATUS VmWriteMem64 (IN VM_CONTEXT *VmPtr, IN UINTN Addr, IN UINT64 Data)
 
EFI_STATUS EFIAPI EbcExecuteInstructions (IN EFI_EBC_VM_TEST_PROTOCOL *This, IN VM_CONTEXT *VmPtr, IN OUT UINTN *InstructionCount)
 

Detailed Description

Header file for Virtual Machine support. Contains EBC defines that can be of use to a disassembler for the most part. Also provides function prototypes for VM functions.

Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file EbcExecute.h.

Macro Definition Documentation

◆ ASSERT_ALIGNED

#define ASSERT_ALIGNED (   addr,
  size 
)    ASSERT (ADDRESS_IS_ALIGNED (addr, size))

Definition at line 17 of file EbcExecute.h.

◆ EBCMSG

#define EBCMSG (   s)    gST->ConOut->OutputString (gST->ConOut, s)

Definition at line 22 of file EbcExecute.h.

Function Documentation

◆ EbcExecute()

EFI_STATUS EbcExecute ( IN VM_CONTEXT VmPtr)

Execute an EBC image from an entry point or from a published protocol.

Parameters
VmPtrA pointer to a VM context.
Return values
EFI_UNSUPPORTEDAt least one of the opcodes is not supported.
EFI_SUCCESSAll of the instructions are executed successfully.

Definition at line 1418 of file EbcExecute.c.

◆ EbcExecuteInstructions()

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.

Parameters
ThisA pointer to the EFI_EBC_VM_TEST_PROTOCOL structure.
VmPtrA pointer to a VM context.
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 1360 of file EbcExecute.c.

◆ GetVmVersion()

UINT64 GetVmVersion ( VOID  )

Returns the version of the EBC virtual machine.

Returns
The 64-bit version of EBC virtual machine.

Definition at line 5418 of file EbcExecute.c.

◆ VmWriteMem64()

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.

Parameters
VmPtrA pointer to a VM context.
AddrAddress to write to.
DataValue to write to Addr.
Return values
EFI_SUCCESSThe instruction is executed successfully.
OtherSome error occurs when writing data to the address.

Definition at line 4844 of file EbcExecute.c.

◆ VmWriteMemN()

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.

Parameters
VmPtrA pointer to a VM context.
AddrAddress to write to.
DataValue to write to Addr.
Return values
EFI_SUCCESSThe instruction is executed successfully.
OtherSome error occurs when writing data to the address.

Definition at line 4906 of file EbcExecute.c.