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