TianoCore EDK2 master
|
Go to the source code of this file.
Macros | |
#define | VM_STACK_SIZE (1024 * 4) |
#define | STACK_REMAIN_SIZE (1024 * 4) |
#define | EBC_ENTRYPOINT_SIGNATURE 0xAFAFAFAF |
#define | EBC_LL_EBC_ENTRYPOINT_SIGNATURE 0xFAFAFAFA |
Functions | |
UINT64 EFIAPI | EbcLLEbcInterpret (VOID) |
UINT64 EFIAPI | EbcLLExecuteEbcImageEntryPoint (VOID) |
VOID | EbcLLCALLEX (IN VM_CONTEXT *VmPtr, IN UINTN FuncAddr, IN UINTN NewStackPointer, IN VOID *FramePtr, IN UINT8 Size) |
UINT64 EFIAPI | EbcInterpret (IN UINTN EntryPoint, IN UINTN Arg1, IN UINTN Arg2, IN UINTN Arg3, IN UINTN Arg4, IN UINTN Arg5, IN UINTN Arg6, IN UINTN Arg7, IN UINTN Arg8, IN UINTN Arg9, IN UINTN Arg10, IN UINTN Arg11, IN UINTN Arg12, IN UINTN Arg13, IN UINTN Arg14, IN UINTN Arg15, IN UINTN Arg16) |
UINT64 EFIAPI | ExecuteEbcImageEntryPoint (IN UINTN EntryPoint, IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
EFI_STATUS | EbcCreateThunks (IN EFI_HANDLE ImageHandle, IN VOID *EbcEntryPoint, OUT VOID **Thunk, IN UINT32 Flags) |
Variables | |
UINT8 | mInstructionBufferTemplate [] |
This module contains EBC support routines that are customized based on the target ia32 processor.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file EbcSupport.c.
#define EBC_ENTRYPOINT_SIGNATURE 0xAFAFAFAF |
Definition at line 27 of file EbcSupport.c.
#define EBC_LL_EBC_ENTRYPOINT_SIGNATURE 0xFAFAFAFA |
Definition at line 28 of file EbcSupport.c.
#define STACK_REMAIN_SIZE (1024 * 4) |
Definition at line 22 of file EbcSupport.c.
#define VM_STACK_SIZE (1024 * 4) |
Definition at line 20 of file EbcSupport.c.
EFI_STATUS EbcCreateThunks | ( | IN EFI_HANDLE | ImageHandle, |
IN VOID * | EbcEntryPoint, | ||
OUT VOID ** | Thunk, | ||
IN UINT32 | Flags | ||
) |
Create thunks for an EBC image entry point, or an EBC protocol service.
ImageHandle | Image handle for the EBC image. If not null, then we're creating a thunk for an image entry point. |
EbcEntryPoint | Address of the EBC code that the thunk is to call |
Thunk | Returned thunk we create here |
Flags | Flags indicating options for creating the thunk |
EFI_SUCCESS | The thunk was created successfully. |
EFI_INVALID_PARAMETER | The parameter of EbcEntryPoint is not 16-bit aligned. |
EFI_OUT_OF_RESOURCES | There is not enough memory to created the EBC Thunk. |
EFI_BUFFER_TOO_SMALL | EBC_THUNK_SIZE is not larger enough. |
Definition at line 461 of file EbcSupport.c.
UINT64 EFIAPI EbcInterpret | ( | IN UINTN | EntryPoint, |
IN UINTN | Arg1, | ||
IN UINTN | Arg2, | ||
IN UINTN | Arg3, | ||
IN UINTN | Arg4, | ||
IN UINTN | Arg5, | ||
IN UINTN | Arg6, | ||
IN UINTN | Arg7, | ||
IN UINTN | Arg8, | ||
IN UINTN | Arg9, | ||
IN UINTN | Arg10, | ||
IN UINTN | Arg11, | ||
IN UINTN | Arg12, | ||
IN UINTN | Arg13, | ||
IN UINTN | Arg14, | ||
IN UINTN | Arg15, | ||
IN UINTN | Arg16 | ||
) |
Begin executing an EBC image.
This is a thunk function. Microsoft x64 compiler only provide fast_call calling convention, so the first four arguments are passed by rcx, rdx, r8, and r9, while other arguments are passed in stack.
EntryPoint | The entrypoint of EBC code. |
Arg1 | The 1st argument. |
Arg2 | The 2nd argument. |
Arg3 | The 3rd argument. |
Arg4 | The 4th argument. |
Arg5 | The 5th argument. |
Arg6 | The 6th argument. |
Arg7 | The 7th argument. |
Arg8 | The 8th argument. |
Arg9 | The 9th argument. |
Arg10 | The 10th argument. |
Arg11 | The 11th argument. |
Arg12 | The 12th argument. |
Arg13 | The 13th argument. |
Arg14 | The 14th argument. |
Arg15 | The 15th argument. |
Arg16 | The 16th argument. |
Definition at line 205 of file EbcSupport.c.
VOID EbcLLCALLEX | ( | IN VM_CONTEXT * | VmPtr, |
IN UINTN | FuncAddr, | ||
IN UINTN | NewStackPointer, | ||
IN VOID * | FramePtr, | ||
IN UINT8 | Size | ||
) |
This function is called to execute an EBC CALLEX instruction. The function check the callee's content to see whether it is common native code or a thunk to another piece of EBC code. If the callee is common native code, use EbcLLCAllEXASM to manipulate, otherwise, set the VM->IP to target EBC code directly to avoid another VM be startup which cost time and stack space.
VmPtr | Pointer to a VM context. |
FuncAddr | Callee's address |
NewStackPointer | New stack pointer after the call |
FramePtr | New frame pointer after the call |
Size | The size of call instruction |
Definition at line 104 of file EbcSupport.c.
UINT64 EFIAPI EbcLLEbcInterpret | ( | VOID | ) |
Begin executing an EBC image. This is used for Ebc Thunk call.
UINT64 EFIAPI EbcLLExecuteEbcImageEntryPoint | ( | VOID | ) |
Begin executing an EBC image. This is used for Ebc image entrypoint.
UINT64 EFIAPI ExecuteEbcImageEntryPoint | ( | IN UINTN | EntryPoint, |
IN EFI_HANDLE | ImageHandle, | ||
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Begin executing an EBC image.
EntryPoint | The entrypoint of EBC code. |
ImageHandle | image handle for the EBC application we're executing |
SystemTable | standard system table passed into an driver's entry point |
Definition at line 355 of file EbcSupport.c.
UINT8 mInstructionBufferTemplate[] |
Definition at line 29 of file EbcSupport.c.