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