- Implement BmpFwGetApplicationDirectoryPath and most of BmFwInitializeBootDirectoryPath.
[reactos.git] / reactos / boot / environ / include / bl.h
1 /*
2 * COPYRIGHT: See COPYING.ARM in the top level directory
3 * PROJECT: ReactOS UEFI Boot Library
4 * FILE: boot/environ/include/bl.h
5 * PURPOSE: Main Boot Library Header
6 * PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8
9 #ifndef _BL_H
10 #define _BL_H
11
12 /* INCLUDES ******************************************************************/
13
14 /* C Headers */
15 #include <stdlib.h>
16 #include <stdio.h>
17 #include <wchar.h>
18
19 /* NT Base Headers */
20 #include <ntifs.h>
21
22 /* NDK Headers */
23 #include <ntndk.h>
24
25 /* UEFI Headers */
26 #include <Uefi.h>
27 #include <DevicePath.h>
28 #include <LoadedImage.h>
29 #include <GraphicsOutput.h>
30 #include <UgaDraw.h>
31 #include <BlockIo.h>
32
33 /* DEFINES *******************************************************************/
34
35 #define BL_APPLICATION_FLAG_CONVERTED_FROM_EFI 0x01
36
37 #define BL_APP_ENTRY_SIGNATURE "BTAPENT"
38
39 #define BOOT_APPLICATION_SIGNATURE_1 'TOOB'
40 #define BOOT_APPLICATION_SIGNATURE_2 ' PPA'
41
42 #define BOOT_MEMORY_TRANSLATION_TYPE_PHYSICAL 0
43 #define BOOT_MEMORY_TRANSLATION_TYPE_VIRTUAL 1
44
45 #define BOOT_APPLICATION_VERSION 2
46 #define BL_MEMORY_DATA_VERSION 1
47 #define BL_RETURN_ARGUMENTS_VERSION 1
48 #define BL_FIRMWARE_DESCRIPTOR_VERSION 2
49
50 #define BL_APPLICATION_ENTRY_FLAG_NO_GUID 0x01
51 #define BL_APPLICATION_ENTRY_REBOOT_ON_ERROR 0x20
52
53 #define BL_CONTEXT_PAGING_ON 1
54 #define BL_CONTEXT_INTERRUPTS_ON 2
55
56 #define BL_MM_FLAG_USE_FIRMWARE_FOR_MEMORY_MAP_BUFFERS 0x01
57 #define BL_MM_FLAG_REQUEST_COALESCING 0x02
58
59 #define BL_MM_ADD_DESCRIPTOR_COALESCE_FLAG 0x01
60 #define BL_MM_ADD_DESCRIPTOR_TRUNCATE_FLAG 0x02
61 #define BL_MM_ADD_DESCRIPTOR_NEVER_COALESCE_FLAG 0x10
62 #define BL_MM_ADD_DESCRIPTOR_NEVER_TRUNCATE_FLAG 0x20
63 #define BL_MM_ADD_DESCRIPTOR_UPDATE_LIST_POINTER_FLAG 0x2000
64
65 #define BL_MM_REQUEST_DEFAULT_TYPE 1
66 #define BL_MM_REQUEST_TOP_DOWN_TYPE 2
67
68 #define BL_MM_REMOVE_VIRTUAL_REGION_FLAG 0x80000000
69
70 #define BL_LIBRARY_FLAG_NO_DISPLAY 0x01
71 #define BL_LIBRARY_FLAG_REINITIALIZE 0x02
72 #define BL_LIBRARY_FLAG_REINITIALIZE_ALL 0x04
73 #define BL_LIBRARY_FLAG_ZERO_HEAP_ALLOCATIONS_ON_FREE 0x10
74 #define BL_LIBRARY_FLAG_INITIALIZATION_COMPLETED 0x20
75 #define BL_LIBRARY_FLAG_NO_GRAPHICS_CONSOLE 0x800
76
77 #define BL_DISPLAY_GRAPHICS_FORCED_VIDEO_MODE_FLAG 0x01
78 #define BL_DISPLAY_GRAPHICS_FORCED_HIGH_RES_MODE_FLAG 0x02
79
80 #define BL_HT_VALUE_IS_INLINE 0x01
81
82 #define BL_FS_REGISTER_AT_HEAD_FLAG 1
83
84 #define BL_BLOCK_DEVICE_REMOVABLE_FLAG 0x01
85
86 #define BL_MEMORY_CLASS_SHIFT 28
87
88 /* ENUMERATIONS **************************************************************/
89
90 typedef enum _BL_COLOR
91 {
92 Black,
93 Blue,
94 Green,
95 Cyan,
96 Red,
97 Magenta,
98 Brown,
99 LtGray,
100 Gray,
101 LtBlue,
102 LtGreen,
103 LtCyan,
104 LtRed,
105 LtMagenta,
106 Yellow,
107 White
108 } BL_COLOR, *PBL_COLOR;
109
110 typedef enum _BL_MEMORY_DESCRIPTOR_TYPE
111 {
112 BlMdPhysical,
113 BlMdVirtual,
114 } BL_MEMORY_DESCRIPTOR_TYPE;
115
116 typedef enum _BL_TRANSLATION_TYPE
117 {
118 BlNone,
119 BlVirtual,
120 BlPae,
121 BlMax
122 } BL_TRANSLATION_TYPE;
123
124 typedef enum _BL_ARCH_MODE
125 {
126 BlProtectedMode,
127 BlRealMode
128 } BL_ARCH_MODE;
129
130 //
131 // Boot Device Types
132 //
133 typedef enum _BL_DEVICE_TYPE
134 {
135 DiskDevice = 0,
136 LegacyPartitionDevice = 2,
137 SerialDevice = 3,
138 UdpDevice = 4,
139 BootDevice = 5,
140 PartitionDevice = 6,
141 LocateDevice = 8,
142 } BL_DEVICE_TYPE;
143
144 //
145 // Local Device Types
146 //
147 typedef enum _BL_LOCAL_DEVICE_TYPE
148 {
149 LocalDevice = 0,
150 FloppyDevice = 1,
151 CdRomDevice = 2,
152 RamDiskDevice = 3,
153 FileDevice = 5,
154 VirtualDiskDevice = 6
155 } BL_LOCAL_DEVICE_TYPE;
156
157 //
158 // Partition types
159 //
160 typedef enum _BL_PARTITION_TYPE
161 {
162 GptPartition,
163 MbrPartition,
164 RawPartition,
165 } BL_PARTITION_TYPE;
166
167 //
168 // File Path Types
169 //
170 typedef enum _BL_PATH_TYPE
171 {
172 EfiPath = 4
173 } BL_PATH_TYPE;
174
175 //
176 // Classes of Memory
177 //
178 typedef enum _BL_MEMORY_CLASS
179 {
180 BlLoaderClass = 0xD,
181 BlApplicationClass,
182 BlSystemClass
183 } BL_MEMORY_CLASS;
184
185 //
186 // Types of Memory
187 //
188 typedef enum _BL_MEMORY_TYPE
189 {
190 //
191 // Loader Memory
192 //
193 BlLoaderMemory = 0xD0000002,
194 BlLoaderDeviceMemory = 0xD0000004,
195 BlLoaderHeap = 0xD0000005,
196 BlLoaderPageDirectory = 0xD0000006,
197 BlLoaderReferencePage = 0xD0000007,
198 BlLoaderRamDisk = 0xD0000008,
199 BlLoaderData = 0xD000000A,
200 BlLoaderBlockMemory = 0xD000000C,
201 BlLoaderSelfMap = 0xD000000F,
202
203 //
204 // Application Memory
205 //
206 BlApplicationData = 0xE0000004,
207
208 //
209 // System Memory
210 //
211 BlConventionalMemory = 0xF0000001,
212 BlUnusableMemory = 0xF0000002,
213 BlReservedMemory = 0xF0000003,
214 BlEfiBootMemory = 0xF0000004,
215 BlEfiRuntimeMemory = 0xF0000006,
216 BlAcpiReclaimMemory = 0xF0000008,
217 BlAcpiNvsMemory = 0xF0000009,
218 BlDeviceIoMemory = 0xF000000A,
219 BlDevicePortMemory = 0xF000000B,
220 BlPalMemory = 0xF000000C,
221 } BL_MEMORY_TYPE;
222
223 typedef enum _BL_MEMORY_ATTR
224 {
225 //
226 // Memory Caching Attributes
227 //
228 BlMemoryUncached = 0x00000001,
229 BlMemoryWriteCombined = 0x00000002,
230 BlMemoryWriteThrough = 0x00000004,
231 BlMemoryWriteBack = 0x00000008,
232 BlMemoryUncachedExported = 0x00000010,
233 BlMemoryValidCacheAttributes = BlMemoryUncached | BlMemoryWriteCombined | BlMemoryWriteThrough | BlMemoryWriteBack | BlMemoryUncachedExported,
234 BlMemoryValidCacheAttributeMask = 0x000000FF,
235
236 //
237 // Memory Protection Attributes
238 //
239 BlMemoryWriteProtected = 0x00000100,
240 BlMemoryReadProtected = 0x00000200,
241 BlMemoryExecuteProtected = 0x00000400,
242 BlMemoryValidProtectionAttributes = BlMemoryWriteProtected | BlMemoryReadProtected | BlMemoryExecuteProtected,
243 BlMemoryValidProtectionAttributeMask = 0x0000FF00,
244
245 //
246 // Memory Allocation Attributes
247 //
248 BlMemoryNonFixed = 0x00020000,
249 BlMemoryFixed = 0x00040000,
250 BlMemoryValidAllocationAttributes = BlMemoryNonFixed | BlMemoryFixed,
251 BlMemoryValidAllocationAttributeMask = 0x00FF0000,
252
253 //
254 // Memory Type Attributes
255 //
256 BlMemoryRuntime = 0x01000000,
257 BlMemoryCoalesced = 0x02000000,
258 BlMemoryUpdate = 0x04000000,
259 BlMemoryNonFirmware = 0x08000000,
260 BlMemorySpecial = 0x20000000,
261 BlMemoryFirmware = 0x80000000,
262 BlMemoryValidTypeAttributes = BlMemoryRuntime | BlMemoryCoalesced | BlMemoryUpdate | BlMemoryNonFirmware | BlMemorySpecial | BlMemoryFirmware,
263 BlMemoryValidTypeAttributeMask = 0xFF000000,
264 } BL_MEMORY_ATTR;
265
266 /* CALLBACKS *****************************************************************/
267
268 typedef
269 NTSTATUS
270 (*PBL_FS_INIT_CALLBACK) (
271 VOID
272 );
273
274 typedef
275 NTSTATUS
276 (*PBL_FS_DESTROY_CALLBACK) (
277 VOID
278 );
279
280 typedef
281 NTSTATUS
282 (*PBL_FS_MOUNT_CALLBACK) (
283 VOID
284 );
285
286 typedef
287 NTSTATUS
288 (*PBL_FS_PURGE_CALLBACK) (
289 VOID
290 );
291
292 typedef
293 NTSTATUS
294 (*PBL_FILE_DESTROY_CALLBACK) (
295 _In_ PVOID Entry
296 );
297
298 struct _BL_TEXT_CONSOLE;
299 struct _BL_DISPLAY_STATE;
300 typedef
301 NTSTATUS
302 (*PCONSOLE_DESTRUCT) (
303 _In_ struct _BL_TEXT_CONSOLE* Console
304 );
305
306 typedef
307 NTSTATUS
308 (*PCONSOLE_REINITIALIZE) (
309 _In_ struct _BL_TEXT_CONSOLE* Console
310 );
311
312 typedef
313 NTSTATUS
314 (*PCONSOLE_GET_TEXT_STATE) (
315 _In_ struct _BL_TEXT_CONSOLE* Console,
316 _Out_ struct _BL_DISPLAY_STATE* TextState
317 );
318
319 typedef
320 NTSTATUS
321 (*PCONSOLE_SET_TEXT_STATE) (
322 _In_ struct _BL_TEXT_CONSOLE* Console,
323 _In_ ULONG Flags,
324 _In_ struct _BL_DISPLAY_STATE* TextState
325 );
326
327 typedef
328 NTSTATUS
329 (*PCONSOLE_GET_TEXT_RESOLUTION) (
330 _In_ struct _BL_TEXT_CONSOLE* Console,
331 _Out_ PULONG TextResolution
332 );
333
334 typedef
335 NTSTATUS
336 (*PCONSOLE_SET_TEXT_RESOLUTION) (
337 _In_ struct _BL_TEXT_CONSOLE* Console,
338 _In_ ULONG NewTextResolution,
339 _Out_ PULONG OldTextResolution
340 );
341
342 typedef
343 NTSTATUS
344 (*PCONSOLE_CLEAR_TEXT) (
345 _In_ struct _BL_TEXT_CONSOLE* Console,
346 _In_ ULONG Attribute
347 );
348
349 typedef
350 NTSTATUS
351 (*PCONSOLE_WRITE_TEXT) (
352 _In_ struct _BL_TEXT_CONSOLE* Console,
353 _In_ PCHAR Text,
354 _In_ ULONG Attribute
355 );
356
357 typedef
358 BOOLEAN
359 (*PBL_TBL_LOOKUP_ROUTINE) (
360 _In_ PVOID Entry,
361 _In_ PVOID Argument1,
362 _In_ PVOID Argument2,
363 _In_ PVOID Argument3,
364 _In_ PVOID Argument4
365 );
366
367 typedef
368 NTSTATUS
369 (*PBL_TBL_MAP_ROUTINE) (
370 _In_ PVOID Entry,
371 _In_ ULONG EntryIndex
372 );
373
374 typedef
375 NTSTATUS
376 (*PBL_TBL_SET_ROUTINE) (
377 _In_ PVOID Entry
378 );
379
380 typedef
381 NTSTATUS
382 (*PBL_IO_DESTROY_ROUTINE) (
383 VOID
384 );
385
386 struct _BL_HASH_ENTRY;
387 typedef
388 BOOLEAN
389 (*PBL_HASH_TABLE_COMPARE_FUNCTION) (
390 _In_ struct _BL_HASH_ENTRY* Entry1,
391 _In_ struct _BL_HASH_ENTRY* Entry2
392 );
393
394 typedef
395 ULONG
396 (*PBL_HASH_TABLE_HASH_FUNCTION) (
397 _In_ struct _BL_HASH_ENTRY* Entry,
398 _In_ ULONG TableSize
399 );
400
401 /* DATA STRUCTURES ***********************************************************/
402
403 typedef struct _BL_LIBRARY_PARAMETERS
404 {
405 ULONG LibraryFlags;
406 ULONG TranslationType;
407 ULONG MinimumAllocationCount;
408 ULONG MinimumHeapSize;
409 ULONG HeapAllocationAttributes;
410 PWCHAR ApplicationBaseDirectory;
411 ULONG DescriptorCount;
412 PWCHAR FontBaseDirectory;
413 } BL_LIBRARY_PARAMETERS, *PBL_LIBRARY_PARAMETERS;
414
415 /* This should eventually go into a more public header */
416 typedef struct _BOOT_APPLICATION_PARAMETER_BLOCK
417 {
418 /* This header tells the library what image we're dealing with */
419 ULONG Signature[2];
420 ULONG Version;
421 ULONG Size;
422 ULONG ImageType;
423 ULONG MemoryTranslationType;
424
425 /* Where is the image located */
426 ULONGLONG ImageBase;
427 ULONG ImageSize;
428
429 /* Offset to BL_MEMORY_DATA */
430 ULONG MemoryDataOffset;
431
432 /* Offset to BL_APPLICATION_ENTRY */
433 ULONG AppEntryOffset;
434
435 /* Offset to BL_DEVICE_DESCRPIPTOR */
436 ULONG BootDeviceOffset;
437
438 /* Offset to BL_FIRMWARE_PARAMETERS */
439 ULONG FirmwareParametersOffset;
440
441 /* Offset to BL_RETURN_ARGUMENTS */
442 ULONG ReturnArgumentsOffset;
443 } BOOT_APPLICATION_PARAMETER_BLOCK, *PBOOT_APPLICATION_PARAMETER_BLOCK;
444
445 typedef struct _BL_MEMORY_DATA
446 {
447 ULONG Version;
448 ULONG MdListOffset;
449 ULONG DescriptorCount;
450 ULONG DescriptorSize;
451 ULONG DescriptorOffset;
452 } BL_MEMORY_DATA, *PBL_MEMORY_DATA;
453
454 typedef struct _BL_FIRMWARE_DESCRIPTOR
455 {
456 ULONG Version;
457 ULONG Unknown;
458 EFI_HANDLE ImageHandle;
459 EFI_SYSTEM_TABLE *SystemTable;
460 } BL_FIRMWARE_DESCRIPTOR, *PBL_FIRMWARE_DESCRIPTOR;
461
462 typedef struct _BL_RETURN_ARGUMENTS
463 {
464 ULONG Version;
465 NTSTATUS Status;
466 ULONG ReturnArgumentData[5];
467 } BL_RETURN_ARGUMENTS, *PBL_RETURN_ARGUMENTS;
468
469 typedef struct _BL_MEMORY_DESCRIPTOR
470 {
471 LIST_ENTRY ListEntry;
472 union
473 {
474 struct
475 {
476 ULONGLONG BasePage;
477 ULONGLONG VirtualPage;
478 };
479 struct
480 {
481 ULONGLONG BaseAddress;
482 ULONGLONG VirtualAddress;
483 };
484 };
485 ULONGLONG PageCount;
486 ULONG Flags;
487 BL_MEMORY_TYPE Type;
488 } BL_MEMORY_DESCRIPTOR, *PBL_MEMORY_DESCRIPTOR;
489
490 typedef struct _BL_BCD_OPTION
491 {
492 ULONG Type;
493 ULONG DataOffset;
494 ULONG DataSize;
495 ULONG ListOffset;
496 ULONG NextEntryOffset;
497 ULONG Empty;
498 } BL_BCD_OPTION, *PBL_BCD_OPTION;
499
500 typedef struct _BL_APPLICATION_ENTRY
501 {
502 CHAR Signature[8];
503 ULONG Flags;
504 GUID Guid;
505 ULONG Unknown[4];
506 BL_BCD_OPTION BcdData;
507 } BL_APPLICATION_ENTRY, *PBL_APPLICATION_ENTRY;
508
509 typedef struct _BL_LOADED_APPLICATION_ENTRY
510 {
511 ULONG Flags;
512 GUID Guid;
513 PBL_BCD_OPTION BcdData;
514 } BL_LOADED_APPLICATION_ENTRY, *PBL_LOADED_APPLICATION_ENTRY;
515
516 typedef struct _BL_HARDDISK_DEVICE
517 {
518 ULONG PartitionType;
519 union
520 {
521 struct
522 {
523 ULONG PartitionSignature;
524 } Mbr;
525
526 struct
527 {
528 GUID PartitionSignature;
529 } Gpt;
530
531 struct
532 {
533 ULONG DiskNumber;
534 } Raw;
535 };
536 } BL_HARDDISK_DEVICE;
537
538 typedef struct _BL_LOCAL_DEVICE
539 {
540 ULONG Type;
541 union
542 {
543 struct
544 {
545 ULONG DriveNumber;
546 } FloppyDisk;
547
548 BL_HARDDISK_DEVICE HardDisk;
549
550 struct
551 {
552 PHYSICAL_ADDRESS ImageBase;
553 LARGE_INTEGER ImageSize;
554 ULONG ImageOffset;
555 } RamDisk;
556 };
557 } BL_LOCAL_DEVICE;
558
559 typedef struct _BL_DEVICE_DESCRIPTOR
560 {
561 ULONG Size;
562 ULONG Flags;
563 DEVICE_TYPE DeviceType;
564 ULONG Unknown;
565 union
566 {
567 BL_LOCAL_DEVICE Local;
568
569 struct
570 {
571 ULONG Unknown;
572 } Remote;
573
574 struct
575 {
576 union
577 {
578 ULONG PartitionNumber;
579 } Mbr;
580
581 union
582 {
583 GUID PartitionGuid;
584 } Gpt;
585
586 BL_LOCAL_DEVICE Disk;
587 } Partition;
588 };
589 } BL_DEVICE_DESCRIPTOR, *PBL_DEVICE_DESCRIPTOR;
590
591 typedef struct _BL_FILE_PATH_DESCRIPTOR
592 {
593 ULONG Version;
594 ULONG Length;
595 ULONG PathType;
596 UCHAR Path[ANYSIZE_ARRAY];
597 } BL_FILE_PATH_DESCRIPTOR, *PBL_FILE_PATH_DESCRIPTOR;
598
599 typedef struct _BL_WINDOWS_LOAD_OPTIONS
600 {
601 CHAR Signature[8];
602 ULONG Version;
603 ULONG Length;
604 ULONG OsPathOffset;
605 WCHAR LoadOptions[ANYSIZE_ARRAY];
606 } BL_WINDOWS_LOAD_OPTIONS, *PBL_WINDOWS_LOAD_OPTIONS;
607
608 typedef struct _BL_ARCH_CONTEXT
609 {
610 BL_ARCH_MODE Mode;
611 BL_TRANSLATION_TYPE TranslationType;
612 ULONG ContextFlags;
613 } BL_ARCH_CONTEXT, *PBL_ARCH_CONTEXT;
614
615 typedef struct _BL_MEMORY_DESCRIPTOR_LIST
616 {
617 LIST_ENTRY ListHead;
618 PLIST_ENTRY First;
619 PLIST_ENTRY This;
620 ULONG Type;
621 } BL_MEMORY_DESCRIPTOR_LIST, *PBL_MEMORY_DESCRIPTOR_LIST;
622
623 typedef struct _BL_ADDRESS_RANGE
624 {
625 ULONGLONG Minimum;
626 ULONGLONG Maximum;
627 } BL_ADDRESS_RANGE, *PBL_ADDRESS_RANGE;
628
629 typedef struct _BL_FILE_ENTRY
630 {
631 ULONG DeviceIndex;
632 PBL_FILE_DESTROY_CALLBACK DestroyCallback;
633 } BL_FILE_ENTRY, *PBL_FILE_ENTRY;
634
635 typedef struct _BL_FILE_SYSTEM_ENTRY
636 {
637 LIST_ENTRY ListEntry;
638 PBL_FS_INIT_CALLBACK InitCallback;
639 PBL_FS_DESTROY_CALLBACK DestroyCallback;
640 PBL_FS_MOUNT_CALLBACK MountCallback;
641 PBL_FS_PURGE_CALLBACK PurgeCallback;
642 } BL_FILE_SYSTEM_ENTRY, *PBL_FILE_SYSTEM_ENTRY;
643
644 typedef struct _BL_FILE_SYSTEM_REGISTRATION_TABLE
645 {
646 PBL_FS_INIT_CALLBACK Init;
647 PBL_FS_DESTROY_CALLBACK Destroy;
648 PBL_FS_MOUNT_CALLBACK Mount;
649 PBL_FS_PURGE_CALLBACK Purge;
650 } BL_FILE_SYSTEM_REGISTRATION_TABLE;
651
652 typedef struct _BL_DISPLAY_STATE
653 {
654 ULONG BgColor;
655 ULONG FgColor;
656 ULONG XPos;
657 ULONG YPos;
658 ULONG CursorVisible;
659 } BL_DISPLAY_STATE, *PBL_DISPLAY_STATE;
660
661 typedef struct _BL_DISPLAY_MODE
662 {
663 ULONG HRes;
664 ULONG VRes;
665 ULONG HRes2;
666 } BL_DISPLAY_MODE, *PBL_DISPLAY_MODE;
667
668 typedef struct _BL_TEXT_CONSOLE_VTABLE
669 {
670 PCONSOLE_DESTRUCT Destruct;
671 PCONSOLE_REINITIALIZE Reinitialize;
672 PCONSOLE_GET_TEXT_STATE GetTextState;
673 PCONSOLE_SET_TEXT_STATE SetTextState;
674 PCONSOLE_GET_TEXT_RESOLUTION GetTextResolution;
675 PCONSOLE_SET_TEXT_RESOLUTION SetTextResolution;
676 PCONSOLE_CLEAR_TEXT ClearText;
677 PCONSOLE_WRITE_TEXT WriteText;
678 } BL_TEXT_CONSOLE_VTABLE, *PBL_TEXT_CONSOLE_VTABLE;
679
680 typedef struct _BL_GRAPHICS_CONSOLE_VTABLE
681 {
682 BL_TEXT_CONSOLE_VTABLE Text;
683 /// more for graphics ///
684 } BL_GRAPHICS_CONSOLE_VTABLE, *PBL_GRAPHICS_CONSOLE_VTABLE;
685
686 typedef struct _BL_TEXT_CONSOLE
687 {
688 PBL_TEXT_CONSOLE_VTABLE Callbacks;
689 BL_DISPLAY_STATE State;
690 BL_DISPLAY_MODE DisplayMode;
691 BOOLEAN Active;
692 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL* Protocol;
693 ULONG Mode;
694 EFI_SIMPLE_TEXT_OUTPUT_MODE OldMode;
695 } BL_TEXT_CONSOLE, *PBL_TEXT_CONSOLE;
696
697 typedef enum _BL_GRAPHICS_CONSOLE_TYPE
698 {
699 BlGopConsole,
700 BlUgaConsole
701 } BL_GRAPHICS_CONSOLE_TYPE;
702
703 typedef struct _BL_GRAPHICS_CONSOLE
704 {
705 BL_TEXT_CONSOLE TextConsole;
706 BL_DISPLAY_MODE DisplayMode;
707 ULONG PixelDepth;
708 ULONG FgColor;
709 ULONG BgColor;
710 BL_DISPLAY_MODE OldDisplayMode;
711 ULONG OldPixelDepth;
712 EFI_HANDLE Handle;
713 BL_GRAPHICS_CONSOLE_TYPE Type;
714 EFI_GRAPHICS_OUTPUT_PROTOCOL* Protocol;
715 PVOID FrameBuffer;
716 ULONG FrameBufferSize;
717 ULONG PixelsPerScanLine;
718 ULONG Mode;
719 ULONG OldMode;
720 } BL_GRAPHICS_CONSOLE, *PBL_GRAPHICS_CONSOLE;
721
722 typedef struct _BL_REMOTE_CONSOLE
723 {
724 BL_TEXT_CONSOLE TextConsole;
725 } BL_REMOTE_CONSOLE, *PBL_REMOTE_CONSOLE;
726
727 typedef struct _BL_HASH_TABLE
728 {
729 PLIST_ENTRY HashLinks;
730 ULONG Size;
731 PBL_HASH_TABLE_COMPARE_FUNCTION CompareFunction;
732 PBL_HASH_TABLE_HASH_FUNCTION HashFunction;
733 } BL_HASH_TABLE, *PBL_HASH_TABLE;
734
735 typedef struct _BL_HASH_ENTRY
736 {
737 ULONG Size;
738 ULONG Flags;
739 PVOID Value;
740 } BL_HASH_ENTRY, *PBL_HASH_ENTRY;
741
742 typedef struct _BL_HASH_VALUE
743 {
744 ULONG DataSize;
745 PVOID Data;
746 } BL_HASH_VALUE, *PBL_HASH_VALUE;
747
748 typedef struct _BL_HASH_NODE
749 {
750 LIST_ENTRY ListEntry;
751 BL_HASH_ENTRY Entry;
752 BL_HASH_VALUE Value;
753 } BL_HASH_NODE, *PBL_HASH_NODE;
754
755 typedef struct _BL_BLOCK_DEVICE
756 {
757 BL_LOCAL_DEVICE_TYPE Type;
758 ULONG DeviceFlags;
759 ULONG Unknown;
760 BL_PARTITION_TYPE PartitionType;
761 ULONG BlockSize;
762 ULONG Alignment;
763 struct
764 {
765 union
766 {
767 struct
768 {
769 ULONG Signature;
770 } Mbr;
771 struct
772 {
773 GUID Signature;
774 } Gpt;
775 };
776 } Disk;
777 ULONGLONG LastBlock;
778 EFI_BLOCK_IO* Protocol;
779 EFI_HANDLE Handle;
780 } BL_BLOCK_DEVICE, *PBL_BLOCK_DEVICE;
781
782 typedef struct _BL_PROTOCOL_HANDLE
783 {
784 EFI_HANDLE Handle;
785 PVOID Interface;
786 } BL_PROTOCOL_HANDLE, *PBL_PROTOCOL_HANDLE;
787
788 /* INLINE ROUTINES ***********************************************************/
789
790 FORCEINLINE
791 VOID
792 BlSetupDefaultParameters (
793 _Out_ PBL_LIBRARY_PARAMETERS LibraryParameters
794 )
795 {
796 BL_LIBRARY_PARAMETERS DefaultParameters =
797 {
798 0x20,
799 BlVirtual,
800 1024,
801 2 * 1024 * 1024,
802 0,
803 NULL,
804 0,
805 NULL
806 };
807
808 /* Copy the defaults */
809 RtlCopyMemory(LibraryParameters, &DefaultParameters, sizeof(*LibraryParameters));
810 }
811
812 FORCEINLINE
813 VOID
814 MmMdInitializeListHead (
815 _In_ PBL_MEMORY_DESCRIPTOR_LIST List
816 )
817 {
818 /* Initialize the list */
819 InitializeListHead(&List->ListHead);
820 List->First = &List->ListHead;
821 List->This = NULL;
822 }
823
824 /* INITIALIZATION ROUTINES ***************************************************/
825
826 NTSTATUS
827 BlInitializeLibrary(
828 _In_ PBOOT_APPLICATION_PARAMETER_BLOCK BootAppParameters,
829 _In_ PBL_LIBRARY_PARAMETERS LibraryParameters
830 );
831
832 NTSTATUS
833 BlpArchInitialize (
834 _In_ ULONG Phase
835 );
836
837 NTSTATUS
838 BlpFwInitialize (
839 _In_ ULONG Phase,
840 _In_ PBL_FIRMWARE_DESCRIPTOR FirmwareParameters
841 );
842
843 NTSTATUS
844 BlpMmInitialize (
845 _In_ PBL_MEMORY_DATA MemoryData,
846 _In_ BL_TRANSLATION_TYPE TranslationType,
847 _In_ PBL_LIBRARY_PARAMETERS LibraryParameters
848 );
849
850 NTSTATUS
851 MmBaInitialize (
852 VOID
853 );
854
855 NTSTATUS
856 MmPaInitialize (
857 _In_ PBL_MEMORY_DATA MemoryData,
858 _In_ ULONG MinimumPages
859 );
860
861 NTSTATUS
862 MmArchInitialize (
863 _In_ ULONG Phase,
864 _In_ PBL_MEMORY_DATA MemoryData,
865 _In_ BL_TRANSLATION_TYPE TranslationType,
866 _In_ BL_TRANSLATION_TYPE LibraryTranslationType
867 );
868
869 NTSTATUS
870 MmHaInitialize (
871 _In_ ULONG HeapSize,
872 _In_ ULONG HeapAttributes
873 );
874
875 VOID
876 MmMdInitialize (
877 _In_ ULONG Phase,
878 _In_ PBL_LIBRARY_PARAMETERS LibraryParameters
879 );
880
881 NTSTATUS
882 BlpDeviceInitialize (
883 VOID
884 );
885
886 NTSTATUS
887 BlpIoInitialize (
888 VOID
889 );
890
891 NTSTATUS
892 BlpFileInitialize (
893 VOID
894 );
895
896 NTSTATUS
897 FatInitialize (
898 VOID
899 );
900
901 NTSTATUS
902 BlpDisplayInitialize (
903 _In_ ULONG Flags
904 );
905
906 VOID
907 BlDestroyLibrary (
908 VOID
909 );
910
911 NTSTATUS
912 BcInitialize (
913 VOID
914 );
915
916 /* FIRMWARE ROUTINES *********************************************************/
917
918 VOID
919 EfiPrintf (
920 _In_ PWCHAR Format,
921 ...
922 );
923
924 NTSTATUS
925 EfiAllocatePages (
926 _In_ ULONG Type,
927 _In_ ULONG Pages,
928 _Inout_ EFI_PHYSICAL_ADDRESS* Memory
929 );
930
931 NTSTATUS
932 EfiStall (
933 _In_ ULONG StallTime
934 );
935
936 NTSTATUS
937 EfiConOutQueryMode (
938 _In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface,
939 _In_ ULONG Mode,
940 _In_ UINTN* Columns,
941 _In_ UINTN* Rows
942 );
943
944 NTSTATUS
945 EfiConOutSetMode (
946 _In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface,
947 _In_ ULONG Mode
948 );
949
950 VOID
951 EfiConOutReadCurrentMode (
952 _In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface,
953 _Out_ EFI_SIMPLE_TEXT_OUTPUT_MODE* Mode
954 );
955
956 NTSTATUS
957 EfiConOutSetAttribute (
958 _In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface,
959 _In_ ULONG Attribute
960 );
961
962 NTSTATUS
963 EfiConOutSetCursorPosition (
964 _In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface,
965 _In_ ULONG Column,
966 _In_ ULONG Row
967 );
968
969 NTSTATUS
970 EfiConOutEnableCursor (
971 _In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface,
972 _In_ BOOLEAN Visible
973 );
974
975 NTSTATUS
976 EfiLocateHandleBuffer (
977 _In_ EFI_LOCATE_SEARCH_TYPE SearchType,
978 _In_ EFI_GUID *Protocol,
979 _Inout_ PULONG HandleCount,
980 _Inout_ EFI_HANDLE** Buffer
981 );
982
983 NTSTATUS
984 EfiOpenProtocol (
985 _In_ EFI_HANDLE Handle,
986 _In_ EFI_GUID *Protocol,
987 _Out_ PVOID* Interface
988 );
989
990 NTSTATUS
991 EfiCloseProtocol (
992 _In_ EFI_HANDLE Handle,
993 _In_ EFI_GUID *Protocol
994 );
995
996 NTSTATUS
997 EfiGopGetCurrentMode (
998 _In_ EFI_GRAPHICS_OUTPUT_PROTOCOL *GopInterface,
999 _Out_ UINTN* Mode,
1000 _Out_ EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Information
1001 );
1002
1003 NTSTATUS
1004 EfiGopSetMode (
1005 _In_ EFI_GRAPHICS_OUTPUT_PROTOCOL *GopInterface,
1006 _In_ ULONG Mode
1007 );
1008
1009 VOID
1010 EfiGopGetFrameBuffer (
1011 _In_ EFI_GRAPHICS_OUTPUT_PROTOCOL *GopInterface,
1012 _Out_ PHYSICAL_ADDRESS* FrameBuffer,
1013 _Out_ UINTN *FrameBufferSize
1014 );
1015
1016 VOID
1017 EfiResetSystem (
1018 _In_ EFI_RESET_TYPE ResetType
1019 );
1020
1021 EFI_DEVICE_PATH*
1022 EfiGetLeafNode (
1023 _In_ EFI_DEVICE_PATH *DevicePath
1024 );
1025
1026 EFI_DEVICE_PATH *
1027 EfiIsDevicePathParent (
1028 _In_ EFI_DEVICE_PATH *DevicePath1,
1029 _In_ EFI_DEVICE_PATH *DevicePath2
1030 );
1031
1032 /* PLATFORM TIMER ROUTINES ***************************************************/
1033
1034 NTSTATUS
1035 BlpTimeCalibratePerformanceCounter (
1036 VOID
1037 );
1038
1039 /* UTILITY ROUTINES **********************************************************/
1040
1041 EFI_STATUS
1042 EfiGetEfiStatusCode(
1043 _In_ NTSTATUS Status
1044 );
1045
1046 NTSTATUS
1047 EfiGetNtStatusCode (
1048 _In_ EFI_STATUS EfiStatus
1049 );
1050
1051 NTSTATUS
1052 BlUtlInitialize (
1053 VOID
1054 );
1055
1056 VOID
1057 BlFwReboot (
1058 VOID
1059 );
1060
1061 PGUID
1062 BlGetApplicationIdentifier (
1063 VOID
1064 );
1065
1066 /* TABLE ROUTINES ************************************************************/
1067
1068 NTSTATUS
1069 BlTblMap (
1070 _In_ PVOID *Table,
1071 _In_ ULONG Count,
1072 _In_ PBL_TBL_MAP_ROUTINE MapCallback
1073 );
1074
1075 PVOID
1076 BlTblFindEntry (
1077 _In_ PVOID *Table,
1078 _In_ ULONG Count,
1079 _Out_ PULONG EntryIndex,
1080 _In_ PBL_TBL_LOOKUP_ROUTINE Callback,
1081 _In_ PVOID Argument1,
1082 _In_ PVOID Argument2,
1083 _In_ PVOID Argument3,
1084 _In_ PVOID Argument4
1085 );
1086
1087 NTSTATUS
1088 BlTblSetEntry (
1089 _Inout_ PVOID** Table,
1090 _Inout_ PULONG Count,
1091 _In_ PVOID Entry,
1092 _Out_ PULONG EntryIndex,
1093 _In_ PBL_TBL_SET_ROUTINE Callback
1094 );
1095
1096 NTSTATUS
1097 TblDoNotPurgeEntry (
1098 _In_ PVOID Entry
1099 );
1100
1101 /* HASH TABLE ROUTINES *******************************************************/
1102
1103 NTSTATUS
1104 BlHtStore (
1105 _In_ ULONG TableId,
1106 _In_ PBL_HASH_ENTRY Entry,
1107 _In_ PVOID Data,
1108 _In_ ULONG DataSize
1109 );
1110
1111 NTSTATUS
1112 BlHtLookup (
1113 _In_ ULONG TableId,
1114 _In_ PBL_HASH_ENTRY Entry,
1115 _Out_ PBL_HASH_VALUE *Value
1116 );
1117
1118 NTSTATUS
1119 BlHtCreate (
1120 _In_ ULONG Size,
1121 _In_ PBL_HASH_TABLE_HASH_FUNCTION HashFunction,
1122 _In_ PBL_HASH_TABLE_COMPARE_FUNCTION CompareFunction,
1123 _Out_ PULONG Id
1124 );
1125
1126 /* BCD ROUTINES **************************************************************/
1127
1128 ULONG
1129 BlGetBootOptionSize (
1130 _In_ PBL_BCD_OPTION BcdOption
1131 );
1132
1133 NTSTATUS
1134 BlGetBootOptionString (
1135 _In_ PBL_BCD_OPTION List,
1136 _In_ ULONG Type,
1137 _Out_ PWCHAR* Value
1138 );
1139
1140 NTSTATUS
1141 BlGetBootOptionInteger (
1142 _In_ PBL_BCD_OPTION List,
1143 _In_ ULONG Type,
1144 _Out_ PULONGLONG Value
1145 );
1146
1147 NTSTATUS
1148 BlGetBootOptionBoolean (
1149 _In_ PBL_BCD_OPTION List,
1150 _In_ ULONG Type,
1151 _Out_ PBOOLEAN Value
1152 );
1153
1154 /* CONTEXT ROUTINES **********************************************************/
1155
1156 VOID
1157 BlpArchSwitchContext (
1158 _In_ BL_ARCH_MODE NewMode
1159 );
1160
1161 /* MEMORY DESCRIPTOR ROUTINES ************************************************/
1162
1163 VOID
1164 MmMdFreeList(
1165 _In_ PBL_MEMORY_DESCRIPTOR_LIST MdList
1166 );
1167
1168 PBL_MEMORY_DESCRIPTOR
1169 MmMdInitByteGranularDescriptor (
1170 _In_ ULONG Flags,
1171 _In_ BL_MEMORY_TYPE Type,
1172 _In_ ULONGLONG BasePage,
1173 _In_ ULONGLONG VirtualPage,
1174 _In_ ULONGLONG PageCount
1175 );
1176
1177 VOID
1178 MmMdFreeGlobalDescriptors (
1179 VOID
1180 );
1181
1182 NTSTATUS
1183 MmMdAddDescriptorToList (
1184 _In_ PBL_MEMORY_DESCRIPTOR_LIST MdList,
1185 _In_ PBL_MEMORY_DESCRIPTOR MemoryDescriptor,
1186 _In_ ULONG Flags
1187 );
1188
1189 VOID
1190 MmMdRemoveDescriptorFromList (
1191 _In_ PBL_MEMORY_DESCRIPTOR_LIST MdList,
1192 _In_ PBL_MEMORY_DESCRIPTOR Entry
1193 );
1194
1195 BOOLEAN
1196 MmMdFindSatisfyingRegion (
1197 _In_ PBL_MEMORY_DESCRIPTOR Descriptor,
1198 _Out_ PBL_MEMORY_DESCRIPTOR NewDescriptor,
1199 _In_ ULONGLONG Pages,
1200 _In_ PBL_ADDRESS_RANGE BaseRange,
1201 _In_ PBL_ADDRESS_RANGE VirtualRange,
1202 _In_ BOOLEAN TopDown,
1203 _In_ BL_MEMORY_TYPE MemoryType,
1204 _In_ ULONG Flags,
1205 _In_ ULONG Alignment
1206 );
1207
1208 NTSTATUS
1209 MmMdRemoveRegionFromMdlEx (
1210 __in PBL_MEMORY_DESCRIPTOR_LIST MdList,
1211 __in ULONG Flags,
1212 __in ULONGLONG BasePage,
1213 __in ULONGLONG PageCount,
1214 __in PBL_MEMORY_DESCRIPTOR_LIST NewMdList
1215 );
1216
1217 NTSTATUS
1218 MmMdFreeDescriptor (
1219 _In_ PBL_MEMORY_DESCRIPTOR MemoryDescriptor
1220 );
1221
1222 /* PAGE ALLOCATOR ROUTINES ***************************************************/
1223
1224 NTSTATUS
1225 MmPapAllocatePagesInRange (
1226 _Inout_ PVOID* PhysicalAddress,
1227 _In_ BL_MEMORY_TYPE MemoryType,
1228 _In_ ULONGLONG Pages,
1229 _In_ ULONG Attributes,
1230 _In_ ULONG Alignment,
1231 _In_opt_ PBL_ADDRESS_RANGE Range,
1232 _In_ ULONG Type
1233 );
1234
1235 NTSTATUS
1236 MmFwGetMemoryMap (
1237 _Out_ PBL_MEMORY_DESCRIPTOR_LIST MemoryMap,
1238 _In_ ULONG Flags
1239 );
1240
1241 /* VIRTUAL MEMORY ROUTINES ***************************************************/
1242
1243 NTSTATUS
1244 BlMmMapPhysicalAddressEx (
1245 _In_ PVOID* VirtualAddress,
1246 _In_ ULONG Attributes,
1247 _In_ ULONGLONG Size,
1248 _In_ PHYSICAL_ADDRESS PhysicalAddress
1249 );
1250
1251 /* BLOCK ALLOCATOR ROUTINES **************************************************/
1252
1253 NTSTATUS
1254 BlpMmCreateBlockAllocator (
1255 VOID
1256 );
1257
1258 /* HEAP ALLOCATOR ROUTINES ***************************************************/
1259
1260 PVOID
1261 BlMmAllocateHeap (
1262 _In_ ULONG Size
1263 );
1264
1265 NTSTATUS
1266 BlMmFreeHeap (
1267 _In_ PVOID Buffer
1268 );
1269
1270 /* DISPLAY ROUTINES **********************************************************/
1271
1272 VOID
1273 BlDisplayGetTextCellResolution (
1274 _Out_ PULONG TextWidth,
1275 _Out_ PULONG TextHeight
1276 );
1277
1278 /* I/O ROUTINES **************************************************************/
1279
1280 NTSTATUS
1281 BlpIoRegisterDestroyRoutine (
1282 _In_ PBL_IO_DESTROY_ROUTINE DestroyRoutine
1283 );
1284
1285 NTSTATUS
1286 BlDeviceClose (
1287 _In_ ULONG DeviceId
1288 );
1289
1290 NTSTATUS
1291 BlpDeviceOpen (
1292 _In_ PBL_DEVICE_DESCRIPTOR Device,
1293 _In_ ULONG Flags,
1294 _In_ ULONG Unknown,
1295 _Out_ PULONG DeviceId
1296 );
1297
1298 /* TEXT CONSOLE ROUTINES *****************************************************/
1299
1300 NTSTATUS
1301 ConsoleTextLocalDestruct (
1302 _In_ struct _BL_TEXT_CONSOLE* Console
1303 );
1304
1305 NTSTATUS
1306 ConsoleTextLocalReinitialize (
1307 _In_ struct _BL_TEXT_CONSOLE* Console
1308 );
1309
1310 NTSTATUS
1311 ConsoleTextBaseGetTextState (
1312 _In_ struct _BL_TEXT_CONSOLE* Console,
1313 _Out_ PBL_DISPLAY_STATE TextState
1314 );
1315
1316 NTSTATUS
1317 ConsoleTextLocalSetTextState (
1318 _In_ struct _BL_TEXT_CONSOLE* Console,
1319 _In_ ULONG Flags,
1320 _In_ PBL_DISPLAY_STATE TextState
1321 );
1322
1323 NTSTATUS
1324 ConsoleTextBaseGetTextResolution (
1325 _In_ struct _BL_TEXT_CONSOLE* Console,
1326 _Out_ PULONG TextResolution
1327 );
1328
1329 NTSTATUS
1330 ConsoleTextLocalSetTextResolution (
1331 _In_ struct _BL_TEXT_CONSOLE* Console,
1332 _In_ ULONG NewTextResolution,
1333 _Out_ PULONG OldTextResolution
1334 );
1335
1336 NTSTATUS
1337 ConsoleTextLocalClearText (
1338 _In_ struct _BL_TEXT_CONSOLE* Console,
1339 _In_ ULONG Attribute
1340 );
1341
1342 NTSTATUS
1343 ConsoleTextLocalWriteText (
1344 _In_ struct _BL_TEXT_CONSOLE* Console,
1345 _In_ PCHAR Text,
1346 _In_ ULONG Attribute
1347 );
1348
1349 NTSTATUS
1350 ConsoleTextLocalConstruct (
1351 _In_ PBL_TEXT_CONSOLE TextConsole,
1352 _In_ BOOLEAN Activate
1353 );
1354
1355 BOOLEAN
1356 ConsolepFindResolution (
1357 _In_ PBL_DISPLAY_MODE Mode,
1358 _In_ PBL_DISPLAY_MODE List,
1359 _In_ ULONG MaxIndex
1360 );
1361
1362 VOID
1363 ConsoleFirmwareTextClose (
1364 _In_ PBL_TEXT_CONSOLE TextConsole
1365 );
1366
1367 NTSTATUS
1368 ConsoleFirmwareTextOpen (
1369 _In_ PBL_TEXT_CONSOLE TextConsole
1370 );
1371
1372 NTSTATUS
1373 ConsoleFirmwareTextSetState (
1374 _In_ PBL_TEXT_CONSOLE TextConsole,
1375 _In_ UCHAR Mask,
1376 _In_ PBL_DISPLAY_STATE State
1377 );
1378
1379 NTSTATUS
1380 ConsoleGraphicalConstruct (
1381 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
1382 );
1383
1384 NTSTATUS
1385 ConsoleCreateRemoteConsole (
1386 _In_ PBL_TEXT_CONSOLE* TextConsole
1387 );
1388
1389 NTSTATUS
1390 ConsoleEfiGraphicalOpenProtocol (
1391 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole,
1392 _In_ BL_GRAPHICS_CONSOLE_TYPE Type
1393 );
1394
1395 VOID
1396 ConsoleFirmwareGraphicalClose (
1397 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
1398 );
1399
1400 NTSTATUS
1401 ConsoleFirmwareGraphicalEnable (
1402 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
1403 );
1404
1405 NTSTATUS
1406 ConsoleEfiUgaOpen (
1407 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
1408 );
1409
1410 VOID
1411 ConsoleEfiUgaClose (
1412 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
1413 );
1414
1415 VOID
1416 ConsoleEfiGopClose (
1417 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
1418 );
1419
1420 NTSTATUS
1421 ConsoleEfiGopOpen (
1422 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
1423 );
1424
1425 NTSTATUS
1426 ConsoleEfiGopEnable (
1427 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
1428 );
1429
1430 NTSTATUS
1431 ConsoleEfiUgaSetResolution (
1432 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole,
1433 _In_ PBL_DISPLAY_MODE DisplayMode,
1434 _In_ ULONG DisplayModeCount
1435 );
1436
1437 extern ULONG MmDescriptorCallTreeCount;
1438 extern ULONG BlpApplicationFlags;
1439 extern BL_LIBRARY_PARAMETERS BlpLibraryParameters;
1440 extern BL_TRANSLATION_TYPE MmTranslationType;
1441 extern PBL_ARCH_CONTEXT CurrentExecutionContext;
1442 extern PBL_DEVICE_DESCRIPTOR BlpBootDevice;
1443 extern BL_LOADED_APPLICATION_ENTRY BlpApplicationEntry;
1444 extern SIMPLE_TEXT_OUTPUT_INTERFACE *EfiConOut;
1445 extern EFI_GUID EfiGraphicsOutputProtocol;
1446 extern EFI_GUID EfiUgaDrawProtocol;
1447 extern EFI_GUID EfiLoadedImageProtocol;
1448 extern EFI_GUID EfiDevicePathProtocol;
1449 extern EFI_GUID EfiBlockIoProtocol;
1450 extern EFI_GUID EfiSimpleTextInputExProtocol;
1451 extern ULONG ConsoleGraphicalResolutionListFlags;
1452 extern BL_DISPLAY_MODE ConsoleGraphicalResolutionList[];
1453 extern BL_DISPLAY_MODE ConsoleTextResolutionList[];
1454 extern ULONG ConsoleGraphicalResolutionListSize;
1455 extern PVOID DspRemoteInputConsole;
1456 #endif