3 Copyright (c) 1999 - 2006, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 The EFI Legacy BIOS Patform Protocol is used to mate a Legacy16
20 implementation with this EFI code. The EFI driver that produces
21 the Legacy BIOS protocol is generic and consumes this protocol.
22 A driver that matches the Legacy16 produces this protocol
26 The EFI Legacy BIOS Platform Protocol is compliant with CSM spec 0.96.
30 #ifndef _EFI_LEGACY_BIOS_PLATFORM_H
31 #define _EFI_LEGACY_BIOS_PLATFORM_H
33 #define EFI_LEGACY_BIOS_PLATFORM_PROTOCOL_GUID \
35 0x783658a3, 0x4172, 0x4421, {0xa2, 0x99, 0xe0, 0x9, 0x7, 0x9c, 0xc, 0xb4} \
38 EFI_FORWARD_DECLARATION (EFI_LEGACY_BIOS_PLATFORM_PROTOCOL
);
41 #include EFI_PROTOCOL_DEFINITION (LegacyBios)
45 // Define structures for GetOemIntData
47 // OemIntDataElenent is an array of structures from 0 to Count-1.
48 // RawData is an array of bytes from 0 to RamDataLength-1.
55 } EFI_OEM_INT_DATA_ELEMENT
;
59 EFI_OEM_INT_DATA_ELEMENT OemIntDataElement
[1];
64 EfiGetPlatformBinaryMpTable
= 0,
65 EfiGetPlatformBinaryOemIntData
= 1,
66 EfiGetPlatformBinaryOem16Data
= 2,
67 EfiGetPlatformBinaryOem32Data
= 3,
68 EfiGetPlatformBinaryTpmBinary
= 4,
69 EfiGetPlatformBinarySystemRom
= 5,
70 EfiGetPlatformPciExpressBase
= 6,
71 EfiGetPlatformPmmSize
= 7,
72 EfiGetPlatformEndOfOpromShadowAddr
= 8
73 } EFI_GET_PLATFORM_INFO_MODE
;
76 EfiGetPlatformVgaHandle
= 0,
77 EfiGetPlatformIdeHandle
= 1,
78 EfiGetPlatformIsaBusHandle
= 2,
79 EfiGetPlatformUsbHandle
= 3
80 } EFI_GET_PLATFORM_HANDLE_MODE
;
83 EfiPlatformHookPrepareToScanRom
= 0,
84 EfiPlatformHookShadowServiceRoms
= 1,
85 EfiPlatformHookAfterRomInit
= 2
86 } EFI_GET_PLATFORM_HOOK_MODE
;
90 (EFIAPI
*EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO
) (
91 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL
* This
,
92 IN EFI_GET_PLATFORM_INFO_MODE Mode
,
97 IN UINT16 LegacySegment
,
98 IN UINT16 LegacyOffset
103 Return a System ROM image for the platform
106 This - Protocol instance pointer.
107 Mode - Specifies what data to return
108 Table - Pointer to MP table.
109 TableSize - Size in bytes of table.
110 Location - Legacy region requested
112 Bit 0 = 0xF0000 region
113 Bit 1 = 0xE0000 region
114 Multiple bits can be set
115 Alignment - Address alignment for allocation.
116 Bit mapped. First non-zero bit from right
119 LegacySegment - Segment in LegacyBios where Table is stored
120 LegacyOffset - Offset in LegacyBios where Table is stored
123 EFI_SUCCESS - Data was returned successfully.
124 EFI_UNSUPPORTED - Mode is not supported on the platform.
125 EFI_NOT_FOUND - Binary image or table not found.
132 (EFIAPI
*EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE
) (
133 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL
* This
,
134 IN EFI_GET_PLATFORM_HANDLE_MODE Mode
,
136 OUT EFI_HANDLE
**HandleBuffer
,
137 OUT UINTN
*HandleCount
,
138 IN VOID
**AdditionalData OPTIONAL
143 Return the Legacy16 policy for which device should be the VGA controller
144 used during a Legacy16 boot.
147 This - Protocol instance pointer.
148 Mode - Specifies what handle to return.
149 Type - Type from Device Path for Handle to represent.
150 HandleBuffer - Handles of the device/controller in priority order
151 with HandleBuffer[0] highest priority.
152 HandleCount - Number of handles in the buffer.
153 AdditionalData - Mode specific.
157 EFI_SUCCESS - Handle is valid
158 EFI_UNSUPPORTED - Mode is not supported on the platform.
159 EFI_NOT_FOUND - Handle is not known
166 (EFIAPI
*EFI_LEGACY_BIOS_PLATFORM_SMM_INIT
) (
167 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL
* This
,
168 IN VOID
*EfiToLegacy16BootTable
174 Load and initialize the Legacy BIOS SMM handler.
177 This - Protocol instance pointer.
178 EfiToLegacy16BootTable - Pointer to Legacy16 boot table.
180 EFI_SUCCESS - SMM code loaded.
181 EFI_DEVICE_ERROR - SMM code failed to load
188 (EFIAPI
*EFI_LEGACY_BIOS_PLATFORM_HOOKS
) (
189 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL
* This
,
190 IN EFI_GET_PLATFORM_HOOK_MODE Mode
,
192 IN EFI_HANDLE DeviceHandle
,
193 IN OUT UINTN
*ShadowAddress
,
194 IN EFI_COMPATIBILITY16_TABLE
* Compatibility16Table
,
195 IN VOID
**AdditionalData OPTIONAL
200 Prepare to scan a ROM.
203 This - Protocol instance pointer.
204 Handle - Device handle
205 ShadowAddress - Address that ROM is shadowed at prior to
206 initialization or first free ROM address,
208 Compatibility16Table - Pointer to Compatibility16Table.
209 AdditionalData - Mode specific.
213 EFI_SUCCESS - RomImage is valid
214 EFI_UNSUPPORTED - Mode is not supported on the platform or platform
215 policy is to not install this OPROM.
221 (EFIAPI
*EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE
) (
222 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL
* This
,
223 OUT VOID
**RoutingTable
,
224 OUT UINTN
*RoutingTableEntries
,
225 OUT VOID
**LocalPirqTable
, OPTIONAL
226 OUT UINTN
*PirqTableSize
, OPTIONAL
227 OUT VOID
**LocalIrqPriorityTable
, OPTIONAL
228 OUT UINTN
*IrqPriorityTableEntries OPTIONAL
233 1. List of IRQ routing entries and number of entries.
234 2. Pointer to Entire $PIR table and length.
235 3. List of IRQs to assign to PCI in priority.
238 This - Protocol instance pointer.
239 RoutingTable - Pointer to PCI IRQ Routing table.
240 RoutingTableEntries - Number of entries in table.
241 LocalPirqTable - $PIR table
242 PirqTableSize - $PIR table size
243 LocalIrqPriorityTable - List of interrupts in priority order to assign
244 IrqPriorityTableEntries- Number of entries in priority table
247 EFI_SUCCESS - Table pointer returned
254 (EFIAPI
*EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ
) (
255 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL
* This
,
258 IN UINTN PciFunction
,
265 Translate the PIRQ reported by the PCI device into the true PIRQ
266 from the internal IRQ routing information and IRQ assigned or to be
270 This - Protocol instance pointer.
271 Base as defined below is the bus,device, function in
273 PciBus - Base Bus for this device.
274 PciDevice - Base Device for this device.
275 PciFunction - Base Function for this device.
276 Pirq - Input is PIRQ reported by device, output is true PIRQ.
277 PciIrq - The IRQ already assigned to the PIRQ or the IRQ to be
278 assigned to the PIRQ.
281 EFI_SUCCESS - Irq translated
288 (EFIAPI
*EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT
) (
289 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL
* This
,
290 IN BBS_BBS_DEVICE_PATH
* BbsDevicePath
,
292 IN UINT32 LoadOptionsSize
,
293 IN VOID
*LoadOptions
,
294 IN VOID
*EfiToLegacy16BootTable
299 Attempt to legacy boot the BootOption. If the EFI contexted has been
300 compromised this function will not return.
303 This - Protocol instance pointer.
304 BbsDevicePath - EFI Device Path from BootXXXX variable.
305 BbsTable - Internal BBS table.
306 LoadOptionSize - Size of LoadOption in size.
307 LoadOption - LoadOption from BootXXXX variable
308 EfiToLegacy16BootTable - Pointer to BootTable structure
311 EFI_SUCCESS - Removable media not present
316 struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL
{
317 EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO GetPlatformInfo
;
318 EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE GetPlatformHandle
;
319 EFI_LEGACY_BIOS_PLATFORM_SMM_INIT SmmInit
;
320 EFI_LEGACY_BIOS_PLATFORM_HOOKS PlatformHooks
;
321 EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE GetRoutingTable
;
322 EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ TranslatePirq
;
323 EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT PrepareToBoot
;
326 extern EFI_GUID gEfiLegacyBiosPlatformProtocolGuid
;