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