]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2004 - 2006, Intel Corporation \r | |
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 | |
211 | //\r | |
212 | // define maximum number of HDD system supports\r | |
213 | //\r | |
214 | #define MAX_HDD_ENTRIES 0x30\r | |
215 | \r | |
216 | typedef struct {\r | |
217 | UINT16 Raw[256];\r | |
218 | } ATAPI_IDENTIFY;\r | |
219 | \r | |
220 | //\r | |
221 | // HDD_INFO status\r | |
222 | //\r | |
223 | #define HDD_PRIMARY 0x01\r | |
224 | #define HDD_SECONDARY 0x02\r | |
225 | #define HDD_MASTER_ATAPI_CDROM 0x04\r | |
226 | #define HDD_SLAVE_ATAPI_CDROM 0x08\r | |
227 | #define HDD_MASTER_IDE 0x20\r | |
228 | #define HDD_SLAVE_IDE 0x40\r | |
229 | #define HDD_MASTER_ATAPI_ZIPDISK 0x10\r | |
230 | #define HDD_SLAVE_ATAPI_ZIPDISK 0x80\r | |
231 | \r | |
232 | typedef struct {\r | |
233 | UINT16 Status;\r | |
234 | UINT32 Bus;\r | |
235 | UINT32 Device;\r | |
236 | UINT32 Function;\r | |
237 | UINT16 CommandBaseAddress;\r | |
238 | UINT16 ControlBaseAddress;\r | |
239 | UINT16 BusMasterAddress;\r | |
240 | UINT8 HddIrq;\r | |
241 | ATAPI_IDENTIFY IdentifyDrive[2];\r | |
242 | } HDD_INFO;\r | |
243 | \r | |
244 | //\r | |
245 | // Parties data structures\r | |
246 | //\r | |
247 | typedef struct {\r | |
248 | UINT8 DirectoryServiceValidity : 1;\r | |
249 | UINT8 RabcaUsedFlag : 1;\r | |
250 | UINT8 ExecuteHddDiagnosticsFlag : 1;\r | |
251 | UINT8 Reserved : 5;\r | |
252 | } UDC_ATTRIBUTES;\r | |
253 | \r | |
254 | typedef struct {\r | |
255 | UDC_ATTRIBUTES Attributes;\r | |
256 | UINT8 DeviceNumber;\r | |
257 | UINT8 BbsTableEntryNumberForParentDevice;\r | |
258 | UINT8 BbsTableEntryNumberForBoot;\r | |
259 | UINT8 BbsTableEntryNumberForHddDiag;\r | |
260 | UINT8 BeerData[128];\r | |
261 | UINT8 ServiceAreaData[64];\r | |
262 | } UD_TABLE;\r | |
263 | \r | |
264 | //\r | |
265 | // define BBS Device Types\r | |
266 | //\r | |
267 | #define BBS_FLOPPY 0x01\r | |
268 | #define BBS_HARDDISK 0x02\r | |
269 | #define BBS_CDROM 0x03\r | |
270 | #define BBS_PCMCIA 0x04\r | |
271 | #define BBS_USB 0x05\r | |
272 | #define BBS_EMBED_NETWORK 0x06\r | |
273 | #define BBS_BEV_DEVICE 0x80\r | |
274 | #define BBS_UNKNOWN 0xff\r | |
275 | \r | |
276 | typedef struct {\r | |
277 | UINT16 OldPosition : 4;\r | |
278 | UINT16 Reserved1 : 4;\r | |
279 | UINT16 Enabled : 1;\r | |
280 | UINT16 Failed : 1;\r | |
281 | UINT16 MediaPresent : 2;\r | |
282 | UINT16 Reserved2 : 4;\r | |
283 | } BBS_STATUS_FLAGS;\r | |
284 | \r | |
285 | #define MAX_BBS_ENTRIES 0x100\r | |
286 | //\r | |
287 | // BBS_IGNORE_ENTRY is placed in the BootPriority field if the entry is to\r | |
288 | // be skipped.\r | |
289 | // BBS_UNPRIORITIZED_ENTRY is placed in the BootPriority field before\r | |
290 | // priority has been assigned but indicates valid entry.\r | |
291 | // BBS_LOWEST_PRIORITY is normally used for removable media with no media\r | |
292 | // inserted. This allows the 16-bit CSM to allocate a drive letter to\r | |
293 | // the device.\r | |
294 | // BBS_DO_NOT_BOOT_FROM is used for devices that the 16-bit CSM is to assign\r | |
295 | // a drive letter to but never boot from.\r | |
296 | //\r | |
297 | // AdditionalIrq??Handler usage is IBV specific. The fields have been added\r | |
298 | // for:\r | |
299 | // 1. Saving non-BBS card info about IRQs taken by card.\r | |
300 | // 2. For BBS compliant cards that hook IRQs in order to have their SETUP\r | |
301 | // executed.\r | |
302 | //\r | |
303 | #define BBS_DO_NOT_BOOT_FROM 0xFFFC\r | |
304 | #define BBS_LOWEST_PRIORITY 0xFFFD\r | |
305 | #define BBS_UNPRIORITIZED_ENTRY 0xFFFE\r | |
306 | #define BBS_IGNORE_ENTRY 0xFFFF\r | |
307 | \r | |
308 | typedef struct {\r | |
309 | UINT16 BootPriority;\r | |
310 | UINT32 Bus;\r | |
311 | UINT32 Device;\r | |
312 | UINT32 Function;\r | |
313 | UINT8 Class;\r | |
314 | UINT8 SubClass;\r | |
315 | UINT16 MfgStringOffset;\r | |
316 | UINT16 MfgStringSegment;\r | |
317 | UINT16 DeviceType;\r | |
318 | BBS_STATUS_FLAGS StatusFlags;\r | |
319 | UINT16 BootHandlerOffset;\r | |
320 | UINT16 BootHandlerSegment;\r | |
321 | UINT16 DescStringOffset;\r | |
322 | UINT16 DescStringSegment;\r | |
323 | UINT32 InitPerReserved;\r | |
324 | UINT32 AdditionalIrq13Handler;\r | |
325 | UINT32 AdditionalIrq18Handler;\r | |
326 | UINT32 AdditionalIrq19Handler;\r | |
327 | UINT32 AdditionalIrq40Handler;\r | |
328 | UINT8 AssignedDriveNumber;\r | |
329 | UINT32 AdditionalIrq41Handler;\r | |
330 | UINT32 AdditionalIrq46Handler;\r | |
331 | UINT32 IBV1;\r | |
332 | UINT32 IBV2;\r | |
333 | } BBS_TABLE;\r | |
334 | \r | |
335 | #pragma pack()\r | |
336 | \r | |
337 | typedef\r | |
338 | BOOLEAN\r | |
339 | (EFIAPI *EFI_LEGACY_BIOS_INT86) (\r | |
340 | IN EFI_LEGACY_BIOS_PROTOCOL * This,\r | |
341 | IN UINT8 BiosInt,\r | |
342 | IN OUT EFI_IA32_REGISTER_SET * Regs\r | |
343 | )\r | |
344 | /*++\r | |
345 | \r | |
346 | Routine Description:\r | |
347 | Thunk to 16-bit real mode and execute a software interrupt with a vector \r | |
348 | of BiosInt. Regs will contain the 16-bit register context on entry and \r | |
349 | exit.\r | |
350 | \r | |
351 | Arguments:\r | |
352 | This - Protocol instance pointer.\r | |
353 | BiosInt - Processor interrupt vector to invoke\r | |
354 | Reg - Register contexted passed into (and returned) from thunk to \r | |
355 | 16-bit mode\r | |
356 | \r | |
357 | Returns:\r | |
358 | FALSE - Thunk completed, and there were no BIOS errors in the target code.\r | |
359 | See Regs for status.\r | |
360 | TRUE - There was a BIOS erro in the target code.\r | |
361 | \r | |
362 | --*/\r | |
363 | ;\r | |
364 | \r | |
365 | typedef\r | |
366 | BOOLEAN\r | |
367 | (EFIAPI *EFI_LEGACY_BIOS_FARCALL86) (\r | |
368 | IN EFI_LEGACY_BIOS_PROTOCOL * This,\r | |
369 | IN UINT16 Segment,\r | |
370 | IN UINT16 Offset,\r | |
371 | IN EFI_IA32_REGISTER_SET * Regs,\r | |
372 | IN VOID *Stack,\r | |
373 | IN UINTN StackSize\r | |
374 | )\r | |
375 | /*++\r | |
376 | \r | |
377 | Routine Description:\r | |
378 | Thunk to 16-bit real mode and call Segment:Offset. Regs will contain the \r | |
379 | 16-bit register context on entry and exit. Arguments can be passed on \r | |
380 | the Stack argument\r | |
381 | \r | |
382 | Arguments:\r | |
383 | This - Protocol instance pointer.\r | |
384 | Segment - Segemnt of 16-bit mode call\r | |
385 | Offset - Offset of 16-bit mdoe call\r | |
386 | Reg - Register contexted passed into (and returned) from thunk to \r | |
387 | 16-bit mode\r | |
388 | Stack - Caller allocated stack used to pass arguments\r | |
389 | StackSize - Size of Stack in bytes\r | |
390 | \r | |
391 | Returns:\r | |
392 | FALSE - Thunk completed, and there were no BIOS errors in the target code.\r | |
393 | See Regs for status.\r | |
394 | TRUE - There was a BIOS erro in the target code.\r | |
395 | \r | |
396 | --*/\r | |
397 | ;\r | |
398 | \r | |
399 | typedef\r | |
400 | EFI_STATUS\r | |
401 | (EFIAPI *EFI_LEGACY_BIOS_CHECK_ROM) (\r | |
402 | IN EFI_LEGACY_BIOS_PROTOCOL * This,\r | |
403 | IN EFI_HANDLE PciHandle,\r | |
404 | OUT VOID **RomImage, OPTIONAL\r | |
405 | OUT UINTN *RomSize, OPTIONAL\r | |
406 | OUT UINTN *Flags\r | |
407 | \r | |
408 | )\r | |
409 | /*++\r | |
410 | \r | |
411 | Routine Description:\r | |
412 | Test to see if a legacy PCI ROM exists for this device. Optionally return\r | |
413 | the Legacy ROM instance for this PCI device.\r | |
414 | \r | |
415 | Arguments:\r | |
416 | This - Protocol instance pointer.\r | |
417 | PciHandle - The PCI PC-AT OPROM from this devices ROM BAR will be loaded\r | |
418 | RomImage - Return the legacy PCI ROM for this device\r | |
419 | RomSize - Size of ROM Image\r | |
420 | Flags - Indicates if ROM found and if PC-AT.\r | |
421 | \r | |
422 | Returns:\r | |
423 | EFI_SUCCESS - Legacy Option ROM availible for this device\r | |
424 | EFI_UNSUPPORTED - Legacy Option ROM not supported.\r | |
425 | \r | |
426 | --*/\r | |
427 | ;\r | |
428 | \r | |
429 | typedef\r | |
430 | EFI_STATUS\r | |
431 | (EFIAPI *EFI_LEGACY_BIOS_INSTALL_ROM) (\r | |
432 | IN EFI_LEGACY_BIOS_PROTOCOL * This,\r | |
433 | IN EFI_HANDLE PciHandle,\r | |
434 | IN VOID **RomImage,\r | |
435 | OUT UINTN *Flags,\r | |
436 | OUT UINT8 *DiskStart, OPTIONAL\r | |
437 | OUT UINT8 *DiskEnd, OPTIONAL\r | |
438 | OUT VOID **RomShadowAddress, OPTIONAL\r | |
439 | OUT UINT32 *ShadowedRomSize OPTIONAL\r | |
440 | )\r | |
441 | /*++\r | |
442 | \r | |
443 | Routine Description:\r | |
444 | Load a legacy PC-AT OPROM on the PciHandle device. Return information\r | |
445 | about how many disks were added by the OPROM and the shadow address and\r | |
446 | size. DiskStart & DiskEnd are INT 13h drive letters. Thus 0x80 is C:\r | |
447 | \r | |
448 | Arguments:\r | |
449 | This - Protocol instance pointer.\r | |
450 | PciHandle - The PCI PC-AT OPROM from this devices ROM BAR will be loaded.\r | |
451 | This value is NULL if RomImage is non-NULL. This is the normal\r | |
452 | case.\r | |
453 | RomImage - A PCI PC-AT ROM image. This argument is non-NULL if there is\r | |
454 | no hardware associated with the ROM and thus no PciHandle,\r | |
455 | otherwise is must be NULL.\r | |
456 | Example is PXE base code.\r | |
457 | Flags - Return Status if ROM was found and if was Legacy OPROM.\r | |
458 | DiskStart - Disk number of first device hooked by the ROM. If DiskStart\r | |
459 | is the same as DiskEnd no disked were hooked.\r | |
460 | DiskEnd - Disk number of the last device hooked by the ROM.\r | |
461 | RomShadowAddress - Shadow address of PC-AT ROM\r | |
462 | RomShadowSize - Size of RomShadowAddress in bytes\r | |
463 | \r | |
464 | Returns:\r | |
465 | EFI_SUCCESS - Thunk completed, see Regs for status.\r | |
466 | EFI_INVALID_PARAMETER - PciHandle not found\r | |
467 | \r | |
468 | --*/\r | |
469 | ;\r | |
470 | \r | |
471 | typedef\r | |
472 | EFI_STATUS\r | |
473 | (EFIAPI *EFI_LEGACY_BIOS_BOOT) (\r | |
474 | IN EFI_LEGACY_BIOS_PROTOCOL * This,\r | |
475 | IN BBS_BBS_DEVICE_PATH * BootOption,\r | |
476 | IN UINT32 LoadOptionsSize,\r | |
477 | IN VOID *LoadOptions\r | |
478 | )\r | |
479 | /*++\r | |
480 | \r | |
481 | Routine Description:\r | |
482 | Attempt to legacy boot the BootOption. If the EFI contexted has been \r | |
483 | compromised this function will not return.\r | |
484 | \r | |
485 | Arguments:\r | |
486 | This - Protocol instance pointer.\r | |
487 | BootOption - EFI Device Path from BootXXXX variable.\r | |
488 | LoadOptionSize - Size of LoadOption in size.\r | |
489 | LoadOption - LoadOption from BootXXXX variable\r | |
490 | \r | |
491 | Returns:\r | |
492 | EFI_SUCCESS - Removable media not present\r | |
493 | \r | |
494 | --*/\r | |
495 | ;\r | |
496 | typedef\r | |
497 | EFI_STATUS\r | |
498 | (EFIAPI *EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS) (\r | |
499 | IN EFI_LEGACY_BIOS_PROTOCOL * This,\r | |
500 | IN UINT8 Leds\r | |
501 | )\r | |
502 | /*++\r | |
503 | \r | |
504 | Routine Description:\r | |
505 | Update BDA with current Scroll, Num & Cap lock LEDS\r | |
506 | \r | |
507 | Arguments:\r | |
508 | This - Protocol instance pointer.\r | |
509 | Leds - Status of current Scroll, Num & Cap lock LEDS\r | |
510 | Bit 0 is Scroll Lock 0 = Not locked\r | |
511 | Bit 1 is Num Lock\r | |
512 | Bit 2 is Caps Lock\r | |
513 | \r | |
514 | Returns:\r | |
515 | EFI_SUCCESS - Removable media not present\r | |
516 | \r | |
517 | --*/\r | |
518 | ;\r | |
519 | \r | |
520 | typedef\r | |
521 | EFI_STATUS\r | |
522 | (EFIAPI *EFI_LEGACY_BIOS_GET_BBS_INFO) (\r | |
523 | IN EFI_LEGACY_BIOS_PROTOCOL * This,\r | |
524 | OUT UINT16 *HddCount,\r | |
525 | OUT HDD_INFO **HddInfo,\r | |
526 | OUT UINT16 *BbsCount,\r | |
527 | IN OUT BBS_TABLE **BbsTable\r | |
528 | )\r | |
529 | /*++\r | |
530 | \r | |
531 | Routine Description:\r | |
532 | Retrieve legacy BBS info and assign boot priority.\r | |
533 | \r | |
534 | Arguments:\r | |
535 | This - Protocol instance pointer.\r | |
536 | HddCount - Number of HDD_INFO structures\r | |
537 | HddInfo - Onboard IDE controller information\r | |
538 | BbsCount - Number of BBS_TABLE structures\r | |
539 | BbsTable - List BBS entries\r | |
540 | \r | |
541 | Returns:\r | |
542 | EFI_SUCCESS - Tables returned\r | |
543 | \r | |
544 | --*/\r | |
545 | ;\r | |
546 | \r | |
547 | typedef\r | |
548 | EFI_STATUS\r | |
549 | (EFIAPI *EFI_LEGACY_BIOS_PREPARE_TO_BOOT_EFI) (\r | |
550 | IN EFI_LEGACY_BIOS_PROTOCOL * This,\r | |
551 | OUT UINT16 *BbsCount,\r | |
552 | OUT BBS_TABLE **BbsTable\r | |
553 | )\r | |
554 | /*++\r | |
555 | \r | |
556 | Routine Description:\r | |
557 | Assign drive number to legacy HDD drives prior to booting an EFI\r | |
558 | aware OS so the OS can access drives without an EFI driver.\r | |
559 | \r | |
560 | Arguments:\r | |
561 | This - Protocol instance pointer.\r | |
562 | BbsCount - Number of BBS_TABLE structures\r | |
563 | BbsTable - List BBS entries\r | |
564 | \r | |
565 | Returns:\r | |
566 | EFI_SUCCESS - Drive numbers assigned\r | |
567 | \r | |
568 | --*/\r | |
569 | ;\r | |
570 | \r | |
571 | typedef\r | |
572 | EFI_STATUS\r | |
573 | (EFIAPI *EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE) (\r | |
574 | IN EFI_LEGACY_BIOS_PROTOCOL * This,\r | |
575 | IN UDC_ATTRIBUTES Attributes,\r | |
576 | IN UINTN BbsEntry,\r | |
577 | IN VOID *BeerData,\r | |
578 | IN VOID *ServiceAreaData\r | |
579 | )\r | |
580 | /*++\r | |
581 | \r | |
582 | Routine Description:\r | |
583 | To boot from an unconventional device like parties and/or execute\r | |
584 | HDD diagnostics.\r | |
585 | \r | |
586 | Arguments:\r | |
587 | This - Protocol instance pointer.\r | |
588 | Attributes - How to interpret the other input parameters\r | |
589 | BbsEntry - The 0-based index into the BbsTable for the parent \r | |
590 | device.\r | |
591 | BeerData - Pointer to the 128 bytes of ram BEER data.\r | |
592 | ServiceAreaData - Pointer to the 64 bytes of raw Service Area data. The\r | |
593 | caller must provide a pointer to the specific Service\r | |
594 | Area and not the start all Service Areas. \r | |
595 | Returns:\r | |
596 | EFI_INVALID_PARAMETER if error. Does NOT return if no error.\r | |
597 | \r | |
598 | --*/\r | |
599 | ;\r | |
600 | \r | |
601 | typedef\r | |
602 | EFI_STATUS\r | |
603 | (EFIAPI *EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS) (\r | |
604 | IN EFI_LEGACY_BIOS_PROTOCOL * This\r | |
605 | )\r | |
606 | /*++\r | |
607 | \r | |
608 | Routine Description:\r | |
609 | Shadow all legacy16 OPROMs that haven't been shadowed.\r | |
610 | Warning: Use this with caution. This routine disconnects all EFI\r | |
611 | drivers. If used externally then caller must re-connect EFI\r | |
612 | drivers.\r | |
613 | Arguments:\r | |
614 | \r | |
615 | Returns:\r | |
616 | EFI_SUCCESS - OPROMs shadowed\r | |
617 | \r | |
618 | --*/\r | |
619 | ;\r | |
620 | \r | |
621 | typedef\r | |
622 | EFI_STATUS\r | |
623 | (EFIAPI *EFI_LEGACY_BIOS_GET_LEGACY_REGION) (\r | |
624 | IN EFI_LEGACY_BIOS_PROTOCOL * This,\r | |
625 | IN UINTN LegacyMemorySize,\r | |
626 | IN UINTN Region,\r | |
627 | IN UINTN Alignment,\r | |
628 | OUT VOID **LegacyMemoryAddress\r | |
629 | )\r | |
630 | /*++\r | |
631 | \r | |
632 | Routine Description:\r | |
633 | Get a region from the LegacyBios for S3 usage.\r | |
634 | \r | |
635 | Arguments:\r | |
636 | This - Protocol instance pointer.\r | |
637 | LegacyMemorySize - Size of required region\r | |
638 | Region - Region to use.\r | |
639 | 00 = Either 0xE0000 or 0xF0000 block\r | |
640 | Bit0 = 1 0xF0000 block\r | |
641 | Bit1 = 1 0xE0000 block\r | |
642 | Alignment - Address alignment. Bit mapped. First non-zero \r | |
643 | bit from right is alignment.\r | |
644 | LegacyMemoryAddress - Region Assigned\r | |
645 | \r | |
646 | Returns: \r | |
647 | \r | |
648 | EFI_SUCCESS - Region assigned\r | |
649 | \r | |
650 | Other - Region not assigned\r | |
651 | \r | |
652 | --*/\r | |
653 | ;\r | |
654 | \r | |
655 | typedef\r | |
656 | EFI_STATUS\r | |
657 | (EFIAPI *EFI_LEGACY_BIOS_COPY_LEGACY_REGION) (\r | |
658 | IN EFI_LEGACY_BIOS_PROTOCOL * This,\r | |
659 | IN UINTN LegacyMemorySize,\r | |
660 | IN VOID *LegacyMemoryAddress,\r | |
661 | IN VOID *LegacyMemorySourceAddress\r | |
662 | )\r | |
663 | /*++\r | |
664 | \r | |
665 | Routine Description:\r | |
666 | Get a region from the LegacyBios for Tiano usage. Can only be invoked once.\r | |
667 | \r | |
668 | Arguments:\r | |
669 | This - Protocol instance pointer.\r | |
670 | LegacyMemorySize - Size of data to copy\r | |
671 | LegacyMemoryAddress - Legacy Region destination address\r | |
672 | Note: must be in region assigned by\r | |
673 | LegacyBiosGetLegacyRegion\r | |
674 | LegacyMemorySourceAddress - Source of data\r | |
675 | \r | |
676 | Returns: \r | |
677 | \r | |
678 | EFI_SUCCESS - Region assigned\r | |
679 | EFI_ACCESS_DENIED - Destination outside assigned region\r | |
680 | \r | |
681 | --*/\r | |
682 | ;\r | |
683 | \r | |
684 | typedef 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 | |
692 | EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS ShadowAllLegacyOproms;\r | |
693 | EFI_LEGACY_BIOS_PREPARE_TO_BOOT_EFI PrepareToBootEfi;\r | |
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 | } EFI_LEGACY_BIOS_PROTOCOL;\r | |
698 | \r | |
699 | extern EFI_GUID gEfiLegacyBiosProtocolGuid;\r | |
700 | \r | |
701 | #endif\r |