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