]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - IntelFrameworkPkg/Include/Protocol/LegacyBiosPlatform.h
Remove IntelFrameworkModulePkg
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / LegacyBiosPlatform.h
... / ...
CommitLineData
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
7Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
8SPDX-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
30typedef 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
35typedef 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
69 EfiGetPlatformBinaryMpTable = 0,\r
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
107 EfiGetPlatformBinaryOemIntData = 1,\r
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
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
199EfiGetPlatformBinaryOem32Data = 3,\r
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
229 EfiGetPlatformBinaryTpmBinary = 4,\r
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
253 EfiGetPlatformBinarySystemRom = 5,\r
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
278 EfiGetPlatformPciExpressBase = 6,\r
279 ///\r
280 EfiGetPlatformPmmSize = 7,\r
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
289typedef 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
304 EfiGetPlatformVgaHandle = 0,\r
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
320 EfiGetPlatformIdeHandle = 1,\r
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
335 EfiGetPlatformIsaBusHandle = 2,\r
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
350 EfiGetPlatformUsbHandle = 3\r
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
357typedef 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
386 /// Compatibility16Table Pointer to the Compatability16 Table.\r
387 ///\r
388 /// AdditionalData NULL.\r
389 ///\r
390 EfiPlatformHookShadowServiceRoms= 1,\r
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
407 EfiPlatformHookAfterRomInit = 2\r
408} EFI_GET_PLATFORM_HOOK_MODE;\r
409\r
410///\r
411/// This IRQ has not been assigned to PCI.\r
412///\r
413#define PCI_UNUSED 0x00\r
414///\r
415/// This IRQ has been assigned to PCI.\r
416///\r
417#define PCI_USED 0xFF\r
418///\r
419/// This IRQ has been used by an SIO legacy device and cannot be used by PCI.\r
420///\r
421#define LEGACY_USED 0xFE\r
422\r
423#pragma pack(1)\r
424\r
425typedef struct {\r
426 ///\r
427 /// IRQ for this entry.\r
428 ///\r
429 UINT8 Irq;\r
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
440 UINT8 Used;\r
441} EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY;\r
442\r
443//\r
444// Define PIR table structures\r
445//\r
446#define EFI_LEGACY_PIRQ_TABLE_SIGNATURE SIGNATURE_32 ('$', 'P', 'I', 'R')\r
447\r
448typedef struct {\r
449 ///\r
450 /// $PIR.\r
451 ///\r
452 UINT32 Signature;\r
453 ///\r
454 /// 0x00.\r
455 ///\r
456 UINT8 MinorVersion;\r
457 ///\r
458 /// 0x01 for table version 1.0.\r
459 ///\r
460 UINT8 MajorVersion;\r
461 ///\r
462 /// 0x20 + RoutingTableEntries * 0x10.\r
463 ///\r
464 UINT16 TableSize;\r
465 ///\r
466 /// PCI interrupt router bus.\r
467 ///\r
468 UINT8 Bus;\r
469 ///\r
470 /// PCI interrupt router device/function.\r
471 ///\r
472 UINT8 DevFun;\r
473 ///\r
474 /// If nonzero, bit map of IRQs reserved for PCI.\r
475 ///\r
476 UINT16 PciOnlyIrq;\r
477 ///\r
478 /// Vendor ID of a compatible PCI interrupt router.\r
479 ///\r
480 UINT16 CompatibleVid;\r
481 ///\r
482 /// Device ID of a compatible PCI interrupt router.\r
483 ///\r
484 UINT16 CompatibleDid;\r
485 ///\r
486 /// If nonzero, a value passed directly to the IRQ miniport's Initialize function.\r
487 ///\r
488 UINT32 Miniport;\r
489 ///\r
490 /// Reserved for future usage.\r
491 ///\r
492 UINT8 Reserved[11];\r
493 ///\r
494 /// This byte plus the sum of all other bytes in the LocalPirqTable equal 0x00.\r
495 ///\r
496 UINT8 Checksum;\r
497} EFI_LEGACY_PIRQ_TABLE_HEADER;\r
498\r
499\r
500typedef struct {\r
501 ///\r
502 /// If nonzero, a value assigned by the IBV.\r
503 ///\r
504 UINT8 Pirq;\r
505 ///\r
506 /// If nonzero, the IRQs that can be assigned to this device.\r
507 ///\r
508 UINT16 IrqMask;\r
509} EFI_LEGACY_PIRQ_ENTRY;\r
510\r
511typedef struct {\r
512 ///\r
513 /// PCI bus of the entry.\r
514 ///\r
515 UINT8 Bus;\r
516 ///\r
517 /// PCI device of this entry.\r
518 ///\r
519 UINT8 Device;\r
520 ///\r
521 /// An IBV value and IRQ mask for PIRQ pins A through D.\r
522 ///\r
523 EFI_LEGACY_PIRQ_ENTRY PirqEntry[4];\r
524 ///\r
525 /// If nonzero, the slot number assigned by the board manufacturer.\r
526 ///\r
527 UINT8 Slot;\r
528 ///\r
529 /// Reserved for future use.\r
530 ///\r
531 UINT8 Reserved;\r
532} EFI_LEGACY_IRQ_ROUTING_ENTRY;\r
533\r
534#pragma pack()\r
535\r
536\r
537/**\r
538 Finds the binary data or other platform information.\r
539\r
540 @param This The protocol instance pointer.\r
541 @param Mode Specifies what data to return. See See EFI_GET_PLATFORM_INFO_MODE enum.\r
542 @param Table Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r
543 @param TableSize Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r
544 @param Location Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r
545 @param Alignment Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r
546 @param LegacySegment Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r
547 @param LegacyOffset Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r
548\r
549 @retval EFI_SUCCESS Data returned successfully.\r
550 @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r
551 @retval EFI_NOT_FOUND Binary image or table not found.\r
552\r
553**/\r
554typedef\r
555EFI_STATUS\r
556(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO)(\r
557 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
558 IN EFI_GET_PLATFORM_INFO_MODE Mode,\r
559 OUT VOID **Table,\r
560 OUT UINTN *TableSize,\r
561 OUT UINTN *Location,\r
562 OUT UINTN *Alignment,\r
563 IN UINT16 LegacySegment,\r
564 IN UINT16 LegacyOffset\r
565 );\r
566\r
567/**\r
568 Returns a buffer of handles for the requested subfunction.\r
569\r
570 @param This The protocol instance pointer.\r
571 @param Mode Specifies what handle to return. See EFI_GET_PLATFORM_HANDLE_MODE enum.\r
572 @param Type Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.\r
573 @param HandleBuffer Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.\r
574 @param HandleCount Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.\r
575 @param AdditionalData Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.\r
576\r
577 @retval EFI_SUCCESS Handle is valid.\r
578 @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r
579 @retval EFI_NOT_FOUND Handle is not known.\r
580\r
581**/\r
582typedef\r
583EFI_STATUS\r
584(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE)(\r
585 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
586 IN EFI_GET_PLATFORM_HANDLE_MODE Mode,\r
587 IN UINT16 Type,\r
588 OUT EFI_HANDLE **HandleBuffer,\r
589 OUT UINTN *HandleCount,\r
590 IN VOID **AdditionalData OPTIONAL\r
591 );\r
592\r
593/**\r
594 Load and initialize the Legacy BIOS SMM handler.\r
595\r
596 @param This The protocol instance pointer.\r
597 @param EfiToLegacy16BootTable A pointer to Legacy16 boot table.\r
598\r
599 @retval EFI_SUCCESS SMM code loaded.\r
600 @retval EFI_DEVICE_ERROR SMM code failed to load\r
601\r
602**/\r
603typedef\r
604EFI_STATUS\r
605(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_SMM_INIT)(\r
606 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
607 IN VOID *EfiToLegacy16BootTable\r
608 );\r
609\r
610/**\r
611 Allows platform to perform any required action after a LegacyBios operation.\r
612 Invokes the specific sub function specified by Mode.\r
613\r
614 @param This The protocol instance pointer.\r
615 @param Mode Specifies what handle to return. See EFI_GET_PLATFORM_HOOK_MODE enum.\r
616 @param Type Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.\r
617 @param DeviceHandle Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.\r
618 @param ShadowAddress Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.\r
619 @param Compatibility16Table Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.\r
620 @param AdditionalData Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.\r
621\r
622 @retval EFI_SUCCESS The operation performed successfully. Mode specific.\r
623 @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r
624\r
625**/\r
626typedef\r
627EFI_STATUS\r
628(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_HOOKS)(\r
629 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
630 IN EFI_GET_PLATFORM_HOOK_MODE Mode,\r
631 IN UINT16 Type,\r
632 IN EFI_HANDLE DeviceHandle, OPTIONAL\r
633 IN OUT UINTN *ShadowAddress, OPTIONAL\r
634 IN EFI_COMPATIBILITY16_TABLE *Compatibility16Table, OPTIONAL\r
635 OUT VOID **AdditionalData OPTIONAL\r
636 );\r
637\r
638/**\r
639 Returns information associated with PCI IRQ routing.\r
640 This function returns the following information associated with PCI IRQ routing:\r
641 * An IRQ routing table and number of entries in the table.\r
642 * The $PIR table and its size.\r
643 * A list of PCI IRQs and the priority order to assign them.\r
644\r
645 @param This The protocol instance pointer.\r
646 @param RoutingTable The pointer to PCI IRQ Routing table.\r
647 This location is the $PIR table minus the header.\r
648 @param RoutingTableEntries The number of entries in table.\r
649 @param LocalPirqTable $PIR table.\r
650 @param PirqTableSize $PIR table size.\r
651 @param LocalIrqPriorityTable A list of interrupts in priority order to assign.\r
652 @param IrqPriorityTableEntries The number of entries in the priority table.\r
653\r
654 @retval EFI_SUCCESS Data was successfully returned.\r
655\r
656**/\r
657typedef\r
658EFI_STATUS\r
659(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE)(\r
660 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
661 OUT VOID **RoutingTable,\r
662 OUT UINTN *RoutingTableEntries,\r
663 OUT VOID **LocalPirqTable, OPTIONAL\r
664 OUT UINTN *PirqTableSize, OPTIONAL\r
665 OUT VOID **LocalIrqPriorityTable, OPTIONAL\r
666 OUT UINTN *IrqPriorityTableEntries OPTIONAL\r
667 );\r
668\r
669/**\r
670 Translates the given PIRQ accounting for bridge.\r
671 This function translates the given PIRQ back through all buses, if required,\r
672 and returns the true PIRQ and associated IRQ.\r
673\r
674 @param This The protocol instance pointer.\r
675 @param PciBus The PCI bus number for this device.\r
676 @param PciDevice The PCI device number for this device.\r
677 @param PciFunction The PCI function number for this device.\r
678 @param Pirq Input is PIRQ reported by device, and output is true PIRQ.\r
679 @param PciIrq The IRQ already assigned to the PIRQ, or the IRQ to be\r
680 assigned to the PIRQ.\r
681\r
682 @retval EFI_SUCCESS The PIRQ was translated.\r
683\r
684**/\r
685typedef\r
686EFI_STATUS\r
687(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ)(\r
688 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
689 IN UINTN PciBus,\r
690 IN UINTN PciDevice,\r
691 IN UINTN PciFunction,\r
692 IN OUT UINT8 *Pirq,\r
693 OUT UINT8 *PciIrq\r
694 );\r
695\r
696/**\r
697 Attempt to legacy boot the BootOption. If the EFI contexted has been\r
698 compromised this function will not return.\r
699\r
700 @param This The protocol instance pointer.\r
701 @param BbsDevicePath The EFI Device Path from BootXXXX variable.\r
702 @param BbsTable The Internal BBS table.\r
703 @param LoadOptionSize The size of LoadOption in size.\r
704 @param LoadOption The LoadOption from BootXXXX variable\r
705 @param EfiToLegacy16BootTable A pointer to BootTable structure\r
706\r
707 @retval EFI_SUCCESS Ready to boot.\r
708\r
709**/\r
710typedef\r
711EFI_STATUS\r
712(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT)(\r
713 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
714 IN BBS_BBS_DEVICE_PATH *BbsDevicePath,\r
715 IN VOID *BbsTable,\r
716 IN UINT32 LoadOptionsSize,\r
717 IN VOID *LoadOptions,\r
718 IN VOID *EfiToLegacy16BootTable\r
719 );\r
720\r
721/**\r
722 This protocol abstracts the platform portion of the traditional BIOS.\r
723**/\r
724struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL {\r
725 ///\r
726 /// Gets binary data or other platform information.\r
727 ///\r
728 EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO GetPlatformInfo;\r
729 ///\r
730 /// Returns a buffer of all handles matching the requested subfunction.\r
731 ///\r
732 EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE GetPlatformHandle;\r
733 ///\r
734 /// Loads and initializes the traditional BIOS SMM handler.\r
735 EFI_LEGACY_BIOS_PLATFORM_SMM_INIT SmmInit;\r
736 ///\r
737 /// Allows platform to perform any required actions after a LegacyBios operation.\r
738 ///\r
739 EFI_LEGACY_BIOS_PLATFORM_HOOKS PlatformHooks;\r
740 ///\r
741 /// Gets $PIR table.\r
742 EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE GetRoutingTable;\r
743 ///\r
744 /// Translates the given PIRQ to the final value after traversing any PCI bridges.\r
745 ///\r
746 EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ TranslatePirq;\r
747 ///\r
748 /// Final platform function before the system attempts to boot to a traditional OS.\r
749 ///\r
750 EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT PrepareToBoot;\r
751};\r
752\r
753extern EFI_GUID gEfiLegacyBiosPlatformProtocolGuid;\r
754\r
755#endif\r