]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/LegacyBiosPlatform.h
Update revision reference tag.
[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
7 Copyright (c) 2007, Intel Corporation\r
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
16 Module Name: LegacyBiosPlatform.h\r
17\r
18 @par Revision Reference:\r
19 This protocol is defined in Framework for EFI Compatibility Support Module spec\r
0f899407 20 Version 0.97.\r
79964ac8 21\r
22**/\r
23\r
24#ifndef _EFI_LEGACY_BIOS_PLATFORM_H_\r
25#define _EFI_LEGACY_BIOS_PLATFORM_H_\r
26\r
b80fbe85 27#include <FrameworkDxe.h>\r
28\r
79964ac8 29#define EFI_LEGACY_BIOS_PLATFORM_PROTOCOL_GUID \\r
30 { \\r
31 0x783658a3, 0x4172, 0x4421, {0xa2, 0x99, 0xe0, 0x9, 0x7, 0x9c, 0xc, 0xb4 } \\r
32 }\r
33\r
34typedef struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL EFI_LEGACY_BIOS_PLATFORM_PROTOCOL;\r
35\r
36typedef enum {\r
37 EfiGetPlatformBinaryMpTable = 0,\r
38 EfiGetPlatformBinaryOemIntData = 1,\r
39 EfiGetPlatformBinaryOem16Data = 2,\r
40 EfiGetPlatformBinaryOem32Data = 3,\r
41 EfiGetPlatformBinaryTpmBinary = 4,\r
42 EfiGetPlatformBinarySystemRom = 5,\r
43 EfiGetPlatformPciExpressBase = 6,\r
44 EfiGetPlatformPmmSize = 7,\r
45 EfiGetPlatformEndOpromShadowAddr = 8,\r
46\r
47} EFI_GET_PLATFORM_INFO_MODE;\r
48\r
49typedef enum {\r
50 EfiGetPlatformVgaHandle = 0,\r
51 EfiGetPlatformIdeHandle = 1,\r
52 EfiGetPlatformIsaBusHandle = 2,\r
53 EfiGetPlatformUsbHandle = 3\r
54} EFI_GET_PLATFORM_HANDLE_MODE;\r
55\r
56typedef enum {\r
57 EfiPlatformHookPrepareToScanRom = 0,\r
58 EfiPlatformHookShadowServiceRoms= 1,\r
59 EfiPlatformHookAfterRomInit = 2\r
60} EFI_GET_PLATFORM_HOOK_MODE;\r
61\r
62/**\r
63 Finds the binary data or other platform information.\r
64\r
65 @param This Protocol instance pointer.\r
66 @param Mode Specifies what data to return\r
67 @param Table Pointer to MP table.\r
68 @param TableSize Size in bytes of table.\r
69 @param Location Legacy region requested\r
70 0x00 = Any location\r
71 Bit 0 = 0xF0000 region\r
72 Bit 1 = 0xE0000 region\r
73 Multiple bits can be set\r
74 @param Alignment Address alignment for allocation.\r
75 Bit mapped. First non-zero bit from right\r
76 is alignment.\r
77 @param LegacySegment Segment in LegacyBios where Table is stored\r
78 @param LegacyOffset Offset in LegacyBios where Table is stored\r
79\r
80 @retval EFI_SUCCESS Data was returned successfully.\r
81 @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r
82 @retval EFI_NOT_FOUND Binary image or table not found.\r
83\r
84**/\r
85typedef\r
86EFI_STATUS\r
69686d56 87(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO)(\r
79964ac8 88 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
89 IN EFI_GET_PLATFORM_INFO_MODE Mode,\r
90 OUT VOID **Table,\r
91 OUT UINTN *TableSize,\r
92 OUT UINTN *Location,\r
93 OUT UINTN *Alignment,\r
94 IN UINT16 LegacySegment,\r
95 IN UINT16 LegacyOffset\r
96 );\r
97\r
98/**\r
99 Returns a buffer of handles for the requested sub-function.\r
100\r
101 @param This Protocol instance pointer.\r
102 @param Mode Specifies what handle to return.\r
103 @param Type Type from Device Path for Handle to represent.\r
104 @param HandleBuffer Handles of the device/controller in priority order\r
105 with HandleBuffer[0] highest priority.\r
106 @param HandleCount Number of handles in the buffer.\r
107 @param AdditionalData Mode specific.\r
108\r
109 @retval EFI_SUCCESS Handle is valid\r
110 @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r
111 @retval EFI_NOT_FOUND Handle is not known\r
112\r
113**/\r
114typedef\r
115EFI_STATUS\r
69686d56 116(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE)(\r
79964ac8 117 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
118 IN EFI_GET_PLATFORM_HANDLE_MODE Mode,\r
119 IN UINT16 Type,\r
120 OUT EFI_HANDLE **HandleBuffer,\r
121 OUT UINTN *HandleCount,\r
122 IN VOID **AdditionalData OPTIONAL\r
123 );\r
124\r
125/**\r
126 Load and initialize the Legacy BIOS SMM handler.\r
127\r
128 @param This Protocol instance pointer.\r
129 @param EfiToLegacy16BootTable Pointer to Legacy16 boot table.\r
130\r
131 @retval EFI_SUCCESS SMM code loaded.\r
132 @retval EFI_DEVICE_ERROR SMM code failed to load\r
133\r
134**/\r
135typedef\r
136EFI_STATUS\r
69686d56 137(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_SMM_INIT)(\r
79964ac8 138 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
139 IN VOID *EfiToLegacy16BootTable\r
140 );\r
141\r
142/**\r
143 Allows platform to perform any required action after a LegacyBios operation.\r
144\r
145 @param This Protocol instance pointer.\r
146 @param Mode Specifies what handle to return.\r
147 @param Type Mode specific.\r
148 @param DeviceHandle List of PCI devices in the system.\r
149 @param ShadowAddress First free OpROM area, after other OpROMs have been dispatched.\r
150 @param Compatibility16Table Pointer to Compatibility16Table.\r
151 @param AdditionalData Mode specific Pointer to additional data returned - mode specific.\r
152\r
153 @retval EFI_SUCCESS RomImage is valid\r
154 @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r
155\r
156**/\r
157typedef\r
158EFI_STATUS\r
69686d56 159(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_HOOKS)(\r
79964ac8 160 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
161 IN EFI_GET_PLATFORM_HOOK_MODE Mode,\r
162 IN UINT16 Type,\r
163 IN EFI_HANDLE DeviceHandle,\r
164 IN OUT UINTN *ShadowAddress,\r
165 IN EFI_COMPATIBILITY16_TABLE *Compatibility16Table,\r
166 IN VOID **AdditionalData OPTIONAL\r
167 );\r
168\r
169/**\r
170 Returns information associated with PCI IRQ routing.\r
171\r
172 @param This Protocol instance pointer.\r
173 @param RoutingTable Pointer to PCI IRQ Routing table.\r
174 @param RoutingTableEntries Number of entries in table.\r
175 @param LocalPirqTable $PIR table\r
176 @param PirqTableSize $PIR table size\r
177 @param LocalIrqPriorityTable List of interrupts in priority order to assign\r
178 @param IrqPriorityTableEntries Number of entries in priority table\r
179\r
180 @retval EFI_SUCCESS Data was successfully returned.\r
181\r
182**/\r
183typedef\r
184EFI_STATUS\r
69686d56 185(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE)(\r
79964ac8 186 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
187 OUT VOID **RoutingTable,\r
188 OUT UINTN *RoutingTableEntries,\r
189 OUT VOID **LocalPirqTable, OPTIONAL\r
190 OUT UINTN *PirqTableSize, OPTIONAL\r
191 OUT VOID **LocalIrqPriorityTable, OPTIONAL\r
192 OUT UINTN *IrqPriorityTableEntries OPTIONAL\r
193 );\r
194\r
195/**\r
196 Translates the given PIRQ accounting for bridge\r
197\r
198 @param This Protocol instance pointer.\r
199 @param PciBus PCI bus number for this device.\r
200 @param PciDevice PCI device number for this device.\r
201 @param PciFunction PCI function number for this device.\r
202 @param Pirq Input is PIRQ reported by device, output is true PIRQ.\r
203 @param PciIrq The IRQ already assigned to the PIRQ or the IRQ to be\r
204 assigned to the PIRQ.\r
205\r
206 @retval EFI_SUCCESS The PIRQ was translated.\r
207\r
208**/\r
209typedef\r
210EFI_STATUS\r
69686d56 211(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ)(\r
79964ac8 212 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
213 IN UINTN PciBus,\r
214 IN UINTN PciDevice,\r
215 IN UINTN PciFunction,\r
216 IN OUT UINT8 *Pirq,\r
217 OUT UINT8 *PciIrq\r
218 );\r
219\r
220/**\r
221 Attempt to legacy boot the BootOption. If the EFI contexted has been\r
222 compromised this function will not return.\r
223\r
224 @param This Protocol instance pointer.\r
225 @param BbsDevicePath EFI Device Path from BootXXXX variable.\r
226 @param BbsTable Internal BBS table.\r
227 @param LoadOptionSize Size of LoadOption in size.\r
228 @param LoadOption LoadOption from BootXXXX variable\r
229 @param EfiToLegacy16BootTable Pointer to BootTable structure\r
230\r
231 @retval EFI_SUCCESS Ready to boot.\r
232\r
233**/\r
234typedef\r
235EFI_STATUS\r
69686d56 236(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT)(\r
79964ac8 237 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
238 IN BBS_BBS_DEVICE_PATH *BbsDevicePath,\r
239 IN VOID *BbsTable,\r
240 IN UINT32 LoadOptionsSize,\r
241 IN VOID *LoadOptions,\r
242 IN VOID *EfiToLegacy16BootTable\r
243 );\r
244\r
245/**\r
246 @par Protocol Description:\r
247 Abstracts the platform portion of the traditional BIOS.\r
248\r
249 @param GetPlatformInfo\r
250 Gets binary data or other platform information.\r
251\r
252 @param GetPlatformHandle\r
253 Returns a buffer of all handles matching the requested subfunction.\r
254\r
255 @param SmmInit\r
256 Loads and initializes the traditional BIOS SMM handler.\r
257\r
258 @param PlatformHooks\r
259 Allows platform to perform any required actions after a LegacyBios operation.\r
260\r
261 @param GetRoutingTable\r
262 Gets $PIR table.\r
263\r
264 @param TranslatePirq\r
265 Translates the given PIRQ to the final value after traversing any PCI bridges.\r
266\r
267 @param PrepareToBoot\r
268 Final platform function before the system attempts to boot to a traditional OS.\r
269\r
270**/\r
271struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL {\r
272 EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO GetPlatformInfo;\r
273 EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE GetPlatformHandle;\r
274 EFI_LEGACY_BIOS_PLATFORM_SMM_INIT SmmInit;\r
275 EFI_LEGACY_BIOS_PLATFORM_HOOKS PlatformHooks;\r
276 EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE GetRoutingTable;\r
277 EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ TranslatePirq;\r
278 EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT PrepareToBoot;\r
279};\r
280\r
281extern EFI_GUID gEfiLegacyBiosPlatformProtocolGuid;\r
282\r
283#endif\r