Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /** @file\r |
2 | The EFI Legacy BIOS Protocol is used to abstract legacy Option ROM usage\r | |
3 | under EFI and Legacy OS boot.\r | |
4 | \r | |
5 | Note: The names for EFI_IA32_REGISTER_SET elements were picked to follow \r | |
6 | well known naming conventions.\r | |
7 | \r | |
8 | Thunk - A thunk is a transition from one processor mode to another. A Thunk\r | |
9 | is a transition from native EFI mode to 16-bit mode. A reverse thunk\r | |
10 | would be a transition from 16-bit mode to native EFI mode.\r | |
11 | \r | |
12 | You most likely should not use this protocol! Find the EFI way to solve the\r | |
13 | problem to make your code portable\r | |
14 | \r | |
15 | Copyright (c) 2006, Intel Corporation \r | |
16 | All rights reserved. This program and the accompanying materials \r | |
17 | are licensed and made available under the terms and conditions of the BSD License \r | |
18 | which accompanies this distribution. The full text of the license may be found at \r | |
19 | http://opensource.org/licenses/bsd-license.php \r | |
20 | \r | |
21 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
22 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
23 | \r | |
24 | Module Name: LegacyBios.h\r | |
25 | \r | |
26 | @par Revision Reference:\r | |
27 | This protocol is defined in Framework for EFI Compatibility Support Module spec\r | |
28 | Version 0.96\r | |
29 | \r | |
30 | **/\r | |
31 | \r | |
32 | #ifndef _EFI_LEGACY_BIOS_H\r | |
33 | #define _EFI_LEGACY_BIOS_H\r | |
34 | \r | |
35 | #define EFI_LEGACY_BIOS_PROTOCOL_GUID \\r | |
36 | { \\r | |
37 | 0xdb9a1e3d, 0x45cb, 0x4abb, {0x85, 0x3b, 0xe5, 0x38, 0x7f, 0xdb, 0x2e, 0x2d } \\r | |
38 | }\r | |
39 | \r | |
40 | typedef struct _EFI_LEGACY_BIOS_PROTOCOL EFI_LEGACY_BIOS_PROTOCOL;\r | |
41 | \r | |
42 | //\r | |
43 | // Convert from 32-bit address (_Adr) to Segment:Offset 16-bit form\r | |
44 | //\r | |
45 | #define EFI_SEGMENT(_Adr) (UINT16) ((UINT16) (((UINTN) (_Adr)) >> 4) & 0xf000)\r | |
46 | #define EFI_OFFSET(_Adr) (UINT16) (((UINT16) ((UINTN) (_Adr))) & 0xffff)\r | |
47 | #define BYTE_GRANULARITY 0x01\r | |
48 | #define WORD_GRANULARITY 0x02\r | |
49 | #define DWORD_GRANULARITY 0x04\r | |
50 | #define QWORD_GRANULARITY 0x08\r | |
51 | #define PARAGRAPH_GRANULARITY 0x10\r | |
52 | \r | |
53 | #define CARRY_FLAG 0x01\r | |
54 | \r | |
55 | //*********************************************************\r | |
56 | // EFI_EFLAGS_REG\r | |
57 | //*********************************************************\r | |
58 | typedef struct {\r | |
59 | UINT32 CF:1;\r | |
60 | UINT32 Reserved1:1;\r | |
61 | UINT32 PF:1;\r | |
62 | UINT32 Reserved2:1;\r | |
63 | UINT32 AF:1;\r | |
64 | UINT32 Reserved3:1;\r | |
65 | UINT32 ZF:1;\r | |
66 | UINT32 SF:1;\r | |
67 | UINT32 TF:1;\r | |
68 | UINT32 IF:1;\r | |
69 | UINT32 DF:1;\r | |
70 | UINT32 OF:1;\r | |
71 | UINT32 IOPL:2;\r | |
72 | UINT32 NT:1;\r | |
73 | UINT32 Reserved4:2;\r | |
74 | UINT32 VM:1;\r | |
75 | UINT32 Reserved5:14;\r | |
76 | } EFI_EFLAGS_REG;\r | |
77 | \r | |
78 | //*********************************************************\r | |
79 | // EFI_DWORD_REGS\r | |
80 | //*********************************************************\r | |
81 | \r | |
82 | typedef struct {\r | |
83 | UINT32 EAX;\r | |
84 | UINT32 EBX;\r | |
85 | UINT32 ECX;\r | |
86 | UINT32 EDX;\r | |
87 | UINT32 ESI;\r | |
88 | UINT32 EDI;\r | |
89 | EFI_EFLAGS_REG EFlags;\r | |
90 | UINT16 ES;\r | |
91 | UINT16 CS;\r | |
92 | UINT16 SS;\r | |
93 | UINT16 DS;\r | |
94 | UINT16 FS;\r | |
95 | UINT16 GS;\r | |
96 | UINT32 EBP;\r | |
97 | UINT32 ESP;\r | |
98 | } EFI_DWORD_REGS;\r | |
99 | \r | |
100 | //*******************************************\r | |
101 | // EFI_FLAGS_REG\r | |
102 | //*******************************************\r | |
103 | typedef struct {\r | |
104 | UINT16 CF:1;\r | |
105 | UINT16 Reserved1:1;\r | |
106 | UINT16 PF:1;\r | |
107 | UINT16 Reserved2:1;\r | |
108 | UINT16 AF:1;\r | |
109 | UINT16 Reserved3:1;\r | |
110 | UINT16 ZF:1;\r | |
111 | UINT16 SF:1;\r | |
112 | UINT16 TF:1;\r | |
113 | UINT16 IF:1;\r | |
114 | UINT16 DF:1;\r | |
115 | UINT16 OF:1;\r | |
116 | UINT16 IOPL:2;\r | |
117 | UINT16 NT:1;\r | |
118 | UINT16 Reserved4:1;\r | |
119 | } EFI_FLAGS_REG;\r | |
120 | \r | |
121 | \r | |
122 | //*********************************************************\r | |
123 | // EFI_WORD_REGS\r | |
124 | //*********************************************************\r | |
125 | \r | |
126 | typedef struct {\r | |
127 | UINT16 AX;\r | |
128 | UINT16 ReservedAX;\r | |
129 | UINT16 BX;\r | |
130 | UINT16 ReservedBX; \r | |
131 | UINT16 CX;\r | |
132 | UINT16 ReservedCX;\r | |
133 | UINT16 DX;\r | |
134 | UINT16 ReservedDX;\r | |
135 | UINT16 SI;\r | |
136 | UINT16 ReservedSI;\r | |
137 | UINT16 DI;\r | |
138 | UINT16 ReservedDI;\r | |
139 | EFI_FLAGS_REG Flags;\r | |
140 | UINT16 ReservedFlags;\r | |
141 | UINT16 ES;\r | |
142 | UINT16 CS;\r | |
143 | UINT16 SS;\r | |
144 | UINT16 DS;\r | |
145 | UINT16 FS;\r | |
146 | UINT16 GS; \r | |
147 | UINT16 BP;\r | |
148 | UINT16 ReservedBP; \r | |
149 | UINT16 SP;\r | |
150 | UINT16 ReservedSP; \r | |
151 | } EFI_WORD_REGS;\r | |
152 | \r | |
153 | //*********************************************************\r | |
154 | // EFI_BYTE_REGS\r | |
155 | //*********************************************************\r | |
156 | \r | |
157 | typedef struct {\r | |
158 | UINT8 AL, AH;\r | |
159 | UINT16 ReservedAX;\r | |
160 | UINT8 BL, BH;\r | |
161 | UINT16 ReservedBX;\r | |
162 | UINT8 CL, CH;\r | |
163 | UINT16 ReservedCX;\r | |
164 | UINT8 DL, DH;\r | |
165 | UINT16 ReservedDX;\r | |
166 | } EFI_BYTE_REGS;\r | |
167 | \r | |
168 | typedef union {\r | |
169 | EFI_DWORD_REGS E;\r | |
170 | EFI_WORD_REGS X;\r | |
171 | EFI_BYTE_REGS H;\r | |
172 | } EFI_IA32_REGISTER_SET;\r | |
173 | \r | |
174 | #pragma pack(1)\r | |
175 | //\r | |
176 | // $EFI table created by Legacy16 code and consumed by EFI Legacy driver\r | |
177 | //\r | |
178 | typedef struct {\r | |
179 | UINT32 Signature; // "$EFI"\r | |
180 | UINT8 TableChecksum;\r | |
181 | UINT8 TableLength;\r | |
182 | UINT8 EfiMajorRevision;\r | |
183 | UINT8 EfiMinorRevision;\r | |
184 | UINT8 TableMajorRevision;\r | |
185 | UINT8 TableMinorRevision;\r | |
e4a246f1 | 186 | UINT16 Reserved;\r |
187 | UINT16 Compatibility16CallSegment;\r | |
188 | UINT16 Compatibility16CallOffset;\r | |
878ddf1f | 189 | \r |
190 | UINT16 PnPInstallationCheckSegment;\r | |
191 | UINT16 PnPInstallationCheckOffset;\r | |
192 | \r | |
193 | UINT32 EfiSystemTable;\r | |
e4a246f1 | 194 | UINT32 OemIdStringPointer;\r |
878ddf1f | 195 | UINT32 AcpiRsdPtrPointer;\r |
196 | UINT16 OemRevision;\r | |
197 | UINT32 E820Pointer;\r | |
198 | UINT32 E820Length;\r | |
199 | UINT32 IrqRoutingTablePointer;\r | |
200 | UINT32 IrqRoutingTableLength;\r | |
201 | UINT32 MpTablePtr;\r | |
202 | UINT32 MpTableLength;\r | |
203 | UINT16 OemIntSegment;\r | |
204 | UINT16 OemIntOffset;\r | |
205 | UINT16 Oem32Segment;\r | |
206 | UINT16 Oem32Offset;\r | |
207 | UINT16 Oem16Segment;\r | |
208 | UINT16 Oem16Offset;\r | |
209 | UINT16 TpmSegment;\r | |
210 | UINT16 TpmOffset;\r | |
211 | UINT32 IbvPointer;\r | |
212 | UINT32 PciExpressBase;\r | |
213 | UINT8 LastPciBus;\r | |
214 | } EFI_COMPATIBILITY16_TABLE;\r | |
215 | //\r | |
216 | // define maximum number of HDD system supports\r | |
217 | //\r | |
218 | #define MAX_HDD_ENTRIES 0x30\r | |
219 | \r | |
220 | typedef struct {\r | |
221 | UINT16 Raw[256];\r | |
222 | } ATAPI_IDENTIFY;\r | |
223 | \r | |
224 | //\r | |
225 | // HDD_INFO status\r | |
226 | //\r | |
227 | #define HDD_PRIMARY 0x01\r | |
228 | #define HDD_SECONDARY 0x02\r | |
229 | #define HDD_MASTER_ATAPI_CDROM 0x04\r | |
230 | #define HDD_SLAVE_ATAPI_CDROM 0x08\r | |
231 | #define HDD_MASTER_IDE 0x20\r | |
232 | #define HDD_SLAVE_IDE 0x40\r | |
233 | #define HDD_MASTER_ATAPI_ZIPDISK 0x10\r | |
234 | #define HDD_SLAVE_ATAPI_ZIPDISK 0x80\r | |
235 | \r | |
236 | typedef struct {\r | |
237 | UINT16 Status;\r | |
238 | UINT32 Bus;\r | |
239 | UINT32 Device;\r | |
240 | UINT32 Function;\r | |
241 | UINT16 CommandBaseAddress;\r | |
242 | UINT16 ControlBaseAddress;\r | |
243 | UINT16 BusMasterAddress;\r | |
244 | UINT8 HddIrq;\r | |
245 | ATAPI_IDENTIFY IdentifyDrive[2];\r | |
246 | } HDD_INFO;\r | |
247 | \r | |
248 | //\r | |
249 | // Parties data structures\r | |
250 | //\r | |
251 | typedef struct {\r | |
252 | UINT8 DirectoryServiceValidity : 1;\r | |
253 | UINT8 RabcaUsedFlag : 1;\r | |
254 | UINT8 ExecuteHddDiagnosticsFlag : 1;\r | |
255 | UINT8 Reserved : 5;\r | |
256 | } UDC_ATTRIBUTES;\r | |
257 | \r | |
258 | typedef struct {\r | |
259 | UDC_ATTRIBUTES Attributes;\r | |
260 | UINT8 DeviceNumber;\r | |
261 | UINT8 BbsTableEntryNumberForParentDevice;\r | |
262 | UINT8 BbsTableEntryNumberForBoot;\r | |
263 | UINT8 BbsTableEntryNumberForHddDiag;\r | |
264 | UINT8 BeerData[128];\r | |
265 | UINT8 ServiceAreaData[64];\r | |
266 | } UD_TABLE;\r | |
267 | \r | |
268 | //\r | |
269 | // define BBS Device Types\r | |
270 | //\r | |
271 | #define BBS_FLOPPY 0x01\r | |
272 | #define BBS_HARDDISK 0x02\r | |
273 | #define BBS_CDROM 0x03\r | |
274 | #define BBS_PCMCIA 0x04\r | |
275 | #define BBS_USB 0x05\r | |
276 | #define BBS_EMBED_NETWORK 0x06\r | |
277 | #define BBS_BEV_DEVICE 0x80\r | |
278 | #define BBS_UNKNOWN 0xff\r | |
279 | \r | |
280 | typedef struct {\r | |
281 | UINT16 OldPosition : 4;\r | |
282 | UINT16 Reserved1 : 4;\r | |
283 | UINT16 Enabled : 1;\r | |
284 | UINT16 Failed : 1;\r | |
285 | UINT16 MediaPresent : 2;\r | |
286 | UINT16 Reserved2 : 4;\r | |
287 | } BBS_STATUS_FLAGS;\r | |
288 | \r | |
289 | #define MAX_BBS_ENTRIES 0x100\r | |
290 | //\r | |
291 | // BBS_IGNORE_ENTRY is placed in the BootPriority field if the entry is to\r | |
292 | // be skipped.\r | |
293 | // BBS_UNPRIORITIZED_ENTRY is placed in the BootPriority field before\r | |
294 | // priority has been assigned but indicates valid entry.\r | |
295 | // BBS_LOWEST_PRIORITY is normally used for removable media with no media\r | |
296 | // inserted. This allows the 16-bit CSM to allocate a drive letter to\r | |
297 | // the device.\r | |
298 | // BBS_DO_NOT_BOOT_FROM is used for devices that the 16-bit CSM is to assign\r | |
299 | // a drive letter to but never boot from.\r | |
300 | //\r | |
301 | // AdditionalIrq??Handler usage is IBV specific. The fields have been added\r | |
302 | // for:\r | |
303 | // 1. Saving non-BBS card info about IRQs taken by card.\r | |
304 | // 2. For BBS compliant cards that hook IRQs in order to have their SETUP\r | |
305 | // executed.\r | |
306 | //\r | |
307 | #define BBS_DO_NOT_BOOT_FROM 0xFFFC\r | |
308 | #define BBS_LOWEST_PRIORITY 0xFFFD\r | |
309 | #define BBS_UNPRIORITIZED_ENTRY 0xFFFE\r | |
310 | #define BBS_IGNORE_ENTRY 0xFFFF\r | |
311 | \r | |
312 | typedef struct {\r | |
313 | UINT16 BootPriority;\r | |
314 | UINT32 Bus;\r | |
315 | UINT32 Device;\r | |
316 | UINT32 Function;\r | |
317 | UINT8 Class;\r | |
318 | UINT8 SubClass;\r | |
319 | UINT16 MfgStringOffset;\r | |
320 | UINT16 MfgStringSegment;\r | |
321 | UINT16 DeviceType;\r | |
322 | BBS_STATUS_FLAGS StatusFlags;\r | |
323 | UINT16 BootHandlerOffset;\r | |
324 | UINT16 BootHandlerSegment;\r | |
325 | UINT16 DescStringOffset;\r | |
326 | UINT16 DescStringSegment;\r | |
327 | UINT32 InitPerReserved;\r | |
328 | UINT32 AdditionalIrq13Handler;\r | |
329 | UINT32 AdditionalIrq18Handler;\r | |
330 | UINT32 AdditionalIrq19Handler;\r | |
331 | UINT32 AdditionalIrq40Handler;\r | |
332 | UINT8 AssignedDriveNumber;\r | |
333 | UINT32 AdditionalIrq41Handler;\r | |
334 | UINT32 AdditionalIrq46Handler;\r | |
335 | UINT32 IBV1;\r | |
336 | UINT32 IBV2;\r | |
337 | } BBS_TABLE;\r | |
338 | \r | |
339 | #pragma pack()\r | |
340 | \r | |
341 | /**\r | |
342 | Thunk to 16-bit real mode and execute a software interrupt with a vector \r | |
343 | of BiosInt. Regs will contain the 16-bit register context on entry and \r | |
344 | exit.\r | |
345 | \r | |
0647c9ad LG |
346 | @param This Protocol instance pointer.\r |
347 | @param BiosInt Processor interrupt vector to invoke\r | |
348 | @param Reg Register contexted passed into (and returned) from thunk to\r | |
349 | 16-bit mode\r | |
878ddf1f | 350 | \r |
0647c9ad LG |
351 | @retval FALSE Thunk completed, and there were no BIOS errors in the target code.\r |
352 | See Regs for status.\r | |
353 | @retval TRUE There was a BIOS erro in the target code.\r | |
878ddf1f | 354 | \r |
355 | **/\r | |
356 | typedef\r | |
357 | BOOLEAN\r | |
358 | (EFIAPI *EFI_LEGACY_BIOS_INT86) (\r | |
359 | IN EFI_LEGACY_BIOS_PROTOCOL *This,\r | |
360 | IN UINT8 BiosInt,\r | |
361 | IN OUT EFI_IA32_REGISTER_SET *Regs\r | |
362 | )\r | |
363 | ;\r | |
364 | \r | |
365 | /**\r | |
366 | Thunk to 16-bit real mode and call Segment:Offset. Regs will contain the \r | |
367 | 16-bit register context on entry and exit. Arguments can be passed on \r | |
368 | the Stack argument\r | |
369 | \r | |
0647c9ad LG |
370 | @param This Protocol instance pointer.\r |
371 | @param Segment Segemnt of 16-bit mode call\r | |
372 | @param Offset Offset of 16-bit mdoe call\r | |
373 | @param Reg Register contexted passed into (and returned) from thunk to\r | |
374 | 16-bit mode\r | |
375 | @param Stack Caller allocated stack used to pass arguments\r | |
376 | @param StackSize Size of Stack in bytes\r | |
878ddf1f | 377 | \r |
0647c9ad LG |
378 | @retval FALSE Thunk completed, and there were no BIOS errors in the target code.\r |
379 | See Regs for status.\r | |
380 | @retval TRUE There was a BIOS erro in the target code.\r | |
878ddf1f | 381 | \r |
382 | **/\r | |
383 | typedef\r | |
384 | BOOLEAN\r | |
385 | (EFIAPI *EFI_LEGACY_BIOS_FARCALL86) (\r | |
386 | IN EFI_LEGACY_BIOS_PROTOCOL *This,\r | |
387 | IN UINT16 Segment,\r | |
388 | IN UINT16 Offset,\r | |
389 | IN EFI_IA32_REGISTER_SET *Regs,\r | |
390 | IN VOID *Stack,\r | |
391 | IN UINTN StackSize\r | |
392 | )\r | |
393 | ;\r | |
394 | \r | |
395 | typedef\r | |
396 | EFI_STATUS\r | |
397 | (EFIAPI *EFI_LEGACY_BIOS_CHECK_ROM) (\r | |
398 | IN EFI_LEGACY_BIOS_PROTOCOL *This,\r | |
399 | IN EFI_HANDLE PciHandle,\r | |
400 | OUT VOID **RomImage, OPTIONAL\r | |
401 | OUT UINTN *RomSize, OPTIONAL\r | |
402 | OUT UINTN *Flags\r | |
403 | \r | |
404 | /**\r | |
405 | Test to see if a legacy PCI ROM exists for this device. Optionally return\r | |
406 | the Legacy ROM instance for this PCI device.\r | |
407 | \r | |
0647c9ad LG |
408 | @param This Protocol instance pointer.\r |
409 | @param PciHandle The PCI PC-AT OPROM from this devices ROM BAR will be loaded\r | |
410 | @param RomImage Return the legacy PCI ROM for this device\r | |
411 | @param RomSize Size of ROM Image\r | |
412 | @param Flags Indicates if ROM found and if PC-AT.\r | |
878ddf1f | 413 | \r |
0647c9ad LG |
414 | @retval EFI_SUCCESS Legacy Option ROM availible for this device\r |
415 | @retval EFI_UNSUPPORTED Legacy Option ROM not supported.\r | |
878ddf1f | 416 | \r |
417 | **/\r | |
418 | )\r | |
419 | ;\r | |
420 | \r | |
421 | /**\r | |
422 | Load a legacy PC-AT OPROM on the PciHandle device. Return information\r | |
423 | about how many disks were added by the OPROM and the shadow address and\r | |
424 | size. DiskStart & DiskEnd are INT 13h drive letters. Thus 0x80 is C:\r | |
425 | \r | |
0647c9ad LG |
426 | @param This Protocol instance pointer.\r |
427 | @param PciHandle The PCI PC-AT OPROM from this devices ROM BAR will be loaded.\r | |
428 | This value is NULL if RomImage is non-NULL. This is the normal\r | |
429 | case.\r | |
430 | @param RomImage A PCI PC-AT ROM image. This argument is non-NULL if there is\r | |
431 | no hardware associated with the ROM and thus no PciHandle,\r | |
432 | otherwise is must be NULL.\r | |
433 | Example is PXE base code.\r | |
434 | @param Flags Return Status if ROM was found and if was Legacy OPROM.\r | |
435 | @param DiskStart Disk number of first device hooked by the ROM. If DiskStart\r | |
436 | is the same as DiskEnd no disked were hooked.\r | |
437 | @param DiskEnd Disk number of the last device hooked by the ROM.\r | |
438 | @param RomShadowAddress Shadow address of PC-AT ROM\r | |
439 | @param RomShadowSize Size of RomShadowAddress in bytes\r | |
440 | \r | |
441 | @retval EFI_SUCCESS Thunk completed, see Regs for status.\r | |
442 | @retval EFI_INVALID_PARAMETER PciHandle not found\r | |
878ddf1f | 443 | \r |
444 | **/\r | |
445 | typedef\r | |
446 | EFI_STATUS\r | |
447 | (EFIAPI *EFI_LEGACY_BIOS_INSTALL_ROM) (\r | |
448 | IN EFI_LEGACY_BIOS_PROTOCOL *This,\r | |
449 | IN EFI_HANDLE PciHandle,\r | |
450 | IN VOID **RomImage,\r | |
451 | OUT UINTN *Flags,\r | |
452 | OUT UINT8 *DiskStart, OPTIONAL\r | |
453 | OUT UINT8 *DiskEnd, OPTIONAL\r | |
454 | OUT VOID **RomShadowAddress, OPTIONAL\r | |
455 | OUT UINT32 *ShadowedRomSize OPTIONAL\r | |
456 | )\r | |
457 | ;\r | |
458 | \r | |
459 | /**\r | |
460 | Attempt to legacy boot the BootOption. If the EFI contexted has been \r | |
461 | compromised this function will not return.\r | |
462 | \r | |
0647c9ad LG |
463 | @param This Protocol instance pointer.\r |
464 | @param BootOption EFI Device Path from BootXXXX variable.\r | |
465 | @param LoadOptionSize Size of LoadOption in size.\r | |
466 | @param LoadOption LoadOption from BootXXXX variable\r | |
878ddf1f | 467 | \r |
0647c9ad | 468 | @retval EFI_SUCCESS Removable media not present\r |
878ddf1f | 469 | \r |
470 | **/\r | |
471 | /**\r | |
472 | Update BDA with current Scroll, Num & Cap lock LEDS\r | |
473 | \r | |
0647c9ad LG |
474 | @param This Protocol instance pointer.\r |
475 | @param Leds Status of current Scroll, Num & Cap lock LEDS\r | |
476 | Bit 0 is Scroll Lock 0 = Not locked\r | |
477 | Bit 1 is Num Lock\r | |
478 | Bit 2 is Caps Lock\r | |
878ddf1f | 479 | \r |
0647c9ad | 480 | @retval EFI_SUCCESS Removable media not present\r |
878ddf1f | 481 | \r |
482 | **/\r | |
483 | typedef\r | |
484 | EFI_STATUS\r | |
485 | (EFIAPI *EFI_LEGACY_BIOS_BOOT) (\r | |
486 | IN EFI_LEGACY_BIOS_PROTOCOL *This,\r | |
487 | IN BBS_BBS_DEVICE_PATH *BootOption,\r | |
488 | IN UINT32 LoadOptionsSize,\r | |
489 | IN VOID *LoadOptions\r | |
490 | )\r | |
491 | ;\r | |
492 | typedef\r | |
493 | EFI_STATUS\r | |
494 | (EFIAPI *EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS) (\r | |
495 | IN EFI_LEGACY_BIOS_PROTOCOL *This,\r | |
496 | IN UINT8 Leds\r | |
497 | )\r | |
498 | ;\r | |
499 | \r | |
500 | /**\r | |
501 | Retrieve legacy BBS info and assign boot priority.\r | |
502 | \r | |
0647c9ad LG |
503 | @param This Protocol instance pointer.\r |
504 | @param HddCount Number of HDD_INFO structures\r | |
505 | @param HddInfo Onboard IDE controller information\r | |
506 | @param BbsCount Number of BBS_TABLE structures\r | |
507 | @param BbsTable List BBS entries\r | |
878ddf1f | 508 | \r |
0647c9ad | 509 | @retval EFI_SUCCESS Tables returned\r |
878ddf1f | 510 | \r |
511 | **/\r | |
512 | typedef\r | |
513 | EFI_STATUS\r | |
514 | (EFIAPI *EFI_LEGACY_BIOS_GET_BBS_INFO) (\r | |
515 | IN EFI_LEGACY_BIOS_PROTOCOL *This,\r | |
516 | OUT UINT16 *HddCount,\r | |
517 | OUT HDD_INFO **HddInfo,\r | |
518 | OUT UINT16 *BbsCount,\r | |
e4a246f1 | 519 | IN OUT BBS_TABLE **BbsTable\r |
878ddf1f | 520 | )\r |
521 | ;\r | |
522 | \r | |
523 | /**\r | |
524 | Assign drive number to legacy HDD drives prior to booting an EFI\r | |
525 | aware OS so the OS can access drives without an EFI driver.\r | |
526 | \r | |
0647c9ad LG |
527 | @param This Protocol instance pointer.\r |
528 | @param BbsCount Number of BBS_TABLE structures\r | |
529 | @param BbsTable List BBS entries\r | |
878ddf1f | 530 | \r |
0647c9ad | 531 | @retval EFI_SUCCESS Drive numbers assigned\r |
878ddf1f | 532 | \r |
533 | **/\r | |
534 | typedef\r | |
535 | EFI_STATUS\r | |
536 | (EFIAPI *EFI_LEGACY_BIOS_PREPARE_TO_BOOT_EFI) (\r | |
537 | IN EFI_LEGACY_BIOS_PROTOCOL *This,\r | |
538 | OUT UINT16 *BbsCount,\r | |
e4a246f1 | 539 | OUT BBS_TABLE **BbsTable\r |
878ddf1f | 540 | )\r |
541 | ;\r | |
542 | \r | |
543 | /**\r | |
544 | To boot from an unconventional device like parties and/or execute\r | |
545 | HDD diagnostics.\r | |
546 | \r | |
0647c9ad LG |
547 | @param This Protocol instance pointer.\r |
548 | @param Attributes How to interpret the other input parameters\r | |
549 | @param BbsEntry The 0-based index into the BbsTable for the parent\r | |
550 | device.\r | |
551 | @param BeerData Pointer to the 128 bytes of ram BEER data.\r | |
552 | @param ServiceAreaData Pointer to the 64 bytes of raw Service Area data. The\r | |
553 | caller must provide a pointer to the specific Service\r | |
554 | Area and not the start all Service Areas.\r | |
878ddf1f | 555 | \r |
556 | EFI_INVALID_PARAMETER if error. Does NOT return if no error.\r | |
557 | \r | |
558 | **/\r | |
559 | typedef\r | |
560 | EFI_STATUS\r | |
561 | (EFIAPI *EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE) (\r | |
562 | IN EFI_LEGACY_BIOS_PROTOCOL *This,\r | |
563 | IN UDC_ATTRIBUTES Attributes,\r | |
564 | IN UINTN BbsEntry,\r | |
565 | IN VOID *BeerData,\r | |
566 | IN VOID *ServiceAreaData\r | |
567 | )\r | |
568 | ;\r | |
569 | \r | |
570 | /**\r | |
571 | Shadow all legacy16 OPROMs that haven't been shadowed.\r | |
572 | Warning: Use this with caution. This routine disconnects all EFI\r | |
573 | drivers. If used externally then caller must re-connect EFI\r | |
574 | drivers.\r | |
575 | \r | |
0647c9ad | 576 | @retval EFI_SUCCESS OPROMs shadowed\r |
878ddf1f | 577 | \r |
578 | **/\r | |
579 | typedef\r | |
580 | EFI_STATUS\r | |
581 | (EFIAPI *EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS) (\r | |
582 | IN EFI_LEGACY_BIOS_PROTOCOL *This\r | |
583 | )\r | |
584 | ;\r | |
585 | \r | |
586 | /**\r | |
587 | Get a region from the LegacyBios for S3 usage.\r | |
588 | \r | |
0647c9ad LG |
589 | @param This Protocol instance pointer.\r |
590 | @param LegacyMemorySize Size of required region\r | |
591 | @param Region Region to use.\r | |
592 | 00 = Either 0xE0000 or 0xF0000 block\r | |
593 | Bit0 = 1 0xF0000 block\r | |
594 | Bit1 = 1 0xE0000 block\r | |
595 | @param Alignment Address alignment. Bit mapped. First non-zero\r | |
596 | bit from right is alignment.\r | |
597 | @param LegacyMemoryAddress Region Assigned\r | |
878ddf1f | 598 | \r |
0647c9ad LG |
599 | @retval EFI_SUCCESS Region assigned\r |
600 | @retval Other Region not assigned\r | |
878ddf1f | 601 | \r |
602 | **/\r | |
603 | typedef\r | |
604 | EFI_STATUS\r | |
605 | (EFIAPI *EFI_LEGACY_BIOS_GET_LEGACY_REGION) (\r | |
606 | IN EFI_LEGACY_BIOS_PROTOCOL *This,\r | |
607 | IN UINTN LegacyMemorySize,\r | |
608 | IN UINTN Region,\r | |
609 | IN UINTN Alignment,\r | |
610 | OUT VOID **LegacyMemoryAddress\r | |
611 | )\r | |
612 | ;\r | |
613 | \r | |
614 | /**\r | |
615 | Get a region from the LegacyBios for Tiano usage. Can only be invoked once.\r | |
616 | \r | |
0647c9ad LG |
617 | @param This Protocol instance pointer.\r |
618 | @param LegacyMemorySize Size of data to copy\r | |
619 | @param LegacyMemoryAddress Legacy Region destination address\r | |
620 | Note: must be in region assigned by\r | |
621 | LegacyBiosGetLegacyRegion\r | |
622 | @param LegacyMemorySourceAddress \r | |
623 | Source of data\r | |
878ddf1f | 624 | \r |
0647c9ad LG |
625 | @retval EFI_SUCCESS Region assigned\r |
626 | @retval EFI_ACCESS_DENIED Destination outside assigned region\r | |
878ddf1f | 627 | \r |
628 | **/\r | |
629 | typedef\r | |
630 | EFI_STATUS\r | |
631 | (EFIAPI *EFI_LEGACY_BIOS_COPY_LEGACY_REGION) (\r | |
632 | IN EFI_LEGACY_BIOS_PROTOCOL *This,\r | |
633 | IN UINTN LegacyMemorySize,\r | |
634 | IN VOID *LegacyMemoryAddress,\r | |
635 | IN VOID *LegacyMemorySourceAddress\r | |
636 | )\r | |
637 | ;\r | |
638 | \r | |
639 | /**\r | |
640 | @par Protocol Description:\r | |
641 | Abstracts the traditional BIOS from the rest of EFI. The LegacyBoot() \r | |
642 | member function allows the BDS to support booting a traditional OS. \r | |
643 | EFI thunks drivers that make EFI bindings for BIOS INT services use \r | |
644 | all the other member functions.\r | |
645 | \r | |
646 | @param Int86\r | |
647 | Performs traditional software INT. See the Int86() function description.\r | |
648 | \r | |
649 | @param FarCall86\r | |
650 | Performs a far call into Compatibility16 or traditional OpROM code. \r | |
651 | \r | |
652 | @param CheckPciRom\r | |
653 | Checks if a traditional OpROM exists for this device.\r | |
654 | \r | |
655 | @param InstallPciRom\r | |
656 | Loads a traditional OpROM in traditional OpROM address space.\r | |
657 | \r | |
658 | @param LegacyBoot\r | |
659 | Boots a traditional OS.\r | |
660 | \r | |
661 | @param UpdateKeyboardLedStatus\r | |
662 | Updates BDA to reflect the current EFI keyboard LED status.\r | |
663 | \r | |
664 | @param GetBbsInfo\r | |
665 | Allows an external agent, such as BIOS Setup, to get the BBS data. \r | |
666 | \r | |
667 | @param ShadowAllLegacyOproms\r | |
668 | Causes all legacy OpROMs to be shadowed.\r | |
669 | \r | |
670 | @param PrepareToBootEfi\r | |
671 | Performs all actions prior to boot. Used when booting an EFI-aware OS \r | |
672 | rather than a legacy OS. \r | |
673 | \r | |
674 | @param GetLegacyRegion\r | |
675 | Allows EFI to reserve an area in the 0xE0000 or 0xF0000 block.\r | |
676 | \r | |
677 | @param CopyLegacyRegion\r | |
678 | Allows EFI to copy data to the area specified by GetLegacyRegion. \r | |
679 | \r | |
680 | @param BootUnconventionalDevice\r | |
681 | Allows the user to boot off an unconventional device such as a PARTIES partition.\r | |
682 | \r | |
683 | **/\r | |
684 | struct _EFI_LEGACY_BIOS_PROTOCOL {\r | |
685 | EFI_LEGACY_BIOS_INT86 Int86;\r | |
686 | EFI_LEGACY_BIOS_FARCALL86 FarCall86;\r | |
687 | EFI_LEGACY_BIOS_CHECK_ROM CheckPciRom;\r | |
688 | EFI_LEGACY_BIOS_INSTALL_ROM InstallPciRom;\r | |
689 | EFI_LEGACY_BIOS_BOOT LegacyBoot;\r | |
690 | EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS UpdateKeyboardLedStatus;\r | |
691 | EFI_LEGACY_BIOS_GET_BBS_INFO GetBbsInfo;\r | |
878ddf1f | 692 | EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS ShadowAllLegacyOproms;\r |
e4a246f1 | 693 | EFI_LEGACY_BIOS_PREPARE_TO_BOOT_EFI PrepareToBootEfi;\r |
878ddf1f | 694 | EFI_LEGACY_BIOS_GET_LEGACY_REGION GetLegacyRegion;\r |
695 | EFI_LEGACY_BIOS_COPY_LEGACY_REGION CopyLegacyRegion;\r | |
696 | EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE BootUnconventionalDevice;\r | |
697 | };\r | |
698 | \r | |
699 | extern EFI_GUID gEfiLegacyBiosProtocolGuid;\r | |
700 | \r | |
701 | #endif\r |