2 Emulator Thunk to abstract OS services from pure EFI code
4 Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __EMU_THUNK_PPI_H__
11 #define __EMU_THUNK_PPI_H__
13 #define EMU_THUNK_PPI_GUID \
14 { 0xB958B78C, 0x1D3E, 0xEE40, { 0x8B, 0xF4, 0xF0, 0x63, 0x2D, 0x06, 0x39, 0x16 } }
19 This service is called from Index == 0 until it returns EFI_UNSUPPORTED.
20 It allows discontinuous memory regions to be supported by the emulator.
23 Index - Which memory region to use
24 MemoryBase - Return Base address of memory region
25 MemorySize - Return size in bytes of the memory region
28 EFI_SUCCESS - If memory region was mapped
29 EFI_UNSUPPORTED - If Index is not supported
34 (EFIAPI
*EMU_PEI_AUTOSCAN
)(
36 OUT EFI_PHYSICAL_ADDRESS
*MemoryBase
,
37 OUT UINT64
*MemorySize
43 Return the FD Size and base address. Since the FD is loaded from a
44 file into host memory only the SEC will know it's address.
47 Index - Which FD, starts at zero.
48 FdSize - Size of the FD in bytes
49 FdBase - Start address of the FD. Assume it points to an FV Header
50 FixUp - Difference between actual FD address and build address
53 EFI_SUCCESS - Return the Base address and size of the FV
54 EFI_UNSUPPORTED - Index does nto map to an FD in the system
59 (EFIAPI
*EMU_PEI_FD_INFORMATION
)(
61 IN OUT EFI_PHYSICAL_ADDRESS
*FdBase
,
62 IN OUT UINT64
*FdSize
,
63 IN OUT EFI_PHYSICAL_ADDRESS
*FixUp
69 Export of EMU_THUNK_PROTOCOL from the SEC.
72 EFI_SUCCESS - Data returned
77 (EFIAPI
*EMU_PEI_THUNK_INTERFACE
)(
84 Loads and relocates a PE/COFF image into memory.
87 Pe32Data - The base address of the PE/COFF file that is to be loaded and relocated
88 ImageAddress - The base address of the relocated PE/COFF image
89 ImageSize - The size of the relocated PE/COFF image
90 EntryPoint - The entry point of the relocated PE/COFF image
93 EFI_SUCCESS - The file was loaded and relocated
94 EFI_OUT_OF_RESOURCES - There was not enough memory to load and relocate the PE/COFF file
99 (EFIAPI
*EMU_PEI_LOAD_FILE
)(
101 EFI_PHYSICAL_ADDRESS
*ImageAddress
,
103 EFI_PHYSICAL_ADDRESS
*EntryPoint
107 EMU_PEI_AUTOSCAN MemoryAutoScan
;
108 EMU_PEI_FD_INFORMATION FirmwareDevices
;
109 EMU_PEI_THUNK_INTERFACE Thunk
;
112 extern EFI_GUID gEmuThunkPpiGuid
;