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