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 } }
21 This service is called from Index == 0 until it returns EFI_UNSUPPORTED.
22 It allows discontinuous memory regions to be supported by the emulator.
25 Index - Which memory region to use
26 MemoryBase - Return Base address of memory region
27 MemorySize - Return size in bytes of the memory region
30 EFI_SUCCESS - If memory region was mapped
31 EFI_UNSUPPORTED - If Index is not supported
36 (EFIAPI
*EMU_PEI_AUTOSCAN
) (
38 OUT EFI_PHYSICAL_ADDRESS
*MemoryBase
,
39 OUT UINT64
*MemorySize
46 Return the FD Size and base address. Since the FD is loaded from a
47 file into host memory only the SEC will know it's address.
50 Index - Which FD, starts at zero.
51 FdSize - Size of the FD in bytes
52 FdBase - Start address of the FD. Assume it points to an FV Header
53 FixUp - Difference between actual FD address and build address
56 EFI_SUCCESS - Return the Base address and size of the FV
57 EFI_UNSUPPORTED - Index does nto map to an FD in the system
62 (EFIAPI
*EMU_PEI_FD_INFORMATION
) (
64 IN OUT EFI_PHYSICAL_ADDRESS
*FdBase
,
65 IN OUT UINT64
*FdSize
,
66 IN OUT EFI_PHYSICAL_ADDRESS
*FixUp
73 Export of EMU_THUNK_PROTOCOL from the SEC.
76 EFI_SUCCESS - Data returned
81 (EFIAPI
*EMU_PEI_THUNK_INTERFACE
) (
90 Loads and relocates a PE/COFF image into memory.
93 Pe32Data - The base address of the PE/COFF file that is to be loaded and relocated
94 ImageAddress - The base address of the relocated PE/COFF image
95 ImageSize - The size of the relocated PE/COFF image
96 EntryPoint - The entry point of the relocated PE/COFF image
99 EFI_SUCCESS - The file was loaded and relocated
100 EFI_OUT_OF_RESOURCES - There was not enough memory to load and relocate the PE/COFF file
105 (EFIAPI
*EMU_PEI_LOAD_FILE
) (
107 EFI_PHYSICAL_ADDRESS
*ImageAddress
,
109 EFI_PHYSICAL_ADDRESS
*EntryPoint
114 EMU_PEI_AUTOSCAN MemoryAutoScan
;
115 EMU_PEI_FD_INFORMATION FirmwareDevices
;
116 EMU_PEI_THUNK_INTERFACE Thunk
;
119 extern EFI_GUID gEmuThunkPpiGuid
;