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