]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/LegacyBiosPlatform.h
Clean the public header files to remove the unnecessary include files.
[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 - 2009 Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 Module Name: LegacyBiosPlatform.h
17
18 @par Revision Reference:
19 This protocol is defined in Framework for EFI Compatibility Support Module spec
20 Version 0.97.
21
22 **/
23
24 #ifndef _EFI_LEGACY_BIOS_PLATFORM_H_
25 #define _EFI_LEGACY_BIOS_PLATFORM_H_
26
27 #include <Framework/Legacy16.h>
28
29 #define EFI_LEGACY_BIOS_PLATFORM_PROTOCOL_GUID \
30 { \
31 0x783658a3, 0x4172, 0x4421, {0xa2, 0x99, 0xe0, 0x9, 0x7, 0x9c, 0xc, 0xb4 } \
32 }
33
34 typedef struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL EFI_LEGACY_BIOS_PLATFORM_PROTOCOL;
35
36 /**
37 This enum specifies the Mode param values for GetPlatformInfo()
38 **/
39 typedef enum {
40 ///
41 /// This mode is invoked twice. The first invocation has LegacySegment and
42 /// LegacyOffset set to 0. The mode returns the MP table address in EFI memory and its size.
43 /// The second invocation has LegacySegment and LegacyOffset set to the location
44 /// in the 0xF0000 or 0xE0000 block to which the MP table is to be copied. The second
45 /// invocation allows any MP table address fix ups to occur in the EFI memory copy of the
46 /// MP table. The caller, not EfiGetPlatformBinaryMpTable, copies the modified MP
47 /// table to the allocated region in 0xF0000 or 0xE0000 block after the second invocation.
48 ///
49 /// The function parameters associated with this mode are:
50 ///
51 /// Table Pointer to the MP table.
52 ///
53 /// TableSize Size in bytes of the MP table.
54 ///
55 /// Location Location to place table. 0x00. Either 0xE0000 or 0xF0000 64 KB blocks.
56 /// Bit 0 = 1 0xF0000 64 KB block.
57 /// Bit 1 = 1 0xE0000 64 KB block.
58 /// Multiple bits can be set.
59 ///
60 /// Alignment Bit mapped address alignment granularity.
61 /// The first nonzero bit from the right is the address granularity.
62 ///
63 // LegacySegment Segment where EfiCompatibility code will place the MP table.
64 ///
65 /// LegacyOffset Offset where EfiCompatibility code will place the MP table.
66 ///
67 /// The return values associated with this mode are:
68 ///
69 /// EFI_SUCCESS The MP table was returned.
70 ///
71 /// EFI_UNSUPPORTED The MP table is not supported on this platform.
72 ///
73 EfiGetPlatformBinaryMpTable = 0,
74 ///
75 /// This mode returns a block of data. The contents and usage is IBV or OEM defined.
76 /// OEMs or IBVs normally use this function for nonstandard Compatibility16 runtime soft
77 /// INTs. It is the responsibility of this routine to coalesce multiple OEM 16 bit functions, if
78 /// they exist, into one coherent package that is understandable by the Compatibility16 code.
79 /// This function is invoked twice. The first invocation has LegacySegment and
80 /// LegacyOffset set to 0. The function returns the table address in EFI memory and its size.
81 /// The second invocation has LegacySegment and LegacyOffset set to the location
82 /// in the 0xF0000 or 0xE0000 block to which the data (table) is to be copied. The second
83 /// invocation allows any data (table) address fix ups to occur in the EFI memory copy of
84 /// the table. The caller, not GetOemIntData(), copies the modified data (table) to the
85 /// allocated region in 0xF0000 or 0xE0000 block after the second invocation.
86 ///
87 /// The function parameters associated with this mode are:
88 ///
89 /// Table Pointer to OEM legacy 16 bit code or data.
90 ///
91 /// TableSize Size of data.
92 ///
93 /// Location Location to place table. 0x00. Either 0xE0000 or 0xF0000 64 KB blocks.
94 /// Bit 0 = 1 0xF0000 64 KB block.
95 /// Bit 1 = 1 0xE0000 64 KB block.
96 /// Multiple bits can be set.
97 ///
98 /// Alignment Bit mapped address alignment granularity.
99 /// The first nonzero bit from the right is the address granularity.
100 ///
101 /// LegacySegment Segment where EfiCompatibility code will place the table or data.
102 ///
103 /// LegacyOffset Offset where EfiCompatibility code will place the table or data.
104 ///
105 /// The return values associated with this mode are:
106 ///
107 /// EFI_SUCCESS The data was returned successfully.
108 ///
109 /// EFI_UNSUPPORTED Oem INT is not supported on this platform.
110 ///
111 EfiGetPlatformBinaryOemIntData = 1,
112 ///
113 /// This mode returns a block of data. The contents and usage is IBV defined. OEMs or
114 /// IBVs normally use this mode for nonstandard Compatibility16 runtime 16 bit routines. It
115 /// is the responsibility of this routine to coalesce multiple OEM 16 bit functions, if they
116 /// exist, into one coherent package that is understandable by the Compatibility16 code.
117 /// An example usage might be a legacy mobile BIOS that has a pre existing runtime
118 /// interface to return the battery status to calling applications.
119 /// This mode is invoked twice. The first invocation has LegacySegment and
120 /// LegacyOffset set to 0. The mode returns the table address in EFI memory and its size.
121 /// The second invocation has LegacySegment and LegacyOffset set to the location
122 /// in the 0xF0000 or 0xE0000 block to which the table is to be copied. The second
123 /// invocation allows any table address fix ups to occur in the EFI memory copy of the table.
124 /// The caller, not EfiGetPlatformBinaryOem16Data, copies the modified table to
125 /// the allocated region in 0xF0000 or 0xE0000 block after the second invocation.
126 ///
127 /// The function parameters associated with this mode are:
128 ///
129 /// Table Pointer to OEM legacy 16 bit code or data.
130 ///
131 /// TableSize Size of data.
132 ///
133 /// Location Location to place the table. 0x00. Either 0xE0000 or 0xF0000 64 KB blocks.
134 /// Bit 0 = 1 0xF0000 64 KB block.
135 /// Bit 1 = 1 0xE0000 64 KB block.
136 /// Multiple bits can be set.
137 ///
138 /// Alignment Bit mapped address alignment granularity.
139 /// The first nonzero bit from the right is the address granularity.
140 ///
141 /// LegacySegment Segment where EfiCompatibility code will place the table or data.
142 ///
143 /// LegacyOffset Offset where EfiCompatibility code will place the table or data.
144 ///
145 /// The return values associated with this mode are:
146 ///
147 /// EFI_SUCCESS The data was returned successfully.
148 ///
149 /// EFI_UNSUPPORTED Oem16 is not supported on this platform.
150 ///
151 EfiGetPlatformBinaryOem16Data = 2,
152 ///
153 /// This mode returns a block of data. The contents and usage is IBV defined. OEMs or
154 /// IBVs normally use this mode for nonstandard Compatibility16 runtime 32 bit routines. It
155 /// is the responsibility of this routine to coalesce multiple OEM 32 bit functions, if they
156 /// exist, into one coherent package that is understandable by the Compatibility16 code.
157 /// An example usage might be a legacy mobile BIOS that has a pre existing runtime
158 /// interface to return the battery status to calling applications.
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 where EfiCompatibility code will place the table or data.
192 ///
193 /// LegacyOffset Offset where 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 where EfiCompatibility code will place the table or data.
218 ///
219 /// LegacyOffset Offset where 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\92s 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 /// IRQ for this entry.
503 ///
504 UINT8 Pirq;
505 ///
506 /// Status of this IRQ.
507 ///
508 /// PCI_UNUSED 0x00. This IRQ has not been assigned to PCI.
509 ///
510 /// PCI_USED 0xFF. This IRQ has been assigned to PCI.
511 ///
512 /// LEGACY_USED 0xFE. This IRQ has been used by an SIO legacy
513 /// device and cannot be used by PCI.
514 ///
515 UINT16 IrqMask;
516 } EFI_LEGACY_PIRQ_ENTRY;
517
518 typedef struct {
519 ///
520 /// PCI bus of the entry.
521 ///
522 UINT8 Bus;
523 ///
524 /// PCI device of this entry.
525 ///
526 UINT8 Device;
527 ///
528 /// An IBV value and IRQ mask for PIRQ pins A through D.
529 ///
530 EFI_LEGACY_PIRQ_ENTRY PirqEntry[4];
531 ///
532 /// If nonzero, the slot number assigned by the board manufacturer.
533 ///
534 UINT8 Slot;
535 ///
536 /// Reserved for future use.
537 ///
538 UINT8 Reserved;
539 } EFI_LEGACY_IRQ_ROUTING_ENTRY;
540
541 #pragma pack()
542
543
544 /**
545 Finds the binary data or other platform information.
546
547 @param This Protocol instance pointer.
548 @param Mode Specifies what data to return. See See EFI_GET_PLATFORM_INFO_MODE enum.
549 @param Table Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.
550 @param TableSize Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.
551 @param Location Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.
552 @param Alignment Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.
553 @param LegacySegment Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.
554 @param LegacyOffset Mode specific. See EFI_GET_PLATFORM_INFO_MODE enum.
555
556 @retval EFI_SUCCESS Data was returned successfully.
557 @retval EFI_UNSUPPORTED Mode is not supported on the platform.
558 @retval EFI_NOT_FOUND Binary image or table not found.
559
560 **/
561 typedef
562 EFI_STATUS
563 (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO)(
564 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
565 IN EFI_GET_PLATFORM_INFO_MODE Mode,
566 OUT VOID **Table,
567 OUT UINTN *TableSize,
568 OUT UINTN *Location,
569 OUT UINTN *Alignment,
570 IN UINT16 LegacySegment,
571 IN UINT16 LegacyOffset
572 );
573
574 /**
575 Returns a buffer of handles for the requested subfunction.
576
577 @param This Protocol instance pointer.
578 @param Mode Specifies what handle to return. See EFI_GET_PLATFORM_HANDLE_MODE enum.
579 @param Type Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.
580 @param HandleBuffer Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.
581 @param HandleCount Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.
582 @param AdditionalData Mode specific. See EFI_GET_PLATFORM_HANDLE_MODE enum.
583
584 @retval EFI_SUCCESS Handle is valid
585 @retval EFI_UNSUPPORTED Mode is not supported on the platform.
586 @retval EFI_NOT_FOUND Handle is not known
587
588 **/
589 typedef
590 EFI_STATUS
591 (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE)(
592 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
593 IN EFI_GET_PLATFORM_HANDLE_MODE Mode,
594 IN UINT16 Type,
595 OUT EFI_HANDLE **HandleBuffer,
596 OUT UINTN *HandleCount,
597 IN VOID **AdditionalData OPTIONAL
598 );
599
600 /**
601 Load and initialize the Legacy BIOS SMM handler.
602
603 @param This Protocol instance pointer.
604 @param EfiToLegacy16BootTable Pointer to Legacy16 boot table.
605
606 @retval EFI_SUCCESS SMM code loaded.
607 @retval EFI_DEVICE_ERROR SMM code failed to load
608
609 **/
610 typedef
611 EFI_STATUS
612 (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_SMM_INIT)(
613 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
614 IN VOID *EfiToLegacy16BootTable
615 );
616
617 /**
618 Allows platform to perform any required action after a LegacyBios operation.
619 Invokes the specific sub function specified by Mode.
620
621 @param This Protocol instance pointer.
622 @param Mode Specifies what handle to return. See EFI_GET_PLATFORM_HOOK_MODE enum.
623 @param Type Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.
624 @param DeviceHandle Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.
625 @param ShadowAddress Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.
626 @param Compatibility16Table Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.
627 @param AdditionalData Mode specific. See EFI_GET_PLATFORM_HOOK_MODE enum.
628
629 @retval EFI_SUCCESS The operation performed successfully, Mode specific.
630 @retval EFI_UNSUPPORTED Mode is not supported on the platform.
631
632 **/
633 typedef
634 EFI_STATUS
635 (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_HOOKS)(
636 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
637 IN EFI_GET_PLATFORM_HOOK_MODE Mode,
638 IN UINT16 Type,
639 IN EFI_HANDLE DeviceHandle, OPTIONAL
640 IN OUT UINTN *ShadowAddress, OPTIONAL
641 IN EFI_COMPATIBILITY16_TABLE *Compatibility16Table, OPTIONAL
642 OUT VOID **AdditionalData OPTIONAL
643 );
644
645 /**
646 Returns information associated with PCI IRQ routing.
647 This function returns the following information associated with PCI IRQ routing:
648 An IRQ routing table and number of entries in the table
649 The $PIR table and its size
650 A list of PCI IRQs and the priority order to assign them
651
652 @param This Protocol instance pointer.
653 @param RoutingTable Pointer to PCI IRQ Routing table.
654 This location is the $PIR table minus the header.
655 @param RoutingTableEntries Number of entries in table.
656 @param LocalPirqTable $PIR table
657 @param PirqTableSize $PIR table size
658 @param LocalIrqPriorityTable List of interrupts in priority order to assign
659 @param IrqPriorityTableEntries Number of entries in priority table
660
661 @retval EFI_SUCCESS Data was successfully returned.
662
663 **/
664 typedef
665 EFI_STATUS
666 (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE)(
667 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
668 OUT VOID **RoutingTable,
669 OUT UINTN *RoutingTableEntries,
670 OUT VOID **LocalPirqTable, OPTIONAL
671 OUT UINTN *PirqTableSize, OPTIONAL
672 OUT VOID **LocalIrqPriorityTable, OPTIONAL
673 OUT UINTN *IrqPriorityTableEntries OPTIONAL
674 );
675
676 /**
677 Translates the given PIRQ accounting for bridge
678 This function translates the given PIRQ back through all buses, if required,
679 and returns the true PIRQ and associated IRQ.
680
681 @param This Protocol instance pointer.
682 @param PciBus PCI bus number for this device.
683 @param PciDevice PCI device number for this device.
684 @param PciFunction PCI function number for this device.
685 @param Pirq Input is PIRQ reported by device, output is true PIRQ.
686 @param PciIrq The IRQ already assigned to the PIRQ or the IRQ to be
687 assigned to the PIRQ.
688
689 @retval EFI_SUCCESS The PIRQ was translated.
690
691 **/
692 typedef
693 EFI_STATUS
694 (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ)(
695 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
696 IN UINTN PciBus,
697 IN UINTN PciDevice,
698 IN UINTN PciFunction,
699 IN OUT UINT8 *Pirq,
700 OUT UINT8 *PciIrq
701 );
702
703 /**
704 Attempt to legacy boot the BootOption. If the EFI contexted has been
705 compromised this function will not return.
706
707 @param This Protocol instance pointer.
708 @param BbsDevicePath EFI Device Path from BootXXXX variable.
709 @param BbsTable Internal BBS table.
710 @param LoadOptionSize Size of LoadOption in size.
711 @param LoadOption LoadOption from BootXXXX variable
712 @param EfiToLegacy16BootTable Pointer to BootTable structure
713
714 @retval EFI_SUCCESS Ready to boot.
715
716 **/
717 typedef
718 EFI_STATUS
719 (EFIAPI *EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT)(
720 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
721 IN BBS_BBS_DEVICE_PATH *BbsDevicePath,
722 IN VOID *BbsTable,
723 IN UINT32 LoadOptionsSize,
724 IN VOID *LoadOptions,
725 IN VOID *EfiToLegacy16BootTable
726 );
727
728 /**
729 This protocol abstracts the platform portion of the traditional BIOS.
730 **/
731 struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL {
732 ///
733 /// Gets binary data or other platform information.
734 ///
735 EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO GetPlatformInfo;
736 ///
737 /// Returns a buffer of all handles matching the requested subfunction.
738 ///
739 EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE GetPlatformHandle;
740 ///
741 /// Loads and initializes the traditional BIOS SMM handler.
742 EFI_LEGACY_BIOS_PLATFORM_SMM_INIT SmmInit;
743 ///
744 /// Allows platform to perform any required actions after a LegacyBios operation.
745 ///
746 EFI_LEGACY_BIOS_PLATFORM_HOOKS PlatformHooks;
747 ///
748 /// Gets $PIR table.
749 EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE GetRoutingTable;
750 ///
751 /// Translates the given PIRQ to the final value after traversing any PCI bridges.
752 ///
753 EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ TranslatePirq;
754 ///
755 /// Final platform function before the system attempts to boot to a traditional OS.
756 ///
757 EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT PrepareToBoot;
758 };
759
760 extern EFI_GUID gEfiLegacyBiosPlatformProtocolGuid;
761
762 #endif