]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/LegacyBiosPlatform.h
Committing changes to the comments, after review with engineers.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / LegacyBiosPlatform.h
Content-type: text/html ]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/LegacyBiosPlatform.h


500 - Internal Server Error

Malformed UTF-8 character (fatal) at (eval 6) line 1, <$fd> line 1093.
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
f0d6194d 7 Copyright (c) 2007 - 2009 Intel Corporation\r
79964ac8 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
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
36typedef 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 41typedef 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
5259c97d 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
100 /// Alignment Bit mapped address alignment granularity. \r
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
5259c97d 119 /// \r
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
142 /// Alignment Bit mapped address alignment granularity. \r
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
5259c97d 161/// \r
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
167/// \r
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
194/// Alignment Bit mapped address alignment granularity. \r
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
205EfiGetPlatformBinaryOem32Data = 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
220 /// Alignment Bit mapped address alignment granularity. \r
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
241 /// System ROM image for the platform\r
242 /// \r
243 /// TableSize Size of Table in bytes\r
244 /// \r
245 /// Location Ignored\r
246 /// \r
247 /// Alignment Ignored\r
248 /// \r
249 /// LegacySegment Ignored\r
250 /// \r
251 /// LegacyOffset Ignored\r
252 ///\r
253 /// The return values associated with this mode are:\r
254 ///\r
255 /// EFI_SUCCESS ROM image found.\r
256 /// \r
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
266 /// Table System ROM image for the platform\r
267 /// \r
268 /// TableSize Size of Table in bytes\r
269 /// \r
270 /// Location Ignored\r
271 /// \r
272 /// Alignment Ignored\r
273 /// \r
274 /// LegacySegment Ignored\r
275 /// \r
276 /// LegacyOffset Ignored\r
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
412fb9ef 293 This enum specifies the Mode param values for GetPlatformHandle()\r
04dd6cc0 294**/\r
79964ac8 295typedef 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
302 /// Type 0x00\r
303 ///\r
304 /// HandleBuffer Buffer of all VGA handles found.\r
305 ///\r
306 /// HandleCount Number of VGA handles found.\r
307 ///\r
308 /// AdditionalData NULL\r
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
317 /// Type 0x00\r
318 ///\r
319 /// HandleBuffer Buffer of all IDE handles found.\r
320 ///\r
321 /// HandleCount Number of IDE handles found\r
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
333 /// Type 0x00\r
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
339 /// AdditionalData NULL\r
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
348 /// Type 0x00\r
349 ///\r
350 /// HandleBuffer Buffer of all USB handles found.\r
351 ///\r
352 /// HandleCount Number of USB bus handles found.\r
353 ///\r
354 /// AdditionalData NULL\r
355 ///\r
79964ac8 356 EfiGetPlatformUsbHandle = 3\r
357} EFI_GET_PLATFORM_HANDLE_MODE;\r
358\r
04dd6cc0 359/**\r
412fb9ef 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 363typedef 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
369 /// Type 0\r
370 ///\r
371 /// DeviceHandle Handle of device OpROM is associated with. \r
372 ///\r
373 /// ShadowAddress Address where OpROM is shadowed.\r
374 ///\r
375 /// Compatibility16Table NULL\r
376 ///\r
377 /// AdditionalData NULL\r
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
386 /// Type 0\r
387 ///\r
388 /// DeviceHandle 0\r
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
394 /// AdditionalData NULL\r
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
403 /// Type 0\r
404 ///\r
405 /// DeviceHandle Handle of device OpROM is associated with. \r
406 ///\r
407 /// ShadowAddress Address where OpROM is shadowed.\r
408 ///\r
409 /// Compatibility16Table NULL\r
410 ///\r
411 /// AdditionalData NULL\r
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
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 431typedef 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
446UINT8 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
454typedef 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
492