]>
Commit | Line | Data |
---|---|---|
b522c77b | 1 | /** @file\r |
48cf40b8 | 2 | The EFI Legacy BIOS Platform Protocol is used to mate a Legacy16\r |
b522c77b HW |
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) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
8 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
9 | \r | |
10 | @par Revision Reference:\r | |
11 | This protocol is defined in Framework for EFI Compatibility Support Module spec\r | |
12 | Version 0.97.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef _EFI_LEGACY_BIOS_PLATFORM_H_\r | |
17 | #define _EFI_LEGACY_BIOS_PLATFORM_H_\r | |
18 | \r | |
19 | ///\r | |
20 | /// Legacy BIOS Platform depends on HDD_INFO and EFI_COMPATIBILITY16_TABLE that\r | |
21 | /// are defined with the Legacy BIOS Protocol\r | |
22 | ///\r | |
23 | #include <Protocol/LegacyBios.h>\r | |
24 | \r | |
25 | #define EFI_LEGACY_BIOS_PLATFORM_PROTOCOL_GUID \\r | |
26 | { \\r | |
27 | 0x783658a3, 0x4172, 0x4421, {0xa2, 0x99, 0xe0, 0x9, 0x7, 0x9c, 0xc, 0xb4 } \\r | |
28 | }\r | |
29 | \r | |
30 | typedef struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL EFI_LEGACY_BIOS_PLATFORM_PROTOCOL;\r | |
31 | \r | |
32 | /**\r | |
33 | This enum specifies the Mode param values for GetPlatformInfo()\r | |
34 | **/\r | |
35 | typedef enum {\r | |
36 | ///\r | |
37 | /// This mode is invoked twice. The first invocation has LegacySegment and\r | |
38 | /// LegacyOffset set to 0. The mode returns the MP table address in EFI memory, along with its size.\r | |
39 | /// The second invocation has LegacySegment and LegacyOffset set to the location\r | |
40 | /// in the 0xF0000 or 0xE0000 block to which the MP table is to be copied. The second\r | |
41 | /// invocation allows any MP table address fixes to occur in the EFI memory copy of the\r | |
42 | /// MP table. The caller, not EfiGetPlatformBinaryMpTable, copies the modified MP\r | |
43 | /// table to the allocated region in 0xF0000 or 0xE0000 block after the second invocation.\r | |
44 | ///\r | |
45 | /// The function parameters associated with this mode are:\r | |
46 | ///\r | |
47 | /// Table Pointer to the MP table.\r | |
48 | ///\r | |
49 | /// TableSize Size in bytes of the MP table.\r | |
50 | ///\r | |
51 | /// Location Location to place table. 0x00. Either 0xE0000 or 0xF0000 64 KB blocks.\r | |
52 | /// Bit 0 = 1 0xF0000 64 KB block.\r | |
53 | /// Bit 1 = 1 0xE0000 64 KB block.\r | |
54 | /// Multiple bits can be set.\r | |
55 | ///\r | |
56 | /// Alignment Bit-mapped address alignment granularity.\r | |
57 | /// The first nonzero bit from the right is the address granularity.\r | |
58 | ///\r | |
59 | // LegacySegment Segment in which EfiCompatibility code will place the MP table.\r | |
60 | ///\r | |
61 | /// LegacyOffset Offset in which EfiCompatibility code will place the MP table.\r | |
62 | ///\r | |
63 | /// The return values associated with this mode are:\r | |
64 | ///\r | |
65 | /// EFI_SUCCESS The MP table was returned.\r | |
66 | ///\r | |
67 | /// EFI_UNSUPPORTED The MP table is not supported on this platform.\r | |
68 | ///\r | |
ac0a286f | 69 | EfiGetPlatformBinaryMpTable = 0,\r |
b522c77b HW |
70 | ///\r |
71 | /// This mode returns a block of data. The content and usage is IBV or OEM defined.\r | |
72 | /// OEMs or IBVs normally use this function for nonstandard Compatibility16 runtime soft\r | |
73 | /// INTs. It is the responsibility of this routine to coalesce multiple OEM 16 bit functions, if\r | |
74 | /// they exist, into one coherent package that is understandable by the Compatibility16 code.\r | |
75 | /// This function is invoked twice. The first invocation has LegacySegment and\r | |
76 | /// LegacyOffset set to 0. The function returns the table address in EFI memory, as well as its size.\r | |
77 | /// The second invocation has LegacySegment and LegacyOffset set to the location\r | |
78 | /// in the 0xF0000 or 0xE0000 block to which the data (table) is to be copied. The second\r | |
79 | /// invocation allows any data (table) address fixes to occur in the EFI memory copy of\r | |
80 | /// the table. The caller, not GetOemIntData(), copies the modified data (table) to the\r | |
81 | /// allocated region in 0xF0000 or 0xE0000 block after the second invocation.\r | |
82 | ///\r | |
83 | /// The function parameters associated with this mode are:\r | |
84 | ///\r | |
85 | /// Table Pointer to OEM legacy 16 bit code or data.\r | |
86 | ///\r | |
87 | /// TableSize Size of data.\r | |
88 | ///\r | |
89 | /// Location Location to place table. 0x00. Either 0xE0000 or 0xF0000 64 KB blocks.\r | |
90 | /// Bit 0 = 1 0xF0000 64 KB block.\r | |
91 | /// Bit 1 = 1 0xE0000 64 KB block.\r | |
92 | /// Multiple bits can be set.\r | |
93 | ///\r | |
94 | /// Alignment Bit mapped address alignment granularity.\r | |
95 | /// The first nonzero bit from the right is the address granularity.\r | |
96 | ///\r | |
97 | /// LegacySegment Segment in which EfiCompatibility code will place the table or data.\r | |
98 | ///\r | |
99 | /// LegacyOffset Offset in which EfiCompatibility code will place the table or data.\r | |
100 | ///\r | |
101 | /// The return values associated with this mode are:\r | |
102 | ///\r | |
103 | /// EFI_SUCCESS The data was returned successfully.\r | |
104 | ///\r | |
105 | /// EFI_UNSUPPORTED Oem INT is not supported on this platform.\r | |
106 | ///\r | |
ac0a286f | 107 | EfiGetPlatformBinaryOemIntData = 1,\r |
b522c77b HW |
108 | ///\r |
109 | /// This mode returns a block of data. The content and usage is IBV defined. OEMs or\r | |
110 | /// IBVs normally use this mode for nonstandard Compatibility16 runtime 16 bit routines. It\r | |
111 | /// is the responsibility of this routine to coalesce multiple OEM 16 bit functions, if they\r | |
112 | /// exist, into one coherent package that is understandable by the Compatibility16 code.\r | |
113 | ///\r | |
114 | /// Example usage: A legacy mobile BIOS that has a pre-existing runtime\r | |
115 | /// interface to return the battery status to calling applications.\r | |
116 | ///\r | |
117 | /// This mode is invoked twice. The first invocation has LegacySegment and\r | |
118 | /// LegacyOffset set to 0. The mode returns the table address in EFI memory and its size.\r | |
119 | /// The second invocation has LegacySegment and LegacyOffset set to the location\r | |
120 | /// in the 0xF0000 or 0xE0000 block to which the table is to be copied. The second\r | |
121 | /// invocation allows any table address fixes to occur in the EFI memory copy of the table.\r | |
122 | /// The caller, not EfiGetPlatformBinaryOem16Data, copies the modified table to\r | |
123 | /// the allocated region in 0xF0000 or 0xE0000 block after the second invocation.\r | |
124 | ///\r | |
125 | /// The function parameters associated with this mode are:\r | |
126 | ///\r | |
127 | /// Table Pointer to OEM legacy 16 bit code or data.\r | |
128 | ///\r | |
129 | /// TableSize Size of data.\r | |
130 | ///\r | |
131 | /// Location Location to place the table. 0x00. Either 0xE0000 or 0xF0000 64 KB blocks.\r | |
132 | /// Bit 0 = 1 0xF0000 64 KB block.\r | |
133 | /// Bit 1 = 1 0xE0000 64 KB block.\r | |
134 | /// Multiple bits can be set.\r | |
135 | ///\r | |
136 | /// Alignment Bit mapped address alignment granularity.\r | |
137 | /// The first nonzero bit from the right is the address granularity.\r | |
138 | ///\r | |
139 | /// LegacySegment Segment in which EfiCompatibility code will place the table or data.\r | |
140 | ///\r | |
141 | /// LegacyOffset Offset in which EfiCompatibility code will place the table or data.\r | |
142 | ///\r | |
143 | /// The return values associated with this mode are:\r | |
144 | ///\r | |
145 | /// EFI_SUCCESS The data was returned successfully.\r | |
146 | ///\r | |
147 | /// EFI_UNSUPPORTED Oem16 is not supported on this platform.\r | |
148 | ///\r | |
ac0a286f MK |
149 | EfiGetPlatformBinaryOem16Data = 2,\r |
150 | ///\r | |
151 | /// This mode returns a block of data. The content and usage are IBV defined. OEMs or\r | |
152 | /// IBVs normally use this mode for nonstandard Compatibility16 runtime 32 bit routines. It\r | |
153 | /// is the responsibility of this routine to coalesce multiple OEM 32 bit functions, if they\r | |
154 | /// exist, into one coherent package that is understandable by the Compatibility16 code.\r | |
155 | ///\r | |
156 | /// Example usage: A legacy mobile BIOS that has a pre existing runtime\r | |
157 | /// interface to return the battery status to calling applications.\r | |
158 | ///\r | |
159 | /// This mode is invoked twice. The first invocation has LegacySegment and\r | |
160 | /// LegacyOffset set to 0. The mode returns the table address in EFI memory and its size.\r | |
161 | ///\r | |
162 | /// The second invocation has LegacySegment and LegacyOffset set to the location\r | |
163 | /// in the 0xF0000 or 0xE0000 block to which the table is to be copied. The second\r | |
164 | /// invocation allows any table address fix ups to occur in the EFI memory copy of the table.\r | |
165 | /// The caller, not EfiGetPlatformBinaryOem32Data, copies the modified table to\r | |
166 | /// the allocated region in 0xF0000 or 0xE0000 block after the second invocation..\r | |
167 | ///\r | |
168 | /// Note: There are two generic mechanisms by which this mode can be used.\r | |
169 | /// Mechanism 1: This mode returns the data and the Legacy BIOS Protocol copies\r | |
170 | /// the data into the F0000 or E0000 block in the Compatibility16 code. The\r | |
171 | /// EFI_COMPATIBILITY16_TABLE entries Oem32Segment and Oem32Offset can\r | |
172 | /// be viewed as two UINT16 entries.\r | |
173 | /// Mechanism 2: This mode directly fills in the EFI_COMPATIBILITY16_TABLE with\r | |
174 | /// a pointer to the INT15 E820 region containing the 32 bit code. It returns\r | |
175 | /// EFI_UNSUPPORTED. The EFI_COMPATIBILITY16_TABLE entries,\r | |
176 | /// Oem32Segment and Oem32Offset, can be viewed as two UINT16 entries or\r | |
177 | /// as a single UINT32 entry as determined by the IBV.\r | |
178 | ///\r | |
179 | /// The function parameters associated with this mode are:\r | |
180 | ///\r | |
181 | /// TableSize Size of data.\r | |
182 | ///\r | |
183 | /// Location Location to place the table. 0x00 or 0xE0000 or 0xF0000 64 KB blocks.\r | |
184 | /// Bit 0 = 1 0xF0000 64 KB block.\r | |
185 | /// Bit 1 = 1 0xE0000 64 KB block.\r | |
186 | /// Multiple bits can be set.\r | |
187 | ///\r | |
188 | /// Alignment Bit mapped address alignment granularity.\r | |
189 | /// The first nonzero bit from the right is the address granularity.\r | |
190 | ///\r | |
191 | /// LegacySegment Segment in which EfiCompatibility code will place the table or data.\r | |
192 | ///\r | |
193 | /// LegacyOffset Offset in which EfiCompatibility code will place the table or data.\r | |
194 | ///\r | |
195 | /// The return values associated with this mode are:\r | |
196 | /// EFI_SUCCESS The data was returned successfully.\r | |
197 | /// EFI_UNSUPPORTED Oem32 is not supported on this platform.\r | |
198 | ///\r | |
199 | EfiGetPlatformBinaryOem32Data = 3,\r | |
b522c77b HW |
200 | ///\r |
201 | /// This mode returns a TPM binary image for the onboard TPM device.\r | |
202 | ///\r | |
203 | /// The function parameters associated with this mode are:\r | |
204 | ///\r | |
205 | /// Table TPM binary image for the onboard TPM device.\r | |
206 | ///\r | |
207 | /// TableSize Size of BinaryImage in bytes.\r | |
208 | ///\r | |
209 | /// Location Location to place the table. 0x00. Either 0xE0000 or 0xF0000 64 KB blocks.\r | |
210 | /// Bit 0 = 1 0xF0000 64 KB block.\r | |
211 | /// Bit 1 = 1 0xE0000 64 KB block.\r | |
212 | /// Multiple bits can be set.\r | |
213 | ///\r | |
214 | /// Alignment Bit mapped address alignment granularity.\r | |
215 | /// The first nonzero bit from the right is the address granularity.\r | |
216 | ///\r | |
217 | /// LegacySegment Segment in which EfiCompatibility code will place the table or data.\r | |
218 | ///\r | |
219 | /// LegacyOffset Offset in which EfiCompatibility code will place the table or data.\r | |
220 | ///\r | |
221 | /// The return values associated with this mode are:\r | |
222 | ///\r | |
223 | /// EFI_SUCCESS BinaryImage is valid.\r | |
224 | ///\r | |
225 | /// EFI_UNSUPPORTED Mode is not supported on this platform.\r | |
226 | ///\r | |
227 | /// EFI_NOT_FOUND No BinaryImage was found.\r | |
228 | ///\r | |
ac0a286f | 229 | EfiGetPlatformBinaryTpmBinary = 4,\r |
b522c77b HW |
230 | ///\r |
231 | /// The mode finds the Compatibility16 Rom Image.\r | |
232 | ///\r | |
233 | /// The function parameters associated with this mode are:\r | |
234 | ///\r | |
235 | /// System ROM image for the platform.\r | |
236 | ///\r | |
237 | /// TableSize Size of Table in bytes.\r | |
238 | ///\r | |
239 | /// Location Ignored.\r | |
240 | ///\r | |
241 | /// Alignment Ignored.\r | |
242 | ///\r | |
243 | /// LegacySegment Ignored.\r | |
244 | ///\r | |
245 | /// LegacyOffset Ignored.\r | |
246 | ///\r | |
247 | /// The return values associated with this mode are:\r | |
248 | ///\r | |
249 | /// EFI_SUCCESS ROM image found.\r | |
250 | ///\r | |
251 | /// EFI_NOT_FOUND ROM not found.\r | |
252 | ///\r | |
ac0a286f | 253 | EfiGetPlatformBinarySystemRom = 5,\r |
b522c77b HW |
254 | ///\r |
255 | /// This mode returns the Base address of PciExpress memory mapped configuration\r | |
256 | /// address space.\r | |
257 | ///\r | |
258 | /// The function parameters associated with this mode are:\r | |
259 | ///\r | |
260 | /// Table System ROM image for the platform.\r | |
261 | ///\r | |
262 | /// TableSize Size of Table in bytes.\r | |
263 | ///\r | |
264 | /// Location Ignored.\r | |
265 | ///\r | |
266 | /// Alignment Ignored.\r | |
267 | ///\r | |
268 | /// LegacySegment Ignored.\r | |
269 | ///\r | |
270 | /// LegacyOffset Ignored.\r | |
271 | ///\r | |
272 | /// The return values associated with this mode are:\r | |
273 | ///\r | |
274 | /// EFI_SUCCESS Address is valid.\r | |
275 | ///\r | |
276 | /// EFI_UNSUPPORTED System does not PciExpress.\r | |
277 | ///\r | |
ac0a286f | 278 | EfiGetPlatformPciExpressBase = 6,\r |
b522c77b | 279 | ///\r |
ac0a286f | 280 | EfiGetPlatformPmmSize = 7,\r |
b522c77b HW |
281 | ///\r |
282 | EfiGetPlatformEndOpromShadowAddr = 8,\r | |
283 | ///\r | |
284 | } EFI_GET_PLATFORM_INFO_MODE;\r | |
285 | \r | |
286 | /**\r | |
287 | This enum specifies the Mode param values for GetPlatformHandle().\r | |
288 | **/\r | |
289 | typedef enum {\r | |
290 | ///\r | |
291 | /// This mode returns the Compatibility16 policy for the device that should be the VGA\r | |
292 | /// controller used during a Compatibility16 boot.\r | |
293 | ///\r | |
294 | /// The function parameters associated with this mode are:\r | |
295 | ///\r | |
296 | /// Type 0x00.\r | |
297 | ///\r | |
298 | /// HandleBuffer Buffer of all VGA handles found.\r | |
299 | ///\r | |
300 | /// HandleCount Number of VGA handles found.\r | |
301 | ///\r | |
302 | /// AdditionalData NULL.\r | |
303 | ///\r | |
ac0a286f | 304 | EfiGetPlatformVgaHandle = 0,\r |
b522c77b HW |
305 | ///\r |
306 | /// This mode returns the Compatibility16 policy for the device that should be the IDE\r | |
307 | /// controller used during a Compatibility16 boot.\r | |
308 | ///\r | |
309 | /// The function parameters associated with this mode are:\r | |
310 | ///\r | |
311 | /// Type 0x00.\r | |
312 | ///\r | |
313 | /// HandleBuffer Buffer of all IDE handles found.\r | |
314 | ///\r | |
315 | /// HandleCount Number of IDE handles found.\r | |
316 | ///\r | |
317 | /// AdditionalData Pointer to HddInfo.\r | |
318 | /// Information about all onboard IDE controllers.\r | |
319 | ///\r | |
ac0a286f | 320 | EfiGetPlatformIdeHandle = 1,\r |
b522c77b HW |
321 | ///\r |
322 | /// This mode returns the Compatibility16 policy for the device that should be the ISA bus\r | |
323 | /// controller used during a Compatibility16 boot.\r | |
324 | ///\r | |
325 | /// The function parameters associated with this mode are:\r | |
326 | ///\r | |
327 | /// Type 0x00.\r | |
328 | ///\r | |
329 | /// HandleBuffer Buffer of all ISA bus handles found.\r | |
330 | ///\r | |
331 | /// HandleCount Number of ISA bus handles found.\r | |
332 | ///\r | |
333 | /// AdditionalData NULL.\r | |
334 | ///\r | |
ac0a286f | 335 | EfiGetPlatformIsaBusHandle = 2,\r |
b522c77b HW |
336 | ///\r |
337 | /// This mode returns the Compatibility16 policy for the device that should be the USB\r | |
338 | /// device used during a Compatibility16 boot.\r | |
339 | ///\r | |
340 | /// The function parameters associated with this mode are:\r | |
341 | ///\r | |
342 | /// Type 0x00.\r | |
343 | ///\r | |
344 | /// HandleBuffer Buffer of all USB handles found.\r | |
345 | ///\r | |
346 | /// HandleCount Number of USB bus handles found.\r | |
347 | ///\r | |
348 | /// AdditionalData NULL.\r | |
349 | ///\r | |
ac0a286f | 350 | EfiGetPlatformUsbHandle = 3\r |
b522c77b HW |
351 | } EFI_GET_PLATFORM_HANDLE_MODE;\r |
352 | \r | |
353 | /**\r | |
354 | This enum specifies the Mode param values for PlatformHooks().\r | |
355 | Note: Any OEM defined hooks start with 0x8000.\r | |
356 | **/\r | |
357 | typedef enum {\r | |
358 | ///\r | |
359 | /// This mode allows any preprocessing before scanning OpROMs.\r | |
360 | ///\r | |
361 | /// The function parameters associated with this mode are:\r | |
362 | ///\r | |
363 | /// Type 0.\r | |
364 | ///\r | |
365 | /// DeviceHandle Handle of device OpROM is associated with.\r | |
366 | ///\r | |
367 | /// ShadowAddress Address where OpROM is shadowed.\r | |
368 | ///\r | |
369 | /// Compatibility16Table NULL.\r | |
370 | ///\r | |
371 | /// AdditionalData NULL.\r | |
372 | ///\r | |
373 | EfiPlatformHookPrepareToScanRom = 0,\r | |
374 | ///\r | |
375 | /// This mode shadows legacy OpROMS that may not have a physical device associated with\r | |
376 | /// them. It returns EFI_SUCCESS if the ROM was shadowed.\r | |
377 | ///\r | |
378 | /// The function parameters associated with this mode are:\r | |
379 | ///\r | |
380 | /// Type 0.\r | |
381 | ///\r | |
382 | /// DeviceHandle 0.\r | |
383 | ///\r | |
384 | /// ShadowAddress First free OpROM area, after other OpROMs have been dispatched..\r | |
385 | ///\r | |
48cf40b8 | 386 | /// Compatibility16Table Pointer to the Compatibility16 Table.\r |
b522c77b HW |
387 | ///\r |
388 | /// AdditionalData NULL.\r | |
389 | ///\r | |
ac0a286f | 390 | EfiPlatformHookShadowServiceRoms = 1,\r |
b522c77b HW |
391 | ///\r |
392 | /// This mode allows platform to perform any required operation after an OpROM has\r | |
393 | /// completed its initialization.\r | |
394 | ///\r | |
395 | /// The function parameters associated with this mode are:\r | |
396 | ///\r | |
397 | /// Type 0.\r | |
398 | ///\r | |
399 | /// DeviceHandle Handle of device OpROM is associated with.\r | |
400 | ///\r | |
401 | /// ShadowAddress Address where OpROM is shadowed.\r | |
402 | ///\r | |
403 | /// Compatibility16Table NULL.\r | |
404 | ///\r | |
405 | /// AdditionalData NULL.\r | |
406 | ///\r | |
ac0a286f | 407 | EfiPlatformHookAfterRomInit = 2\r |
b522c77b HW |
408 | } EFI_GET_PLATFORM_HOOK_MODE;\r |
409 | \r | |
410 | ///\r | |
411 | /// This IRQ has not been assigned to PCI.\r | |
412 | ///\r | |
ac0a286f | 413 | #define PCI_UNUSED 0x00\r |
b522c77b HW |
414 | ///\r |
415 | /// This IRQ has been assigned to PCI.\r | |
416 | ///\r | |
ac0a286f | 417 | #define PCI_USED 0xFF\r |
b522c77b HW |
418 | ///\r |
419 | /// This IRQ has been used by an SIO legacy device and cannot be used by PCI.\r | |
420 | ///\r | |
ac0a286f | 421 | #define LEGACY_USED 0xFE\r |
b522c77b HW |
422 | \r |
423 | #pragma pack(1)\r | |
424 | \r | |
425 | typedef struct {\r | |
426 | ///\r | |
427 | /// IRQ for this entry.\r | |
428 | ///\r | |
ac0a286f | 429 | UINT8 Irq;\r |
b522c77b HW |
430 | ///\r |
431 | /// Status of this IRQ.\r | |
432 | ///\r | |
433 | /// PCI_UNUSED 0x00. This IRQ has not been assigned to PCI.\r | |
434 | ///\r | |
435 | /// PCI_USED 0xFF. This IRQ has been assigned to PCI.\r | |
436 | ///\r | |
437 | /// LEGACY_USED 0xFE. This IRQ has been used by an SIO legacy\r | |
438 | /// device and cannot be used by PCI.\r | |
439 | ///\r | |
ac0a286f | 440 | UINT8 Used;\r |
b522c77b HW |
441 | } EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY;\r |
442 | \r | |
443 | //\r | |
444 | // Define PIR table structures\r | |
445 | //\r | |
ac0a286f | 446 | #define EFI_LEGACY_PIRQ_TABLE_SIGNATURE SIGNATURE_32 ('$', 'P', 'I', 'R')\r |
b522c77b HW |
447 | \r |
448 | typedef struct {\r | |
449 | ///\r | |
450 | /// $PIR.\r | |
451 | ///\r | |
ac0a286f | 452 | UINT32 Signature;\r |
b522c77b HW |
453 | ///\r |
454 | /// 0x00.\r | |
455 | ///\r | |
ac0a286f | 456 | UINT8 MinorVersion;\r |
b522c77b HW |
457 | ///\r |
458 | /// 0x01 for table version 1.0.\r | |
459 | ///\r | |
ac0a286f | 460 | UINT8 MajorVersion;\r |
b522c77b HW |
461 | ///\r |
462 | /// 0x20 + RoutingTableEntries * 0x10.\r | |
463 | ///\r | |
ac0a286f | 464 | UINT16 TableSize;\r |
b522c77b HW |
465 | ///\r |
466 | /// PCI interrupt router bus.\r | |
467 | ///\r | |
ac0a286f | 468 | UINT8 Bus;\r |
b522c77b HW |
469 | ///\r |
470 | /// PCI interrupt router device/function.\r | |
471 | ///\r | |
ac0a286f | 472 | UINT8 DevFun;\r |
b522c77b HW |
473 | ///\r |
474 | /// If nonzero, bit map of IRQs reserved for PCI.\r | |
475 | ///\r | |
ac0a286f | 476 | UINT16 PciOnlyIrq;\r |
b522c77b HW |
477 | ///\r |
478 | /// Vendor ID of a compatible PCI interrupt router.\r | |
479 | ///\r | |
ac0a286f | 480 | UINT16 CompatibleVid;\r |
b522c77b HW |
481 | ///\r |
482 | /// Device ID of a compatible PCI interrupt router.\r | |
483 | ///\r | |
ac0a286f | 484 | UINT16 CompatibleDid;\r |
b522c77b HW |
485 | ///\r |
486 | /// If nonzero, a value passed directly to the IRQ miniport's Initialize function.\r | |
487 | ///\r | |
ac0a286f | 488 | UINT32 Miniport;\r |
b522c77b HW |
489 | ///\r |
490 | /// Reserved for future usage.\r | |
491 | ///\r | |
ac0a286f | 492 | UINT8 Reserved[11];\r |
b522c77b HW |
493 | ///\r |
494 | /// This byte plus the sum of all other bytes in the LocalPirqTable equal 0x00.\r | |
495 | ///\r | |
ac0a286f | 496 | UINT8 Checksum;\r |
b522c77b HW |
497 | } EFI_LEGACY_PIRQ_TABLE_HEADER;\r |
498 | \r | |
b522c77b HW |
499 | typedef struct {\r |
500 | ///\r | |
501 | /// If nonzero, a value assigned by the IBV.\r | |
502 | ///\r | |
ac0a286f | 503 | UINT8 Pirq;\r |
b522c77b HW |
504 | ///\r |
505 | /// If nonzero, the IRQs that can be assigned to this device.\r | |
506 | ///\r | |
ac0a286f | 507 | UINT16 IrqMask;\r |
b522c77b HW |
508 | } EFI_LEGACY_PIRQ_ENTRY;\r |
509 | \r | |
510 | typedef struct {\r | |
511 | ///\r | |
512 | /// PCI bus of the entry.\r | |
513 | ///\r | |
ac0a286f | 514 | UINT8 Bus;\r |
b522c77b HW |
515 | ///\r |
516 | /// PCI device of this entry.\r | |
517 | ///\r | |
ac0a286f | 518 | UINT8 Device;\r |
b522c77b HW |
519 | ///\r |
520 | /// An IBV value and IRQ mask for PIRQ pins A through D.\r | |
521 | ///\r | |
ac0a286f | 522 | EFI_LEGACY_PIRQ_ENTRY PirqEntry[4];\r |
b522c77b HW |
523 | ///\r |
524 | /// If nonzero, the slot number assigned by the board manufacturer.\r | |
525 | ///\r | |
ac0a286f | 526 | UINT8 Slot;\r |
b522c77b HW |
527 | ///\r |
528 | /// Reserved for future use.\r | |
529 | ///\r | |
ac0a286f | 530 | UINT8 Reserved;\r |
b522c77b HW |
531 | } EFI_LEGACY_IRQ_ROUTING_ENTRY;\r |
532 | \r | |
533 | #pragma pack()\r | |
534 | \r | |
b522c77b HW |
535 | /**\r |
536 | Finds the binary data or other platform information.\r | |
537 | \r | |
538 | @param This The protocol instance pointer.\r | |
539 | @param Mode Specifies what data to return. See See EFI_GET_PLATFORM_INFO_MODE enum.\r | |
540 | @param Table Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r | |
541 | @param TableSize Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r | |
542 | @param Location Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r | |
543 | @param Alignment Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r | |
544 | @param LegacySegment Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r | |
545 | @param LegacyOffset Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r | |
546 | \r | |
547 | @retval EFI_SUCCESS Data returned successfully.\r | |
548 | @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r | |
549 | @retval EFI_NOT_FOUND Binary image or table not found.\r | |
550 | \r | |
551 | **/\r | |
552 | typedef\r | |
553 | EFI_STATUS\r | |
554 | (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO)(\r | |
555 | IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r | |
556 | IN EFI_GET_PLATFORM_INFO_MODE Mode,\r | |
557 | OUT VOID **Table,\r | |
558 | OUT UINTN *TableSize,\r | |
559 | OUT UINTN *Location,\r | |
560 | OUT UINTN *Alignment,\r | |
561 | IN UINT16 LegacySegment,\r | |
562 | IN UINT16 LegacyOffset\r | |
563 | );\r | |
564 | \r | |
565 | /**\r | |
566 | Returns a buffer of handles for the requested subfunction.\r | |
567 | \r | |
568 | @param This The protocol instance pointer.\r | |
569 | @param Mode Specifies what handle to return. See EFI_GET_PLATFORM_HANDLE_MODE enum.\r | |
570 | @param Type Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.\r | |
571 | @param HandleBuffer Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.\r | |
572 | @param HandleCount Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.\r | |
573 | @param AdditionalData Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.\r | |
574 | \r | |
575 | @retval EFI_SUCCESS Handle is valid.\r | |
576 | @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r | |
577 | @retval EFI_NOT_FOUND Handle is not known.\r | |
578 | \r | |
579 | **/\r | |
580 | typedef\r | |
581 | EFI_STATUS\r | |
582 | (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE)(\r | |
583 | IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r | |
584 | IN EFI_GET_PLATFORM_HANDLE_MODE Mode,\r | |
585 | IN UINT16 Type,\r | |
586 | OUT EFI_HANDLE **HandleBuffer,\r | |
587 | OUT UINTN *HandleCount,\r | |
588 | IN VOID **AdditionalData OPTIONAL\r | |
589 | );\r | |
590 | \r | |
591 | /**\r | |
592 | Load and initialize the Legacy BIOS SMM handler.\r | |
593 | \r | |
594 | @param This The protocol instance pointer.\r | |
595 | @param EfiToLegacy16BootTable A pointer to Legacy16 boot table.\r | |
596 | \r | |
597 | @retval EFI_SUCCESS SMM code loaded.\r | |
598 | @retval EFI_DEVICE_ERROR SMM code failed to load\r | |
599 | \r | |
600 | **/\r | |
601 | typedef\r | |
602 | EFI_STATUS\r | |
603 | (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_SMM_INIT)(\r | |
604 | IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r | |
605 | IN VOID *EfiToLegacy16BootTable\r | |
606 | );\r | |
607 | \r | |
608 | /**\r | |
609 | Allows platform to perform any required action after a LegacyBios operation.\r | |
610 | Invokes the specific sub function specified by Mode.\r | |
611 | \r | |
612 | @param This The protocol instance pointer.\r | |
613 | @param Mode Specifies what handle to return. See EFI_GET_PLATFORM_HOOK_MODE enum.\r | |
614 | @param Type Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.\r | |
615 | @param DeviceHandle Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.\r | |
616 | @param ShadowAddress Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.\r | |
617 | @param Compatibility16Table Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.\r | |
618 | @param AdditionalData Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.\r | |
619 | \r | |
620 | @retval EFI_SUCCESS The operation performed successfully. Mode specific.\r | |
621 | @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r | |
622 | \r | |
623 | **/\r | |
624 | typedef\r | |
625 | EFI_STATUS\r | |
626 | (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_HOOKS)(\r | |
627 | IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r | |
628 | IN EFI_GET_PLATFORM_HOOK_MODE Mode,\r | |
629 | IN UINT16 Type,\r | |
79d49e16 MK |
630 | IN EFI_HANDLE DeviceHandle OPTIONAL,\r |
631 | IN OUT UINTN *ShadowAddress OPTIONAL,\r | |
632 | IN EFI_COMPATIBILITY16_TABLE *Compatibility16Table OPTIONAL,\r | |
b522c77b HW |
633 | OUT VOID **AdditionalData OPTIONAL\r |
634 | );\r | |
635 | \r | |
636 | /**\r | |
637 | Returns information associated with PCI IRQ routing.\r | |
638 | This function returns the following information associated with PCI IRQ routing:\r | |
639 | * An IRQ routing table and number of entries in the table.\r | |
640 | * The $PIR table and its size.\r | |
641 | * A list of PCI IRQs and the priority order to assign them.\r | |
642 | \r | |
643 | @param This The protocol instance pointer.\r | |
644 | @param RoutingTable The pointer to PCI IRQ Routing table.\r | |
645 | This location is the $PIR table minus the header.\r | |
646 | @param RoutingTableEntries The number of entries in table.\r | |
647 | @param LocalPirqTable $PIR table.\r | |
648 | @param PirqTableSize $PIR table size.\r | |
649 | @param LocalIrqPriorityTable A list of interrupts in priority order to assign.\r | |
650 | @param IrqPriorityTableEntries The number of entries in the priority table.\r | |
651 | \r | |
652 | @retval EFI_SUCCESS Data was successfully returned.\r | |
653 | \r | |
654 | **/\r | |
655 | typedef\r | |
656 | EFI_STATUS\r | |
657 | (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE)(\r | |
658 | IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r | |
659 | OUT VOID **RoutingTable,\r | |
660 | OUT UINTN *RoutingTableEntries,\r | |
79d49e16 MK |
661 | OUT VOID **LocalPirqTable OPTIONAL,\r |
662 | OUT UINTN *PirqTableSize OPTIONAL,\r | |
663 | OUT VOID **LocalIrqPriorityTable OPTIONAL,\r | |
b522c77b HW |
664 | OUT UINTN *IrqPriorityTableEntries OPTIONAL\r |
665 | );\r | |
666 | \r | |
667 | /**\r | |
668 | Translates the given PIRQ accounting for bridge.\r | |
669 | This function translates the given PIRQ back through all buses, if required,\r | |
670 | and returns the true PIRQ and associated IRQ.\r | |
671 | \r | |
672 | @param This The protocol instance pointer.\r | |
673 | @param PciBus The PCI bus number for this device.\r | |
674 | @param PciDevice The PCI device number for this device.\r | |
675 | @param PciFunction The PCI function number for this device.\r | |
676 | @param Pirq Input is PIRQ reported by device, and output is true PIRQ.\r | |
677 | @param PciIrq The IRQ already assigned to the PIRQ, or the IRQ to be\r | |
678 | assigned to the PIRQ.\r | |
679 | \r | |
680 | @retval EFI_SUCCESS The PIRQ was translated.\r | |
681 | \r | |
682 | **/\r | |
683 | typedef\r | |
684 | EFI_STATUS\r | |
685 | (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ)(\r | |
686 | IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r | |
687 | IN UINTN PciBus,\r | |
688 | IN UINTN PciDevice,\r | |
689 | IN UINTN PciFunction,\r | |
690 | IN OUT UINT8 *Pirq,\r | |
691 | OUT UINT8 *PciIrq\r | |
692 | );\r | |
693 | \r | |
694 | /**\r | |
695 | Attempt to legacy boot the BootOption. If the EFI contexted has been\r | |
696 | compromised this function will not return.\r | |
697 | \r | |
698 | @param This The protocol instance pointer.\r | |
699 | @param BbsDevicePath The EFI Device Path from BootXXXX variable.\r | |
700 | @param BbsTable The Internal BBS table.\r | |
701 | @param LoadOptionSize The size of LoadOption in size.\r | |
702 | @param LoadOption The LoadOption from BootXXXX variable\r | |
703 | @param EfiToLegacy16BootTable A pointer to BootTable structure\r | |
704 | \r | |
705 | @retval EFI_SUCCESS Ready to boot.\r | |
706 | \r | |
707 | **/\r | |
708 | typedef\r | |
709 | EFI_STATUS\r | |
710 | (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT)(\r | |
711 | IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r | |
712 | IN BBS_BBS_DEVICE_PATH *BbsDevicePath,\r | |
713 | IN VOID *BbsTable,\r | |
714 | IN UINT32 LoadOptionsSize,\r | |
715 | IN VOID *LoadOptions,\r | |
716 | IN VOID *EfiToLegacy16BootTable\r | |
717 | );\r | |
718 | \r | |
719 | /**\r | |
720 | This protocol abstracts the platform portion of the traditional BIOS.\r | |
721 | **/\r | |
722 | struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL {\r | |
723 | ///\r | |
724 | /// Gets binary data or other platform information.\r | |
725 | ///\r | |
ac0a286f | 726 | EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO GetPlatformInfo;\r |
b522c77b HW |
727 | ///\r |
728 | /// Returns a buffer of all handles matching the requested subfunction.\r | |
729 | ///\r | |
ac0a286f | 730 | EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE GetPlatformHandle;\r |
b522c77b HW |
731 | ///\r |
732 | /// Loads and initializes the traditional BIOS SMM handler.\r | |
ac0a286f | 733 | EFI_LEGACY_BIOS_PLATFORM_SMM_INIT SmmInit;\r |
b522c77b HW |
734 | ///\r |
735 | /// Allows platform to perform any required actions after a LegacyBios operation.\r | |
736 | ///\r | |
ac0a286f | 737 | EFI_LEGACY_BIOS_PLATFORM_HOOKS PlatformHooks;\r |
b522c77b HW |
738 | ///\r |
739 | /// Gets $PIR table.\r | |
ac0a286f | 740 | EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE GetRoutingTable;\r |
b522c77b HW |
741 | ///\r |
742 | /// Translates the given PIRQ to the final value after traversing any PCI bridges.\r | |
743 | ///\r | |
ac0a286f | 744 | EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ TranslatePirq;\r |
b522c77b HW |
745 | ///\r |
746 | /// Final platform function before the system attempts to boot to a traditional OS.\r | |
747 | ///\r | |
ac0a286f | 748 | EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT PrepareToBoot;\r |
b522c77b HW |
749 | };\r |
750 | \r | |
ac0a286f | 751 | extern EFI_GUID gEfiLegacyBiosPlatformProtocolGuid;\r |
b522c77b HW |
752 | \r |
753 | #endif\r |