]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/LegacyBiosPlatform.h
Minor code enhancement.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / LegacyBiosPlatform.h
CommitLineData
79964ac8 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
f0d6194d 7 Copyright (c) 2007 - 2009 Intel Corporation\r
79964ac8 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
79964ac8 16 @par Revision Reference:\r
17 This protocol is defined in Framework for EFI Compatibility Support Module spec\r
0f899407 18 Version 0.97.\r
79964ac8 19\r
20**/\r
21\r
22#ifndef _EFI_LEGACY_BIOS_PLATFORM_H_\r
23#define _EFI_LEGACY_BIOS_PLATFORM_H_\r
24\r
87d63447 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
b80fbe85 30\r
79964ac8 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
04dd6cc0 38/**\r
412fb9ef 39 This enum specifies the Mode param values for GetPlatformInfo()\r
04dd6cc0 40**/\r
79964ac8 41typedef enum {\r
412fb9ef 42 ///\r
43 /// This mode is invoked twice. The first invocation has LegacySegment and\r
5259c97d 44 /// LegacyOffset set to 0. The mode returns the MP table address in EFI memory, along with its size.\r
412fb9ef 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
5259c97d 47 /// invocation allows any MP table address fixes to occur in the EFI memory copy of the\r
412fb9ef 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
5259c97d 62 /// Alignment Bit-mapped address alignment granularity. \r
412fb9ef 63 /// The first nonzero bit from the right is the address granularity.\r
64 ///\r
5259c97d 65 // LegacySegment Segment in which EfiCompatibility code will place the MP table.\r
412fb9ef 66 ///\r
5259c97d 67 /// LegacyOffset Offset in which EfiCompatibility code will place the MP table.\r
412fb9ef 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
79964ac8 75 EfiGetPlatformBinaryMpTable = 0,\r
412fb9ef 76 ///\r
5259c97d 77 /// This mode returns a block of data. The content and usage is IBV or OEM defined.\r
412fb9ef 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
5259c97d 82 /// LegacyOffset set to 0. The function returns the table address in EFI memory, as well as its size.\r
412fb9ef 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
5259c97d 85 /// invocation allows any data (table) address fixes to occur in the EFI memory copy of\r
412fb9ef 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
5259c97d 103 /// LegacySegment Segment in which EfiCompatibility code will place the table or data.\r
412fb9ef 104 ///\r
5259c97d 105 /// LegacyOffset Offset in which EfiCompatibility code will place the table or data.\r
412fb9ef 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
79964ac8 113 EfiGetPlatformBinaryOemIntData = 1,\r
412fb9ef 114 ///\r
5259c97d 115 /// This mode returns a block of data. The content and usage is IBV defined. OEMs or\r
412fb9ef 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
5259c97d 119 /// \r
120 /// Example usage: A legacy mobile BIOS that has a pre-existing runtime\r
412fb9ef 121 /// interface to return the battery status to calling applications.\r
5259c97d 122 ///\r
412fb9ef 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
5259c97d 127 /// invocation allows any table address fixes to occur in the EFI memory copy of the table.\r
412fb9ef 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
5259c97d 145 /// LegacySegment Segment in which EfiCompatibility code will place the table or data.\r
412fb9ef 146 ///\r
5259c97d 147 /// LegacyOffset Offset in which EfiCompatibility code will place the table or data.\r
412fb9ef 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
79964ac8 155 EfiGetPlatformBinaryOem16Data = 2,\r
412fb9ef 156///\r
5259c97d 157/// This mode returns a block of data. The content and usage are IBV defined. OEMs or\r
412fb9ef 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
5259c97d 161/// \r
162/// Example usage: A legacy mobile BIOS that has a pre existing runtime\r
412fb9ef 163/// interface to return the battery status to calling applications.\r
5259c97d 164///\r
412fb9ef 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
f0d6194d 175/// Mechanism 1: This mode returns the data and the Legacy BIOS Protocol copies\r
412fb9ef 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
f0d6194d 179/// Mechanism 2: This mode directly fills in the EFI_COMPATIBILITY16_TABLE with\r
412fb9ef 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
55db3d44 189/// Location Location to place the table. 0x00 or 0xE0000 or 0xF0000 64 KB blocks.\r
412fb9ef 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
5259c97d 197/// LegacySegment Segment in which EfiCompatibility code will place the table or data.\r
412fb9ef 198///\r
5259c97d 199/// LegacyOffset Offset in which EfiCompatibility code will place the table or data.\r
412fb9ef 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
5259c97d 223 /// LegacySegment Segment in which EfiCompatibility code will place the table or data.\r
412fb9ef 224 ///\r
5259c97d 225 /// LegacyOffset Offset in which EfiCompatibility code will place the table or data.\r
412fb9ef 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
79964ac8 235 EfiGetPlatformBinaryTpmBinary = 4,\r
412fb9ef 236 ///\r
55db3d44 237 /// The mode finds the Compatibility16 Rom Image.\r
412fb9ef 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
79964ac8 259 EfiGetPlatformBinarySystemRom = 5,\r
412fb9ef 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
79964ac8 284 EfiGetPlatformPciExpressBase = 6,\r
412fb9ef 285 ///\r
79964ac8 286 EfiGetPlatformPmmSize = 7,\r
412fb9ef 287 ///\r
79964ac8 288 EfiGetPlatformEndOpromShadowAddr = 8,\r
412fb9ef 289 ///\r
79964ac8 290} EFI_GET_PLATFORM_INFO_MODE;\r
291\r
04dd6cc0 292/**\r
412fb9ef 293 This enum specifies the Mode param values for GetPlatformHandle()\r
04dd6cc0 294**/\r
79964ac8 295typedef enum {\r
412fb9ef 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
79964ac8 310 EfiGetPlatformVgaHandle = 0,\r
412fb9ef 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
79964ac8 326 EfiGetPlatformIdeHandle = 1,\r
412fb9ef 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
79964ac8 341 EfiGetPlatformIsaBusHandle = 2,\r
412fb9ef 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
79964ac8 356 EfiGetPlatformUsbHandle = 3\r
357} EFI_GET_PLATFORM_HANDLE_MODE;\r
358\r
04dd6cc0 359/**\r
412fb9ef 360 This enum specifies the Mode param values for PlatformHooks()\r
361 Note: Any OEM defined hooks start with 0x8000\r
04dd6cc0 362**/\r
79964ac8 363typedef enum {\r
412fb9ef 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
79964ac8 379 EfiPlatformHookPrepareToScanRom = 0,\r
412fb9ef 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
79964ac8 396 EfiPlatformHookShadowServiceRoms= 1,\r
412fb9ef 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
79964ac8 413 EfiPlatformHookAfterRomInit = 2\r
414} EFI_GET_PLATFORM_HOOK_MODE;\r
415\r
04dd6cc0 416///\r
417/// This IRQ has not been assigned to PCI.\r
418///\r
9226e4ee 419#define PCI_UNUSED 0x00\r
04dd6cc0 420///\r
421/// This IRQ has been assigned to PCI.\r
422/// \r
9226e4ee 423#define PCI_USED 0xFF\r
04dd6cc0 424///\r
425/// This IRQ has been used by an SIO legacy device and cannot be used by PCI.\r
426///\r
f0d6194d
LG
427#define LEGACY_USED 0xFE\r
428\r
9226e4ee 429#pragma pack(1)\r
430\r
9226e4ee 431typedef struct {\r
412fb9ef 432 ///\r
433 /// IRQ for this entry.\r
434 ///\r
9226e4ee 435 UINT8 Irq;\r
412fb9ef 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
446UINT8 Used;\r
9226e4ee 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
412fb9ef 455 ///\r
456 /// $PIR.\r
457 ///\r
9226e4ee 458 UINT32 Signature;\r
412fb9ef 459 ///\r
460 /// 0x00.\r
461 ///\r
9226e4ee 462 UINT8 MinorVersion;\r
412fb9ef 463 ///\r
464 /// 0x01 for table version 1.0.\r
465 ///\r
9226e4ee 466 UINT8 MajorVersion;\r
412fb9ef 467 ///\r
468 /// 0x20 + RoutingTableEntries * 0x10.\r
469 ///\r
9226e4ee 470 UINT16 TableSize;\r
412fb9ef 471 ///\r
472 /// PCI interrupt router bus.\r
473 ///\r
9226e4ee 474 UINT8 Bus;\r
412fb9ef 475 ///\r
476 /// PCI interrupt router device/function.\r
477 ///\r
9226e4ee 478 UINT8 DevFun;\r
412fb9ef 479 ///\r
480 /// If nonzero, bit map of IRQs reserved for PCI.\r
481 ///\r
9226e4ee 482 UINT16 PciOnlyIrq;\r
412fb9ef 483 ///\r
484 /// Vendor ID of a compatible PCI interrupt router.\r
485 ///\r
9226e4ee 486 UINT16 CompatibleVid;\r
412fb9ef 487 ///\r
488 /// Device ID of a compatible PCI interrupt router.\r
489 ///\r
9226e4ee 490 UINT16 CompatibleDid;\r
412fb9ef 491 ///\r
1910fbaf 492 /// If nonzero, a value passed directly to the IRQ miniport's Initialize function.\r
04dd6cc0 493 ///\r
9226e4ee 494 UINT32 Miniport;\r
412fb9ef 495 ///\r
496 /// Reserved for future usage.\r
497 ///\r
9226e4ee 498 UINT8 Reserved[11];\r
412fb9ef 499 ///\r
500 /// This byte plus the sum of all other bytes in the LocalPirqTable equal 0x00.\r
501 ///\r
9226e4ee 502 UINT8 Checksum;\r
503} EFI_LEGACY_PIRQ_TABLE_HEADER;\r
504\r
505\r
506typedef struct {\r
412fb9ef 507 ///\r
508 /// IRQ for this entry.\r
509 ///\r
9226e4ee 510 UINT8 Pirq;\r
412fb9ef 511 ///\r
512 /// Status of this IRQ.\r
513 ///\r
514 /// PCI_UNUSED 0x00. This IRQ has not been assigned to PCI.\r
515 ///\r
516 /// PCI_USED 0xFF. This IRQ has been assigned to PCI.\r
517 ///\r
518 /// LEGACY_USED 0xFE. This IRQ has been used by an SIO legacy\r
519 /// device and cannot be used by PCI.\r
520 ///\r
521UINT16 IrqMask;\r
9226e4ee 522} EFI_LEGACY_PIRQ_ENTRY;\r
523\r
524typedef struct {\r
412fb9ef 525 ///\r
526 /// PCI bus of the entry.\r
527 ///\r
9226e4ee 528 UINT8 Bus;\r
412fb9ef 529 ///\r
530 /// PCI device of this entry.\r
531 ///\r
9226e4ee 532 UINT8 Device;\r
412fb9ef 533 ///\r
534 /// An IBV value and IRQ mask for PIRQ pins A through D.\r
535 ///\r
9226e4ee 536 EFI_LEGACY_PIRQ_ENTRY PirqEntry[4];\r
412fb9ef 537 ///\r
538 /// If nonzero, the slot number assigned by the board manufacturer.\r
539 ///\r
9226e4ee 540 UINT8 Slot;\r
412fb9ef 541 ///\r
542 /// Reserved for future use.\r
543 ///\r
9226e4ee 544 UINT8 Reserved;\r
545} EFI_LEGACY_IRQ_ROUTING_ENTRY;\r
546\r
547#pragma pack()\r
548\r
549\r
79964ac8 550/**\r
551 Finds the binary data or other platform information.\r
552\r
553 @param This Protocol instance pointer.\r
04dd6cc0 554 @param Mode Specifies what data to return. See See EFI_GET_PLATFORM_INFO_MODE enum.\r
555 @param Table Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r
5259c97d 556 @param TableSize Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r
557 @param Location Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r
04dd6cc0 558 @param Alignment Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r
559 @param LegacySegment Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r
5259c97d 560 @param LegacyOffset Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.\r
79964ac8 561\r
562 @retval EFI_SUCCESS Data was returned successfully.\r
563 @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r
564 @retval EFI_NOT_FOUND Binary image or table not found.\r
565\r
566**/\r
567typedef\r
568EFI_STATUS\r
69686d56 569(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO)(\r
79964ac8 570 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
571 IN EFI_GET_PLATFORM_INFO_MODE Mode,\r
572 OUT VOID **Table,\r
573 OUT UINTN *TableSize,\r
574 OUT UINTN *Location,\r
575 OUT UINTN *Alignment,\r
576 IN UINT16 LegacySegment,\r
577 IN UINT16 LegacyOffset\r
578 );\r
579\r
580/**\r
04dd6cc0 581 Returns a buffer of handles for the requested subfunction.\r
79964ac8 582\r
412fb9ef 583 @param This Protocol instance pointer.\r
04dd6cc0 584 @param Mode Specifies what handle to return. See EFI_GET_PLATFORM_HANDLE_MODE enum.\r
412fb9ef 585 @param Type Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.\r
04dd6cc0 586 @param HandleBuffer Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.\r
587 @param HandleCount Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.\r
588 @param AdditionalData Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.\r
79964ac8 589\r
590 @retval EFI_SUCCESS Handle is valid\r
591 @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r
592 @retval EFI_NOT_FOUND Handle is not known\r
593\r
594**/\r
595typedef\r
596EFI_STATUS\r
69686d56 597(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE)(\r
79964ac8 598 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
599 IN EFI_GET_PLATFORM_HANDLE_MODE Mode,\r
600 IN UINT16 Type,\r
601 OUT EFI_HANDLE **HandleBuffer,\r
602 OUT UINTN *HandleCount,\r
603 IN VOID **AdditionalData OPTIONAL\r
604 );\r
605\r
606/**\r
607 Load and initialize the Legacy BIOS SMM handler.\r
608\r
609 @param This Protocol instance pointer.\r
610 @param EfiToLegacy16BootTable Pointer to Legacy16 boot table.\r
611\r
612 @retval EFI_SUCCESS SMM code loaded.\r
613 @retval EFI_DEVICE_ERROR SMM code failed to load\r
614\r
615**/\r
616typedef\r
617EFI_STATUS\r
69686d56 618(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_SMM_INIT)(\r
79964ac8 619 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
620 IN VOID *EfiToLegacy16BootTable\r
621 );\r
622\r
623/**\r
624 Allows platform to perform any required action after a LegacyBios operation.\r
412fb9ef 625 Invokes the specific sub function specified by Mode.\r
79964ac8 626\r
627 @param This Protocol instance pointer.\r
04dd6cc0 628 @param Mode Specifies what handle to return. See EFI_GET_PLATFORM_HOOK_MODE enum.\r
629 @param Type Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.\r
630 @param DeviceHandle Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.\r
631 @param ShadowAddress Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.\r
632 @param Compatibility16Table Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.\r
633 @param AdditionalData Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.\r
634\r
635 @retval EFI_SUCCESS The operation performed successfully, Mode specific.\r
79964ac8 636 @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r
637\r
638**/\r
639typedef\r
640EFI_STATUS\r
69686d56 641(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_HOOKS)(\r
79964ac8 642 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
643 IN EFI_GET_PLATFORM_HOOK_MODE Mode,\r
644 IN UINT16 Type,\r
04dd6cc0 645 IN EFI_HANDLE DeviceHandle, OPTIONAL\r
646 IN OUT UINTN *ShadowAddress, OPTIONAL\r
647 IN EFI_COMPATIBILITY16_TABLE *Compatibility16Table, OPTIONAL\r
648 OUT VOID **AdditionalData OPTIONAL\r
79964ac8 649 );\r
650\r
651/**\r
652 Returns information associated with PCI IRQ routing.\r
412fb9ef 653 This function returns the following information associated with PCI IRQ routing:\r
5259c97d 654 * An IRQ routing table and number of entries in the table\r
655 * The $PIR table and its size\r
656 * A list of PCI IRQs and the priority order to assign them\r
79964ac8 657\r
658 @param This Protocol instance pointer.\r
04dd6cc0 659 @param RoutingTable Pointer to PCI IRQ Routing table. \r
412fb9ef 660 This location is the $PIR table minus the header.\r
79964ac8 661 @param RoutingTableEntries Number of entries in table.\r
662 @param LocalPirqTable $PIR table\r
663 @param PirqTableSize $PIR table size\r
664 @param LocalIrqPriorityTable List of interrupts in priority order to assign\r
665 @param IrqPriorityTableEntries Number of entries in priority table\r
666\r
667 @retval EFI_SUCCESS Data was successfully returned.\r
668\r
669**/\r
670typedef\r
671EFI_STATUS\r
69686d56 672(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE)(\r
79964ac8 673 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
674 OUT VOID **RoutingTable,\r
675 OUT UINTN *RoutingTableEntries,\r
676 OUT VOID **LocalPirqTable, OPTIONAL\r
677 OUT UINTN *PirqTableSize, OPTIONAL\r
678 OUT VOID **LocalIrqPriorityTable, OPTIONAL\r
679 OUT UINTN *IrqPriorityTableEntries OPTIONAL\r
680 );\r
681\r
682/**\r
683 Translates the given PIRQ accounting for bridge\r
412fb9ef 684 This function translates the given PIRQ back through all buses, if required, \r
685 and returns the true PIRQ and associated IRQ.\r
79964ac8 686\r
687 @param This Protocol instance pointer.\r
688 @param PciBus PCI bus number for this device.\r
689 @param PciDevice PCI device number for this device.\r
690 @param PciFunction PCI function number for this device.\r
691 @param Pirq Input is PIRQ reported by device, output is true PIRQ.\r
692 @param PciIrq The IRQ already assigned to the PIRQ or the IRQ to be\r
693 assigned to the PIRQ.\r
694\r
695 @retval EFI_SUCCESS The PIRQ was translated.\r
696\r
697**/\r
698typedef\r
699EFI_STATUS\r
69686d56 700(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ)(\r
79964ac8 701 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
702 IN UINTN PciBus,\r
703 IN UINTN PciDevice,\r
704 IN UINTN PciFunction,\r
705 IN OUT UINT8 *Pirq,\r
706 OUT UINT8 *PciIrq\r
707 );\r
708\r
709/**\r
710 Attempt to legacy boot the BootOption. If the EFI contexted has been\r
711 compromised this function will not return.\r
712\r
713 @param This Protocol instance pointer.\r
714 @param BbsDevicePath EFI Device Path from BootXXXX variable.\r
715 @param BbsTable Internal BBS table.\r
716 @param LoadOptionSize Size of LoadOption in size.\r
717 @param LoadOption LoadOption from BootXXXX variable\r
718 @param EfiToLegacy16BootTable Pointer to BootTable structure\r
719\r
720 @retval EFI_SUCCESS Ready to boot.\r
721\r
722**/\r
723typedef\r
724EFI_STATUS\r
69686d56 725(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT)(\r
79964ac8 726 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
727 IN BBS_BBS_DEVICE_PATH *BbsDevicePath,\r
728 IN VOID *BbsTable,\r
729 IN UINT32 LoadOptionsSize,\r
730 IN VOID *LoadOptions,\r
731 IN VOID *EfiToLegacy16BootTable\r
732 );\r
733\r
734/**\r
04dd6cc0 735 This protocol abstracts the platform portion of the traditional BIOS.\r
79964ac8 736**/\r
737struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL {\r
412fb9ef 738 ///\r
739 /// Gets binary data or other platform information.\r
740 ///\r
741 EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO GetPlatformInfo;\r
742 ///\r
743 /// Returns a buffer of all handles matching the requested subfunction.\r
744 ///\r
79964ac8 745 EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE GetPlatformHandle;\r
412fb9ef 746 ///\r
747 /// Loads and initializes the traditional BIOS SMM handler.\r
748 EFI_LEGACY_BIOS_PLATFORM_SMM_INIT SmmInit;\r
749 ///\r
750 /// Allows platform to perform any required actions after a LegacyBios operation.\r
751 ///\r
752 EFI_LEGACY_BIOS_PLATFORM_HOOKS PlatformHooks;\r
753 ///\r
754 /// Gets $PIR table.\r
755 EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE GetRoutingTable;\r
756 /// \r
757 /// Translates the given PIRQ to the final value after traversing any PCI bridges.\r
758 ///\r
759 EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ TranslatePirq;\r
760 ///\r
761 /// Final platform function before the system attempts to boot to a traditional OS.\r
762 ///\r
763 EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT PrepareToBoot;\r
79964ac8 764};\r
765\r
766extern EFI_GUID gEfiLegacyBiosPlatformProtocolGuid;\r
767\r
768#endif\r