Efi_ebc_protocol.createthunk(), Createthunk(), Func – Intel Extensible Firmware Interface User Manual
Page 839

EFI Byte Code Virtual Machine
Version 1.10
12/01/02
19-65
EFI_EBC_PROTOCOL.CreateThunk()
Summary
Creates a thunk for an EBC entry point, returning the address of the thunk.
Prototype
typedef
EFI_STATUS
(EFIAPI *EFI_EBC_CREATE_THUNK) (
IN EFI_EBC_PROTOCOL
*This,
IN EFI_HANDLE
ImageHandle,
IN VOID
*EbcEntryPoint,
OUT VOID
**Thunk
);
Parameters
This
A pointer to the
instance. This protocol is
defined in Section 19.11.
ImageHandle
Handle of image for which the thunk is being created.
EbcEntryPoint
Address of the actual EBC entry point or protocol service the
thunk should call.
Thunk
Returned pointer to a thunk created.
Description
A PE32+ EBC image, like any other PE32+ image, contains an optional header that specifies the
entry point for image execution. However for EBC images this is the entry point of EBC
instructions, so is not directly executable by the native processor. Therefore when an EBC image is
loaded, the loader must call this service to get a pointer to native code (thunk) that can be executed
which will invoke the interpreter to begin execution at the original EBC entry point.
Status Codes Returned
EFI_SUCCESS
The function completed successfully.
EFI_INVALID_PARAMETER
Image entry point is not 2-byte aligned.
EFI_OUT_OF_RESOURCES
Memory could not be allocated for the thunk.