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

Go to the source code of this file.

Data Structures

struct  _EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL
 

Macros

#define EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL_GUID    { 0x96F46153, 0x97A7, 0x4793, { 0xAC, 0xC1, 0xFA, 0x19, 0xBF, 0x78, 0xEA, 0x97 } }
 
#define EDKII_PECOFF_IMAGE_EMULATOR_VERSION   0x1
 

Typedefs

typedef struct _EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL
 
typedef BOOLEAN(EFIAPI * EDKII_PECOFF_IMAGE_EMULATOR_IS_IMAGE_SUPPORTED) (IN EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL *This, IN UINT16 ImageType, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL)
 
typedef EFI_STATUS(EFIAPI * EDKII_PECOFF_IMAGE_EMULATOR_REGISTER_IMAGE) (IN EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL *This, IN EFI_PHYSICAL_ADDRESS ImageBase, IN UINT64 ImageSize, IN OUT EFI_IMAGE_ENTRY_POINT *EntryPoint)
 
typedef EFI_STATUS(EFIAPI * EDKII_PECOFF_IMAGE_EMULATOR_UNREGISTER_IMAGE) (IN EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL *This, IN EFI_PHYSICAL_ADDRESS ImageBase)
 

Variables

EFI_GUID gEdkiiPeCoffImageEmulatorProtocolGuid
 

Detailed Description

Copyright (c) 2019, Linaro, Ltd. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PeCoffImageEmulator.h.

Macro Definition Documentation

◆ EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL_GUID

#define EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL_GUID    { 0x96F46153, 0x97A7, 0x4793, { 0xAC, 0xC1, 0xFA, 0x19, 0xBF, 0x78, 0xEA, 0x97 } }

Definition at line 10 of file PeCoffImageEmulator.h.

◆ EDKII_PECOFF_IMAGE_EMULATOR_VERSION

#define EDKII_PECOFF_IMAGE_EMULATOR_VERSION   0x1

Definition at line 85 of file PeCoffImageEmulator.h.

Typedef Documentation

◆ EDKII_PECOFF_IMAGE_EMULATOR_IS_IMAGE_SUPPORTED

typedef BOOLEAN(EFIAPI * EDKII_PECOFF_IMAGE_EMULATOR_IS_IMAGE_SUPPORTED) (IN EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL *This, IN UINT16 ImageType, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL)

Check whether the emulator supports executing a certain PE/COFF image

Parameters
[in]ThisThis pointer for EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL structure
[in]ImageTypeWhether the image is an application, a boot time driver or a runtime driver.
[in]DevicePathPath to device where the image originated (e.g., a PCI option ROM)
Return values
TRUEThe image is supported by the emulator
FALSEThe image is not supported by the emulator.

Definition at line 29 of file PeCoffImageEmulator.h.

◆ EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL

◆ EDKII_PECOFF_IMAGE_EMULATOR_REGISTER_IMAGE

typedef EFI_STATUS(EFIAPI * EDKII_PECOFF_IMAGE_EMULATOR_REGISTER_IMAGE) (IN EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL *This, IN EFI_PHYSICAL_ADDRESS ImageBase, IN UINT64 ImageSize, IN OUT EFI_IMAGE_ENTRY_POINT *EntryPoint)

Register a supported PE/COFF image with the emulator. After this call completes successfully, the PE/COFF image may be started as usual, and it is the responsibility of the emulator implementation that any branch into the code section of the image (including returns from functions called from the foreign code) is executed as if it were running on the machine type it was built for.

Parameters
[in]ThisThis pointer for EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL structure
[in]ImageBaseThe base address in memory of the PE/COFF image
[in]ImageSizeThe size in memory of the PE/COFF image
[in,out]EntryPointThe entry point of the PE/COFF image. Passed by reference so that the emulator may modify it.
Return values
EFI_SUCCESSThe image was registered with the emulator and can be started as usual.
otherThe image could not be registered.

If the PE/COFF machine type or image type are not supported by the emulator, then ASSERT().

Definition at line 59 of file PeCoffImageEmulator.h.

◆ EDKII_PECOFF_IMAGE_EMULATOR_UNREGISTER_IMAGE

typedef EFI_STATUS(EFIAPI * EDKII_PECOFF_IMAGE_EMULATOR_UNREGISTER_IMAGE) (IN EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL *This, IN EFI_PHYSICAL_ADDRESS ImageBase)

Unregister a PE/COFF image that has been registered with the emulator. This should be done before the image is unloaded from memory.

Parameters
[in]ThisThis pointer for EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL structure
[in]ImageBaseThe base address in memory of the PE/COFF image
Return values
EFI_SUCCESSThe image was unregistered with the emulator.
otherImage could not be unloaded.

Definition at line 79 of file PeCoffImageEmulator.h.