]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/LegacyBiosPlatform.h
1) Add Include/Framework/BootScript.h that contains defines shared between Boot Scrip...
[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 1074.
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
44 /// LegacyOffset set to 0. The mode returns the MP table address in EFI memory and its size.\r
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
47 /// invocation allows any MP table address fix ups to occur in the EFI memory copy of the\r
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
62 /// Alignment Bit mapped address alignment granularity. \r
63 /// The first nonzero bit from the right is the address granularity.\r
64 ///\r
65 // LegacySegment Segment where EfiCompatibility code will place the MP table.\r
66 ///\r
67 /// LegacyOffset Offset where EfiCompatibility code will place the MP table.\r
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
77 /// This mode returns a block of data. The contents and usage is IBV or OEM defined.\r
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
82 /// LegacyOffset set to 0. The function returns the table address in EFI memory and its size.\r
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
85 /// invocation allows any data (table) address fix ups to occur in the EFI memory copy of\r
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
103 /// LegacySegment Segment where EfiCompatibility code will place the table or data.\r
104 ///\r
105 /// LegacyOffset Offset where EfiCompatibility code will place the table or data.\r
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
115 /// This mode returns a block of data. The contents and usage is IBV defined. OEMs or\r
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
119 /// An example usage might be a legacy mobile BIOS that has a pre existing runtime\r
120 /// interface to return the battery status to calling applications.\r
121 /// This mode is invoked twice. The first invocation has LegacySegment and\r
122 /// LegacyOffset set to 0. The mode returns the table address in EFI memory and its size.\r
123 /// The second invocation has LegacySegment and LegacyOffset set to the location\r
124 /// in the 0xF0000 or 0xE0000 block to which the table is to be copied. The second\r
125 /// invocation allows any table address fix ups to occur in the EFI memory copy of the table.\r
126 /// The caller, not EfiGetPlatformBinaryOem16Data, copies the modified table to\r
127 /// the allocated region in 0xF0000 or 0xE0000 block after the second invocation.\r
128 ///\r
129 /// The function parameters associated with this mode are:\r
130 ///\r
131 /// Table Pointer to OEM legacy 16 bit code or data.\r
132 ///\r
133 /// TableSize Size of data.\r
134 ///\r
135 /// Location Location to place the table. 0x00. Either 0xE0000 or 0xF0000 64 KB blocks.\r
136 /// Bit 0 = 1 0xF0000 64 KB block.\r
137 /// Bit 1 = 1 0xE0000 64 KB block.\r
138 /// Multiple bits can be set.\r
139 ///\r
140 /// Alignment Bit mapped address alignment granularity. \r
141 /// The first nonzero bit from the right is the address granularity.\r
142 ///\r
143 /// LegacySegment Segment where EfiCompatibility code will place the table or data.\r
144 ///\r
145 /// LegacyOffset Offset where EfiCompatibility code will place the table or data.\r
146 ///\r
147 /// The return values associated with this mode are:\r
148 ///\r
149 /// EFI_SUCCESS The data was returned successfully.\r
150 ///\r
151 /// EFI_UNSUPPORTED Oem16 is not supported on this platform.\r
152 ///\r
79964ac8 153 EfiGetPlatformBinaryOem16Data = 2,\r
412fb9ef 154///\r
155/// This mode returns a block of data. The contents and usage is IBV defined. OEMs or\r
156/// IBVs normally use this mode for nonstandard Compatibility16 runtime 32 bit routines. It\r
157/// is the responsibility of this routine to coalesce multiple OEM 32 bit functions, if they\r
158/// exist, into one coherent package that is understandable by the Compatibility16 code.\r
159/// An example usage might be a legacy mobile BIOS that has a pre existing runtime\r
160/// interface to return the battery status to calling applications.\r
161/// This mode is invoked twice. The first invocation has LegacySegment and\r
162/// LegacyOffset set to 0. The mode returns the table address in EFI memory and its size.\r
163/// \r
164/// The second invocation has LegacySegment and LegacyOffset set to the location\r
165/// in the 0xF0000 or 0xE0000 block to which the table is to be copied. The second\r
166/// invocation allows any table address fix ups to occur in the EFI memory copy of the table.\r
167/// The caller, not EfiGetPlatformBinaryOem32Data, copies the modified table to\r
168/// the allocated region in 0xF0000 or 0xE0000 block after the second invocation..\r
169///\r
170/// Note: There are two generic mechanisms by which this mode can be used.\r
f0d6194d 171/// Mechanism 1: This mode returns the data and the Legacy BIOS Protocol copies\r
412fb9ef 172/// the data into the F0000 or E0000 block in the Compatibility16 code. The\r
173/// EFI_COMPATIBILITY16_TABLE entries Oem32Segment and Oem32Offset can\r
174/// be viewed as two UINT16 entries.\r
f0d6194d 175/// Mechanism 2: This mode directly fills in the EFI_COMPATIBILITY16_TABLE with\r
412fb9ef 176/// a pointer to the INT15 E820 region containing the 32 bit code. It returns\r
177/// EFI_UNSUPPORTED. The EFI_COMPATIBILITY16_TABLE entries,\r
178/// Oem32Segment and Oem32Offset, can be viewed as two UINT16 entries or\r
179/// as a single UINT32 entry as determined by the IBV.\r
180///\r
181/// The function parameters associated with this mode are:\r
182///\r
183/// TableSize Size of data.\r
184///\r
55db3d44 185/// Location Location to place the table. 0x00 or 0xE0000 or 0xF0000 64 KB blocks.\r
412fb9ef 186/// Bit 0 = 1 0xF0000 64 KB block.\r
187/// Bit 1 = 1 0xE0000 64 KB block.\r
188/// Multiple bits can be set.\r
189///\r
190/// Alignment Bit mapped address alignment granularity. \r
191/// The first nonzero bit from the right is the address granularity.\r
192///\r
193/// LegacySegment Segment where EfiCompatibility code will place the table or data.\r
194///\r
195/// LegacyOffset Offset where EfiCompatibility code will place the table or data.\r
196///\r
197/// The return values associated with this mode are:\r
198/// EFI_SUCCESS The data was returned successfully.\r
199/// EFI_UNSUPPORTED Oem32 is not supported on this platform.\r
200///\r
201EfiGetPlatformBinaryOem32Data = 3,\r
202 ///\r
203 /// This mode returns a TPM binary image for the onboard TPM device.\r
204 ///\r
205 /// The function parameters associated with this mode are:\r
206 ///\r
207 /// Table TPM binary image for the onboard TPM device.\r
208 ///\r
209 /// TableSize Size of BinaryImage in bytes.\r
210 ///\r
211 /// Location Location to place the table. 0x00. Either 0xE0000 or 0xF0000 64 KB blocks.\r
212 /// Bit 0 = 1 0xF0000 64 KB block.\r
213 /// Bit 1 = 1 0xE0000 64 KB block.\r
214 /// Multiple bits can be set.\r
215 ///\r
216 /// Alignment Bit mapped address alignment granularity. \r
217 /// The first nonzero bit from the right is the address granularity.\r
218 ///\r
219 /// LegacySegment Segment where EfiCompatibility code will place the table or data.\r
220 ///\r
221 /// LegacyOffset Offset where EfiCompatibility code will place the table or data.\r
222 ///\r
223 /// The return values associated with this mode are:\r
224 ///\r
225 /// EFI_SUCCESS BinaryImage is valid.\r
226 ///\r
227 /// EFI_UNSUPPORTED Mode is not supported on this platform.\r
228 ///\r
229 /// EFI_NOT_FOUND No BinaryImage was found.\r
230 ///\r
79964ac8 231 EfiGetPlatformBinaryTpmBinary = 4,\r
412fb9ef 232 ///\r
55db3d44 233 /// The mode finds the Compatibility16 Rom Image.\r
412fb9ef 234 ///\r
235 /// The function parameters associated with this mode are:\r
236 ///\r
237 /// System ROM image for the platform\r
238 /// \r
239 /// TableSize Size of Table in bytes\r
240 /// \r
241 /// Location Ignored\r
242 /// \r
243 /// Alignment Ignored\r
244 /// \r
245 /// LegacySegment Ignored\r
246 /// \r
247 /// LegacyOffset Ignored\r
248 ///\r
249 /// The return values associated with this mode are:\r
250 ///\r
251 /// EFI_SUCCESS ROM image found.\r
252 /// \r
253 /// EFI_NOT_FOUND ROM not found.\r
254 ///\r
79964ac8 255 EfiGetPlatformBinarySystemRom = 5,\r
412fb9ef 256 ///\r
257 /// This mode returns the Base address of PciExpress memory mapped configuration\r
258 /// address space.\r
259 ///\r
260 /// The function parameters associated with this mode are:\r
261 ///\r
262 /// Table System ROM image for the platform\r
263 /// \r
264 /// TableSize Size of Table in bytes\r
265 /// \r
266 /// Location Ignored\r
267 /// \r
268 /// Alignment Ignored\r
269 /// \r
270 /// LegacySegment Ignored\r
271 /// \r
272 /// LegacyOffset Ignored\r
273 ///\r
274 /// The return values associated with this mode are:\r
275 ///\r
276 /// EFI_SUCCESS Address is valid.\r
277 ///\r
278 /// EFI_UNSUPPORTED System does not PciExpress.\r
279 ///\r
79964ac8 280 EfiGetPlatformPciExpressBase = 6,\r
412fb9ef 281 ///\r
79964ac8 282 EfiGetPlatformPmmSize = 7,\r
412fb9ef 283 ///\r
79964ac8 284 EfiGetPlatformEndOpromShadowAddr = 8,\r
412fb9ef 285 ///\r
79964ac8 286} EFI_GET_PLATFORM_INFO_MODE;\r
287\r
04dd6cc0 288/**\r
412fb9ef 289 This enum specifies the Mode param values for GetPlatformHandle()\r
04dd6cc0 290**/\r
79964ac8 291typedef enum {\r
412fb9ef 292 ///\r
293 /// This mode returns the Compatibility16 policy for the device that should be the VGA\r
294 /// controller used during a Compatibility16 boot.\r
295 ///\r
296 /// The function parameters associated with this mode are:\r
297 ///\r
298 /// Type 0x00\r
299 ///\r
300 /// HandleBuffer Buffer of all VGA handles found.\r
301 ///\r
302 /// HandleCount Number of VGA handles found.\r
303 ///\r
304 /// AdditionalData NULL\r
305 /// \r
79964ac8 306 EfiGetPlatformVgaHandle = 0,\r
412fb9ef 307 ///\r
308 /// This mode returns the Compatibility16 policy for the device that should be the IDE\r
309 /// controller used during a Compatibility16 boot.\r
310 ///\r
311 /// The function parameters associated with this mode are:\r
312 ///\r
313 /// Type 0x00\r
314 ///\r
315 /// HandleBuffer Buffer of all IDE handles found.\r
316 ///\r
317 /// HandleCount Number of IDE handles found\r
318 ///\r
319 /// AdditionalData Pointer to HddInfo.\r
320 /// Information about all onboard IDE controllers.\r
321 ///\r
79964ac8 322 EfiGetPlatformIdeHandle = 1,\r
412fb9ef 323 ///\r
324 /// This mode returns the Compatibility16 policy for the device that should be the ISA bus\r
325 /// controller used during a Compatibility16 boot.\r
326 ///\r
327 /// The function parameters associated with this mode are:\r
328 ///\r
329 /// Type 0x00\r
330 ///\r
331 /// HandleBuffer Buffer of all ISA bus handles found.\r
332 ///\r
333 /// HandleCount Number of ISA bus handles found.\r
334 ///\r
335 /// AdditionalData NULL\r
336 ///\r
79964ac8 337 EfiGetPlatformIsaBusHandle = 2,\r
412fb9ef 338 ///\r
339 /// This mode returns the Compatibility16 policy for the device that should be the USB\r
340 /// device used during a Compatibility16 boot.\r
341 ///\r
342 /// The function parameters associated with this mode are:\r
343 ///\r
344 /// Type 0x00\r
345 ///\r
346 /// HandleBuffer Buffer of all USB handles found.\r
347 ///\r
348 /// HandleCount Number of USB bus handles found.\r
349 ///\r
350 /// AdditionalData NULL\r
351 ///\r
79964ac8 352 EfiGetPlatformUsbHandle = 3\r
353} EFI_GET_PLATFORM_HANDLE_MODE;\r
354\r
04dd6cc0 355/**\r
412fb9ef 356 This enum specifies the Mode param values for PlatformHooks()\r
357 Note: Any OEM defined hooks start with 0x8000\r
04dd6cc0 358**/\r
79964ac8 359typedef enum {\r
412fb9ef 360 ///\r
361 /// This mode allows any preprocessing before scanning OpROMs.\r
362 ///\r
363 /// The function parameters associated with this mode are:\r
364 ///\r
365 /// Type 0\r
366 ///\r
367 /// DeviceHandle Handle of device OpROM is associated with. \r
368 ///\r
369 /// ShadowAddress Address where OpROM is shadowed.\r
370 ///\r
371 /// Compatibility16Table NULL\r
372 ///\r
373 /// AdditionalData NULL\r
374 ///\r
79964ac8 375 EfiPlatformHookPrepareToScanRom = 0,\r
412fb9ef 376 ///\r
377 /// This mode shadows legacy OpROMS that may not have a physical device associated with\r
378 /// them. It returns EFI_SUCCESS if the ROM was shadowed.\r
379 ///\r
380 /// The function parameters associated with this mode are:\r
381 ///\r
382 /// Type 0\r
383 ///\r
384 /// DeviceHandle 0\r
385 ///\r
386 /// ShadowAddress First free OpROM area, after other OpROMs have been dispatched..\r
387 ///\r
388 /// Compatibility16Table Pointer to the Compatability16 Table.\r
389 ///\r
390 /// AdditionalData NULL\r
391 ///\r
79964ac8 392 EfiPlatformHookShadowServiceRoms= 1,\r
412fb9ef 393 ///\r
394 /// This mode allows platform to perform any required operation after an OpROM has\r
395 /// completed its initialization.\r
396 ///\r
397 /// The function parameters associated with this mode are:\r
398 ///\r
399 /// Type 0\r
400 ///\r
401 /// DeviceHandle Handle of device OpROM is associated with. \r
402 ///\r
403 /// ShadowAddress Address where OpROM is shadowed.\r
404 ///\r
405 /// Compatibility16Table NULL\r
406 ///\r
407 /// AdditionalData NULL\r
408 /// \r
79964ac8 409 EfiPlatformHookAfterRomInit = 2\r
410} EFI_GET_PLATFORM_HOOK_MODE;\r
411\r
04dd6cc0 412///\r
413/// This IRQ has not been assigned to PCI.\r
414///\r
9226e4ee 415#define PCI_UNUSED 0x00\r
04dd6cc0 416///\r
417/// This IRQ has been assigned to PCI.\r
418/// \r
9226e4ee 419#define PCI_USED 0xFF\r
04dd6cc0 420///\r
421/// This IRQ has been used by an SIO legacy device and cannot be used by PCI.\r
422///\r
f0d6194d
LG
423#define LEGACY_USED 0xFE\r
424\r
9226e4ee 425#pragma pack(1)\r
426\r
9226e4ee 427typedef struct {\r
412fb9ef 428 ///\r
429 /// IRQ for this entry.\r
430 ///\r
9226e4ee 431 UINT8 Irq;\r
412fb9ef 432 ///\r
433 /// Status of this IRQ.\r
434 ///\r
435 /// PCI_UNUSED 0x00. This IRQ has not been assigned to PCI.\r
436 ///\r
437 /// PCI_USED 0xFF. This IRQ has been assigned to PCI.\r
438 ///\r
439 /// LEGACY_USED 0xFE. This IRQ has been used by an SIO legacy\r
440 /// device and cannot be used by PCI.\r
441 ///\r
442UINT8 Used;\r
9226e4ee 443} EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY;\r
444\r
445//\r
446// Define PIR table structures\r
447//\r
448#define EFI_LEGACY_PIRQ_TABLE_SIGNATURE SIGNATURE_32 ('$', 'P', 'I', 'R')\r
449\r
450typedef struct {\r
412fb9ef 451 ///\r
452 /// $PIR.\r
453 ///\r
9226e4ee 454 UINT32 Signature;\r
412fb9ef 455 ///\r
456 /// 0x00.\r
457 ///\r
9226e4ee 458 UINT8 MinorVersion;\r
412fb9ef 459 ///\r
460 /// 0x01 for table version 1.0.\r
461 ///\r
9226e4ee 462 UINT8 MajorVersion;\r
412fb9ef 463 ///\r
464 /// 0x20 + RoutingTableEntries * 0x10.\r
465 ///\r
9226e4ee 466 UINT16 TableSize;\r
412fb9ef 467 ///\r
468 /// PCI interrupt router bus.\r
469 ///\r
9226e4ee 470 UINT8 Bus;\r
412fb9ef 471 ///\r
472 /// PCI interrupt router device/function.\r
473 ///\r
9226e4ee 474 UINT8 DevFun;\r
412fb9ef 475 ///\r
476 /// If nonzero, bit map of IRQs reserved for PCI.\r
477 ///\r
9226e4ee 478 UINT16 PciOnlyIrq;\r
412fb9ef 479 ///\r
480 /// Vendor ID of a compatible PCI interrupt router.\r
481 ///\r
9226e4ee 482 UINT16 CompatibleVid;\r
412fb9ef 483 ///\r
484 /// Device ID of a compatible PCI interrupt router.\r
485 ///\r
9226e4ee 486 UINT16 CompatibleDid;\r
412fb9ef 487 ///\r
488