]>
Commit | Line | Data |
---|---|---|
949f388f | 1 | /** @file\r |
2 | Emulator Thunk to abstract OS services from pure EFI code\r | |
3 | \r | |
4 | Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>\r | |
d18d8a1d | 5 | \r |
949f388f | 6 | This program and the accompanying materials\r |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef __EMU_THUNK_PPI_H__\r | |
17 | #define __EMU_THUNK_PPI_H__\r | |
18 | \r | |
19 | #define EMU_THUNK_PPI_GUID \\r | |
20 | { 0xB958B78C, 0x1D3E, 0xEE40, { 0x8B, 0xF4, 0xF0, 0x63, 0x2D, 0x06, 0x39, 0x16 } }\r | |
21 | \r | |
22 | \r | |
23 | \r | |
24 | /*++\r | |
25 | \r | |
26 | Routine Description:\r | |
27 | This service is called from Index == 0 until it returns EFI_UNSUPPORTED.\r | |
28 | It allows discontiguous memory regions to be supported by the emulator.\r | |
29 | \r | |
30 | Arguments:\r | |
31 | Index - Which memory region to use\r | |
32 | MemoryBase - Return Base address of memory region\r | |
33 | MemorySize - Return size in bytes of the memory region\r | |
34 | \r | |
35 | Returns:\r | |
36 | EFI_SUCCESS - If memory region was mapped\r | |
37 | EFI_UNSUPPORTED - If Index is not supported\r | |
38 | \r | |
39 | **/\r | |
40 | typedef\r | |
41 | EFI_STATUS\r | |
42 | (EFIAPI *EMU_PEI_AUTOSCAN) (\r | |
43 | IN UINTN Index,\r | |
44 | OUT EFI_PHYSICAL_ADDRESS *MemoryBase,\r | |
45 | OUT UINT64 *MemorySize\r | |
46 | );\r | |
47 | \r | |
48 | \r | |
49 | /*++\r | |
50 | \r | |
51 | Routine Description:\r | |
d18d8a1d | 52 | Return the FD Size and base address. Since the FD is loaded from a\r |
949f388f | 53 | file into host memory only the SEC will know it's address.\r |
54 | \r | |
55 | Arguments:\r | |
56 | Index - Which FD, starts at zero.\r | |
57 | FdSize - Size of the FD in bytes\r | |
58 | FdBase - Start address of the FD. Assume it points to an FV Header\r | |
59 | FixUp - Difference between actual FD address and build address\r | |
60 | \r | |
61 | Returns:\r | |
62 | EFI_SUCCESS - Return the Base address and size of the FV\r | |
63 | EFI_UNSUPPORTED - Index does nto map to an FD in the system\r | |
64 | \r | |
65 | **/\r | |
66 | typedef\r | |
67 | EFI_STATUS\r | |
68 | (EFIAPI *EMU_PEI_FD_INFORMATION) (\r | |
69 | IN UINTN Index,\r | |
70 | IN OUT EFI_PHYSICAL_ADDRESS *FdBase,\r | |
71 | IN OUT UINT64 *FdSize,\r | |
72 | IN OUT EFI_PHYSICAL_ADDRESS *FixUp\r | |
73 | );\r | |
74 | \r | |
75 | \r | |
76 | /*++\r | |
77 | \r | |
78 | Routine Description:\r | |
79 | Export of EMU_THUNK_PROTOCOL from the SEC.\r | |
80 | \r | |
81 | Returns:\r | |
82 | EFI_SUCCESS - Data returned\r | |
83 | \r | |
84 | **/\r | |
85 | typedef\r | |
86 | VOID *\r | |
87 | (EFIAPI *EMU_PEI_THUNK_INTERFACE) (\r | |
88 | VOID\r | |
89 | );\r | |
90 | \r | |
91 | \r | |
92 | \r | |
93 | /*++\r | |
94 | \r | |
95 | Routine Description:\r | |
96 | Loads and relocates a PE/COFF image into memory.\r | |
97 | \r | |
98 | Arguments:\r | |
99 | Pe32Data - The base address of the PE/COFF file that is to be loaded and relocated\r | |
100 | ImageAddress - The base address of the relocated PE/COFF image\r | |
101 | ImageSize - The size of the relocated PE/COFF image\r | |
102 | EntryPoint - The entry point of the relocated PE/COFF image\r | |
103 | \r | |
104 | Returns:\r | |
105 | EFI_SUCCESS - The file was loaded and relocated\r | |
106 | EFI_OUT_OF_RESOURCES - There was not enough memory to load and relocate the PE/COFF file\r | |
107 | \r | |
108 | **/\r | |
109 | typedef\r | |
110 | EFI_STATUS\r | |
111 | (EFIAPI *EMU_PEI_LOAD_FILE) (\r | |
112 | VOID *Pe32Data,\r | |
113 | EFI_PHYSICAL_ADDRESS *ImageAddress,\r | |
114 | UINT64 *ImageSize,\r | |
115 | EFI_PHYSICAL_ADDRESS *EntryPoint\r | |
116 | );\r | |
117 | \r | |
118 | \r | |
119 | typedef struct {\r | |
120 | EMU_PEI_AUTOSCAN MemoryAutoScan;\r | |
121 | EMU_PEI_FD_INFORMATION FirmwareDevices;\r | |
122 | EMU_PEI_THUNK_INTERFACE Thunk;\r | |
949f388f | 123 | } EMU_THUNK_PPI;\r |
124 | \r | |
125 | extern EFI_GUID gEmuThunkPpiGuid;\r | |
126 | \r | |
127 | #endif\r |