]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /** @file\r |
2 | The EFI Legacy BIOS Patform Protocol is used to mate a Legacy16 \r | |
3 | implementation with this EFI code. The EFI driver that produces \r | |
4 | the Legacy BIOS protocol is generic and consumes this protocol.\r | |
5 | A driver that matches the Legacy16 produces this protocol\r | |
6 | \r | |
7 | Copyright (c) 2006, Intel Corporation \r | |
8 | All rights reserved. This program and the accompanying materials \r | |
9 | are licensed and made available under the terms and conditions of the BSD License \r | |
10 | which accompanies this distribution. The full text of the license may be found at \r | |
11 | http://opensource.org/licenses/bsd-license.php \r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
15 | \r | |
16 | Module Name: LegacyBiosPlatform.h\r | |
17 | \r | |
18 | @par Revision Reference:\r | |
19 | This protocol is defined in Framework for EFI Compatibility Support Module spec\r | |
20 | Version 0.96\r | |
21 | **/\r | |
22 | \r | |
23 | #ifndef _EFI_LEGACY_BIOS_PLATFORM_H\r | |
24 | #define _EFI_LEGACY_BIOS_PLATFORM_H\r | |
25 | \r | |
26 | #define EFI_LEGACY_BIOS_PLATFORM_PROTOCOL_GUID \\r | |
27 | { \\r | |
28 | 0x783658a3, 0x4172, 0x4421, {0xa2, 0x99, 0xe0, 0x9, 0x7, 0x9c, 0xc, 0xb4 } \\r | |
29 | }\r | |
30 | \r | |
31 | typedef struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL EFI_LEGACY_BIOS_PLATFORM_PROTOCOL;\r | |
32 | \r | |
33 | #pragma pack(1)\r | |
34 | //\r | |
35 | // Define structures for GetOemIntData\r | |
36 | // Note:\r | |
37 | // OemIntDataElenent is an array of structures from 0 to Count-1.\r | |
38 | // RawData is an array of bytes from 0 to RamDataLength-1.\r | |
39 | //\r | |
40 | typedef struct {\r | |
41 | UINT16 Int;\r | |
42 | UINT16 Ax;\r | |
43 | UINT32 RawDataLength;\r | |
44 | UINT8 RawData[1];\r | |
45 | } EFI_OEM_INT_DATA_ELEMENT;\r | |
46 | \r | |
47 | typedef struct {\r | |
48 | UINT16 Count;\r | |
49 | EFI_OEM_INT_DATA_ELEMENT OemIntDataElement[1];\r | |
50 | } EFI_OEM_INT_DATA;\r | |
51 | #pragma pack()\r | |
52 | \r | |
53 | typedef enum {\r | |
54 | EfiGetPlatformBinaryMpTable = 0,\r | |
55 | EfiGetPlatformBinaryOemIntData = 1,\r | |
56 | EfiGetPlatformBinaryOem16Data = 2,\r | |
57 | EfiGetPlatformBinaryOem32Data = 3,\r | |
58 | EfiGetPlatformBinaryTpmBinary = 4,\r | |
59 | EfiGetPlatformBinarySystemRom = 5,\r | |
60 | EfiGetPlatformPciExpressBase = 6,\r | |
61 | EfiGetPlatformPmmSize = 7,\r | |
62 | EfiGetPlatformEndOpromShadowAddr = 8,\r | |
63 | \r | |
64 | } EFI_GET_PLATFORM_INFO_MODE;\r | |
65 | \r | |
66 | typedef enum {\r | |
67 | EfiGetPlatformVgaHandle = 0,\r | |
68 | EfiGetPlatformIdeHandle = 1,\r | |
69 | EfiGetPlatformIsaBusHandle = 2,\r | |
70 | EfiGetPlatformUsbHandle = 3\r | |
71 | } EFI_GET_PLATFORM_HANDLE_MODE;\r | |
72 | \r | |
73 | typedef enum {\r | |
74 | EfiPlatformHookPrepareToScanRom = 0,\r | |
75 | EfiPlatformHookShadowServiceRoms= 1,\r | |
76 | EfiPlatformHookAfterRomInit = 2\r | |
77 | } EFI_GET_PLATFORM_HOOK_MODE;\r | |
78 | \r | |
79 | /**\r | |
80 | Finds the binary data or other platform information.\r | |
81 | \r | |
0647c9ad LG |
82 | @param This Protocol instance pointer.\r |
83 | @param Mode Specifies what data to return\r | |
84 | @param Table Pointer to MP table.\r | |
85 | @param TableSize Size in bytes of table.\r | |
86 | @param Location Legacy region requested\r | |
87 | 0x00 = Any location\r | |
88 | Bit 0 = 0xF0000 region\r | |
89 | Bit 1 = 0xE0000 region\r | |
90 | Multiple bits can be set\r | |
91 | @param Alignment Address alignment for allocation.\r | |
92 | Bit mapped. First non-zero bit from right\r | |
93 | is alignment.\r | |
94 | @param LegacySegment Segment in LegacyBios where Table is stored\r | |
95 | @param LegacyOffset Offset in LegacyBios where Table is stored\r | |
96 | \r | |
97 | @retval EFI_SUCCESS Data was returned successfully.\r | |
98 | @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r | |
99 | @retval EFI_NOT_FOUND Binary image or table not found.\r | |
878ddf1f | 100 | \r |
101 | **/\r | |
102 | typedef\r | |
103 | EFI_STATUS\r | |
104 | (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO) (\r | |
105 | IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r | |
106 | IN EFI_GET_PLATFORM_INFO_MODE Mode,\r | |
107 | OUT VOID **Table,\r | |
108 | OUT UINTN *TableSize,\r | |
109 | OUT UINTN *Location,\r | |
110 | OUT UINTN *Alignment,\r | |
111 | IN UINT16 LegacySegment,\r | |
112 | IN UINT16 LegacyOffset\r | |
113 | )\r | |
114 | ;\r | |
115 | \r | |
116 | /**\r | |
117 | Returns a buffer of handles for the requested sub-function.\r | |
118 | \r | |
0647c9ad LG |
119 | @param This Protocol instance pointer.\r |
120 | @param Mode Specifies what handle to return.\r | |
121 | @param Type Type from Device Path for Handle to represent.\r | |
122 | @param HandleBuffer Handles of the device/controller in priority order\r | |
123 | with HandleBuffer[0] highest priority.\r | |
124 | @param HandleCount Number of handles in the buffer.\r | |
125 | @param AdditionalData Mode specific.\r | |
878ddf1f | 126 | \r |
0647c9ad LG |
127 | @retval EFI_SUCCESS Handle is valid\r |
128 | @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r | |
129 | @retval EFI_NOT_FOUND Handle is not known\r | |
878ddf1f | 130 | \r |
131 | **/\r | |
132 | typedef\r | |
133 | EFI_STATUS\r | |
134 | (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE) (\r | |
135 | IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r | |
136 | IN EFI_GET_PLATFORM_HANDLE_MODE Mode,\r | |
137 | IN UINT16 Type,\r | |
138 | OUT EFI_HANDLE **HandleBuffer,\r | |
139 | OUT UINTN *HandleCount,\r | |
140 | IN VOID **AdditionalData OPTIONAL\r | |
141 | )\r | |
142 | ;\r | |
143 | \r | |
144 | /**\r | |
145 | Load and initialize the Legacy BIOS SMM handler.\r | |
146 | \r | |
0647c9ad | 147 | @param This Protocol instance pointer.\r |
878ddf1f | 148 | @param EfiToLegacy16BootTable Pointer to Legacy16 boot table.\r |
149 | \r | |
0647c9ad LG |
150 | @retval EFI_SUCCESS SMM code loaded.\r |
151 | @retval EFI_DEVICE_ERROR SMM code failed to load\r | |
878ddf1f | 152 | \r |
153 | **/\r | |
154 | typedef\r | |
155 | EFI_STATUS\r | |
156 | (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_SMM_INIT) (\r | |
157 | IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r | |
158 | IN VOID *EfiToLegacy16BootTable\r | |
159 | )\r | |
160 | ;\r | |
161 | \r | |
162 | /**\r | |
163 | Allows platform to perform any required action after a LegacyBios operation.\r | |
164 | \r | |
0647c9ad LG |
165 | @param This Protocol instance pointer.\r |
166 | @param Mode Specifies what handle to return.\r | |
167 | @param Type Mode specific.\r | |
168 | @param DeviceHandle List of PCI devices in the system.\r | |
169 | @param ShadowAddress First free OpROM area, after other OpROMs have been dispatched.\r | |
170 | @param Compatibility16Table Pointer to Compatibility16Table.\r | |
511710d6 | 171 | @param AdditionalData Mode specific Pointer to additional data returned - mode specific.\r |
878ddf1f | 172 | \r |
0647c9ad LG |
173 | @retval EFI_SUCCESS RomImage is valid\r |
174 | @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r | |
878ddf1f | 175 | \r |
176 | **/\r | |
177 | typedef\r | |
178 | EFI_STATUS\r | |
179 | (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_HOOKS) (\r | |
180 | IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r | |
181 | IN EFI_GET_PLATFORM_HOOK_MODE Mode,\r | |
182 | IN UINT16 Type,\r | |
183 | IN EFI_HANDLE DeviceHandle,\r | |
184 | IN OUT UINTN *ShadowAddress,\r | |
185 | IN EFI_COMPATIBILITY16_TABLE *Compatibility16Table,\r | |
186 | IN VOID **AdditionalData OPTIONAL\r | |
187 | )\r | |
188 | ;\r | |
189 | \r | |
190 | /**\r | |
191 | Returns information associated with PCI IRQ routing.\r | |
192 | \r | |
0647c9ad LG |
193 | @param This Protocol instance pointer.\r |
194 | @param RoutingTable Pointer to PCI IRQ Routing table.\r | |
195 | @param RoutingTableEntries Number of entries in table.\r | |
196 | @param LocalPirqTable $PIR table\r | |
197 | @param PirqTableSize $PIR table size\r | |
198 | @param LocalIrqPriorityTable List of interrupts in priority order to assign\r | |
199 | @param IrqPriorityTableEntries Number of entries in priority table\r | |
878ddf1f | 200 | \r |
0647c9ad | 201 | @retval EFI_SUCCESS Data was successfully returned.\r |
878ddf1f | 202 | \r |
203 | **/\r | |
204 | typedef\r | |
205 | EFI_STATUS\r | |
206 | (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE) (\r | |
207 | IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r | |
208 | OUT VOID **RoutingTable,\r | |
209 | OUT UINTN *RoutingTableEntries,\r | |
210 | OUT VOID **LocalPirqTable, OPTIONAL\r | |
211 | OUT UINTN *PirqTableSize, OPTIONAL\r | |
212 | OUT VOID **LocalIrqPriorityTable, OPTIONAL\r | |
213 | OUT UINTN *IrqPriorityTableEntries OPTIONAL\r | |
214 | )\r | |
215 | ;\r | |
216 | \r | |
217 | /**\r | |
218 | Translates the given PIRQ accounting for bridge\r | |
219 | \r | |
0647c9ad LG |
220 | @param This Protocol instance pointer.\r |
221 | @param PciBus PCI bus number for this device.\r | |
222 | @param PciDevice PCI device number for this device.\r | |
223 | @param PciFunction PCI function number for this device.\r | |
224 | @param Pirq Input is PIRQ reported by device, output is true PIRQ.\r | |
225 | @param PciIrq The IRQ already assigned to the PIRQ or the IRQ to be\r | |
226 | assigned to the PIRQ.\r | |
878ddf1f | 227 | \r |
0647c9ad | 228 | @retval EFI_SUCCESS The PIRQ was translated.\r |
878ddf1f | 229 | \r |
230 | **/\r | |
231 | typedef\r | |
232 | EFI_STATUS\r | |
233 | (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ) (\r | |
234 | IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r | |
235 | IN UINTN PciBus,\r | |
236 | IN UINTN PciDevice,\r | |
237 | IN UINTN PciFunction,\r | |
238 | IN OUT UINT8 *Pirq,\r | |
239 | OUT UINT8 *PciIrq\r | |
240 | )\r | |
241 | ;\r | |
242 | \r | |
243 | /**\r | |
244 | Attempt to legacy boot the BootOption. If the EFI contexted has been \r | |
245 | compromised this function will not return.\r | |
246 | \r | |
0647c9ad LG |
247 | @param This Protocol instance pointer.\r |
248 | @param BbsDevicePath EFI Device Path from BootXXXX variable.\r | |
249 | @param BbsTable Internal BBS table.\r | |
250 | @param LoadOptionSize Size of LoadOption in size.\r | |
251 | @param LoadOption LoadOption from BootXXXX variable\r | |
878ddf1f | 252 | @param EfiToLegacy16BootTable Pointer to BootTable structure\r |
253 | \r | |
0647c9ad | 254 | @retval EFI_SUCCESS Ready to boot.\r |
878ddf1f | 255 | \r |
256 | **/\r | |
257 | typedef\r | |
258 | EFI_STATUS\r | |
259 | (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT) (\r | |
260 | IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r | |
261 | IN BBS_BBS_DEVICE_PATH *BbsDevicePath,\r | |
262 | IN VOID *BbsTable,\r | |
263 | IN UINT32 LoadOptionsSize,\r | |
264 | IN VOID *LoadOptions,\r | |
265 | IN VOID *EfiToLegacy16BootTable\r | |
266 | )\r | |
267 | ;\r | |
268 | \r | |
269 | /**\r | |
270 | @par Protocol Description:\r | |
271 | Abstracts the platform portion of the traditional BIOS. \r | |
272 | \r | |
273 | @param GetPlatformInfo\r | |
274 | Gets binary data or other platform information.\r | |
275 | \r | |
276 | @param GetPlatformHandle\r | |
277 | Returns a buffer of all handles matching the requested subfunction. \r | |
278 | \r | |
279 | @param SmmInit\r | |
280 | Loads and initializes the traditional BIOS SMM handler.\r | |
281 | \r | |
282 | @param PlatformHooks\r | |
283 | Allows platform to perform any required actions after a LegacyBios operation.\r | |
284 | \r | |
285 | @param GetRoutingTable\r | |
286 | Gets $PIR table. \r | |
287 | \r | |
288 | @param TranslatePirq \r | |
289 | Translates the given PIRQ to the final value after traversing any PCI bridges. \r | |
290 | \r | |
291 | @param PrepareToBoot\r | |
292 | Final platform function before the system attempts to boot to a traditional OS. \r | |
293 | \r | |
294 | **/\r | |
295 | struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL {\r | |
296 | EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO GetPlatformInfo;\r | |
297 | EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE GetPlatformHandle;\r | |
298 | EFI_LEGACY_BIOS_PLATFORM_SMM_INIT SmmInit;\r | |
299 | EFI_LEGACY_BIOS_PLATFORM_HOOKS PlatformHooks;\r | |
300 | EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE GetRoutingTable;\r | |
301 | EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ TranslatePirq;\r | |
302 | EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT PrepareToBoot;\r | |
303 | };\r | |
304 | \r | |
305 | extern EFI_GUID gEfiLegacyBiosPlatformProtocolGuid;\r | |
306 | \r | |
307 | #endif\r |