2 Emulator Thunk to abstract OS services from pure EFI code
4 Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef __EMU_THUNK_PPI_H__
17 #define __EMU_THUNK_PPI_H__
19 #define EMU_THUNK_PPI_GUID \
20 { 0xB958B78C, 0x1D3E, 0xEE40, { 0x8B, 0xF4, 0xF0, 0x63, 0x2D, 0x06, 0x39, 0x16 } }
27 This service is called from Index == 0 until it returns EFI_UNSUPPORTED.
28 It allows discontiguous memory regions to be supported by the emulator.
31 Index - Which memory region to use
32 MemoryBase - Return Base address of memory region
33 MemorySize - Return size in bytes of the memory region
36 EFI_SUCCESS - If memory region was mapped
37 EFI_UNSUPPORTED - If Index is not supported
42 (EFIAPI
*EMU_PEI_AUTOSCAN
) (
44 OUT EFI_PHYSICAL_ADDRESS
*MemoryBase
,
45 OUT UINT64
*MemorySize
52 Return the FD Size and base address. Since the FD is loaded from a
53 file into host memory only the SEC will know it's address.
56 Index - Which FD, starts at zero.
57 FdSize - Size of the FD in bytes
58 FdBase - Start address of the FD. Assume it points to an FV Header
59 FixUp - Difference between actual FD address and build address
62 EFI_SUCCESS - Return the Base address and size of the FV
63 EFI_UNSUPPORTED - Index does nto map to an FD in the system
68 (EFIAPI
*EMU_PEI_FD_INFORMATION
) (
70 IN OUT EFI_PHYSICAL_ADDRESS
*FdBase
,
71 IN OUT UINT64
*FdSize
,
72 IN OUT EFI_PHYSICAL_ADDRESS
*FixUp
79 Export of EMU_THUNK_PROTOCOL from the SEC.
82 EFI_SUCCESS - Data returned
87 (EFIAPI
*EMU_PEI_THUNK_INTERFACE
) (
96 Loads and relocates a PE/COFF image into memory.
99 Pe32Data - The base address of the PE/COFF file that is to be loaded and relocated
100 ImageAddress - The base address of the relocated PE/COFF image
101 ImageSize - The size of the relocated PE/COFF image
102 EntryPoint - The entry point of the relocated PE/COFF image
105 EFI_SUCCESS - The file was loaded and relocated
106 EFI_OUT_OF_RESOURCES - There was not enough memory to load and relocate the PE/COFF file
111 (EFIAPI
*EMU_PEI_LOAD_FILE
) (
113 EFI_PHYSICAL_ADDRESS
*ImageAddress
,
115 EFI_PHYSICAL_ADDRESS
*EntryPoint
120 EMU_PEI_AUTOSCAN MemoryAutoScan
;
121 EMU_PEI_FD_INFORMATION FirmwareDevices
;
122 EMU_PEI_THUNK_INTERFACE Thunk
;
125 extern EFI_GUID gEmuThunkPpiGuid
;