TianoCore EDK2 master
Loading...
Searching...
No Matches
EmuThunk.h
Go to the documentation of this file.
1
10#ifndef __EMU_THUNK_PPI_H__
11#define __EMU_THUNK_PPI_H__
12
13#define EMU_THUNK_PPI_GUID \
14 { 0xB958B78C, 0x1D3E, 0xEE40, { 0x8B, 0xF4, 0xF0, 0x63, 0x2D, 0x06, 0x39, 0x16 } }
15
16/*++
17
18Routine Description:
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.
21
22Arguments:
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
26
27Returns:
28 EFI_SUCCESS - If memory region was mapped
29 EFI_UNSUPPORTED - If Index is not supported
30
31**/
32typedef
34(EFIAPI *EMU_PEI_AUTOSCAN)(
35 IN UINTN Index,
36 OUT EFI_PHYSICAL_ADDRESS *MemoryBase,
37 OUT UINT64 *MemorySize
38 );
39
40/*++
41
42Routine Description:
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.
45
46Arguments:
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
51
52Returns:
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
55
56**/
57typedef
59(EFIAPI *EMU_PEI_FD_INFORMATION)(
60 IN UINTN Index,
62 IN OUT UINT64 *FdSize,
64 );
65
66/*++
67
68Routine Description:
69 Export of EMU_THUNK_PROTOCOL from the SEC.
70
71Returns:
72 EFI_SUCCESS - Data returned
73
74**/
75typedef
76VOID *
77(EFIAPI *EMU_PEI_THUNK_INTERFACE)(
78 VOID
79 );
80
81/*++
82
83Routine Description:
84 Loads and relocates a PE/COFF image into memory.
85
86Arguments:
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
91
92Returns:
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
95
96**/
97typedef
99(EFIAPI *EMU_PEI_LOAD_FILE)(
100 VOID *Pe32Data,
101 EFI_PHYSICAL_ADDRESS *ImageAddress,
102 UINT64 *ImageSize,
103 EFI_PHYSICAL_ADDRESS *EntryPoint
104 );
105
106typedef struct {
107 EMU_PEI_AUTOSCAN MemoryAutoScan;
108 EMU_PEI_FD_INFORMATION FirmwareDevices;
109 EMU_PEI_THUNK_INTERFACE Thunk;
110 INTN Argc;
111 CHAR8 **Argv;
112 CHAR8 **Envp;
113 UINTN PersistentMemorySize;
114 UINT8 PersistentMemory[0];
116
117extern EFI_GUID gEmuThunkPpiGuid;
118
119#endif
UINT64 UINTN
INT64 INTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
Definition: Base.h:213