xref: /DragonStub/lib/data.c (revision 751cbce3f640c79fbb4660cb59a372b79a7f4d11)
1530d68baSNigel Croxon /*++
2530d68baSNigel Croxon 
3530d68baSNigel Croxon Copyright (c) 1998  Intel Corporation
4530d68baSNigel Croxon 
5530d68baSNigel Croxon Module Name:
6530d68baSNigel Croxon 
7530d68baSNigel Croxon     data.c
8530d68baSNigel Croxon 
9530d68baSNigel Croxon Abstract:
10530d68baSNigel Croxon 
11530d68baSNigel Croxon     EFI library global data
12530d68baSNigel Croxon 
13530d68baSNigel Croxon 
14530d68baSNigel Croxon 
15530d68baSNigel Croxon Revision History
16530d68baSNigel Croxon 
17530d68baSNigel Croxon --*/
18530d68baSNigel Croxon 
19530d68baSNigel Croxon #include "lib.h"
20530d68baSNigel Croxon 
21530d68baSNigel Croxon //
22530d68baSNigel Croxon // LibInitialized - TRUE once InitializeLib() is called for the first time
23530d68baSNigel Croxon //
24530d68baSNigel Croxon 
25530d68baSNigel Croxon BOOLEAN  LibInitialized = FALSE;
26530d68baSNigel Croxon 
27530d68baSNigel Croxon //
28530d68baSNigel Croxon // ST - pointer to the EFI system table
29530d68baSNigel Croxon //
30530d68baSNigel Croxon 
31530d68baSNigel Croxon EFI_SYSTEM_TABLE        *ST;
32530d68baSNigel Croxon 
33530d68baSNigel Croxon //
34530d68baSNigel Croxon // BS - pointer to the boot services table
35530d68baSNigel Croxon //
36530d68baSNigel Croxon 
37530d68baSNigel Croxon EFI_BOOT_SERVICES       *BS;
38530d68baSNigel Croxon 
39530d68baSNigel Croxon 
40530d68baSNigel Croxon //
41530d68baSNigel Croxon // Default pool allocation type
42530d68baSNigel Croxon //
43530d68baSNigel Croxon 
44530d68baSNigel Croxon EFI_MEMORY_TYPE PoolAllocationType = EfiBootServicesData;
45530d68baSNigel Croxon 
46530d68baSNigel Croxon //
47530d68baSNigel Croxon // Unicode collation functions that are in use
48530d68baSNigel Croxon //
49530d68baSNigel Croxon 
50530d68baSNigel Croxon EFI_UNICODE_COLLATION_INTERFACE   LibStubUnicodeInterface = {
51530d68baSNigel Croxon     LibStubStriCmp,
52530d68baSNigel Croxon     LibStubMetaiMatch,
53530d68baSNigel Croxon     LibStubStrLwrUpr,
54530d68baSNigel Croxon     LibStubStrLwrUpr,
55530d68baSNigel Croxon     NULL,   // FatToStr
56530d68baSNigel Croxon     NULL,   // StrToFat
57530d68baSNigel Croxon     NULL    // SupportedLanguages
58530d68baSNigel Croxon };
59530d68baSNigel Croxon 
60530d68baSNigel Croxon EFI_UNICODE_COLLATION_INTERFACE   *UnicodeInterface = &LibStubUnicodeInterface;
61530d68baSNigel Croxon 
62530d68baSNigel Croxon //
63530d68baSNigel Croxon // Root device path
64530d68baSNigel Croxon //
65530d68baSNigel Croxon 
66530d68baSNigel Croxon EFI_DEVICE_PATH RootDevicePath[] = {
67530d68baSNigel Croxon    {END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, {END_DEVICE_PATH_LENGTH,0}}
68530d68baSNigel Croxon };
69530d68baSNigel Croxon 
70530d68baSNigel Croxon EFI_DEVICE_PATH EndDevicePath[] = {
71530d68baSNigel Croxon    {END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, {END_DEVICE_PATH_LENGTH, 0}}
72530d68baSNigel Croxon };
73530d68baSNigel Croxon 
74530d68baSNigel Croxon EFI_DEVICE_PATH EndInstanceDevicePath[] = {
75530d68baSNigel Croxon    {END_DEVICE_PATH_TYPE, END_INSTANCE_DEVICE_PATH_SUBTYPE, {END_DEVICE_PATH_LENGTH, 0}}
76530d68baSNigel Croxon };
77530d68baSNigel Croxon 
78530d68baSNigel Croxon 
79530d68baSNigel Croxon //
80530d68baSNigel Croxon // EFI IDs
81530d68baSNigel Croxon //
82530d68baSNigel Croxon 
83*751cbce3SNigel Croxon EFI_GUID gEfiGlobalVariableGuid = EFI_GLOBAL_VARIABLE;
84530d68baSNigel Croxon EFI_GUID NullGuid = { 0,0,0,{0,0,0,0,0,0,0,0} };
85530d68baSNigel Croxon 
86530d68baSNigel Croxon //
87530d68baSNigel Croxon // Protocol IDs
88530d68baSNigel Croxon //
89530d68baSNigel Croxon 
90*751cbce3SNigel Croxon EFI_GUID gEfiDevicePathProtocolGuid                 = EFI_DEVICE_PATH_PROTOCOL_GUID;
91*751cbce3SNigel Croxon EFI_GUID gEfiDevicePathToTextProtocolGuid           = EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID;
92*751cbce3SNigel Croxon EFI_GUID gEfiDevicePathFromTextProtocolGuid         = EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID;
93*751cbce3SNigel Croxon EFI_GUID gEfiLoadedImageProtocolGuid                = EFI_LOADED_IMAGE_PROTOCOL_GUID;
94*751cbce3SNigel Croxon EFI_GUID gEfiSimpleTextInProtocolGuid               = EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID;
95*751cbce3SNigel Croxon EFI_GUID gEfiSimpleTextOutProtocolGuid              = EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID;
96*751cbce3SNigel Croxon EFI_GUID gEfiBlockIoProtocolGuid                    = EFI_BLOCK_IO_PROTOCOL_GUID;
97*751cbce3SNigel Croxon EFI_GUID gEfiBlockIo2ProtocolGuid                   = EFI_BLOCK_IO2_PROTOCOL_GUID;
98*751cbce3SNigel Croxon EFI_GUID gEfiDiskIoProtocolGuid                     = EFI_DISK_IO_PROTOCOL_GUID;
99*751cbce3SNigel Croxon EFI_GUID gEfiDiskIo2ProtocolGuid                    = EFI_DISK_IO2_PROTOCOL_GUID;
100*751cbce3SNigel Croxon EFI_GUID gEfiSimpleFileSystemProtocolGuid           = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID;
101*751cbce3SNigel Croxon EFI_GUID gEfiLoadFileProtocolGuid                   = EFI_LOAD_FILE_PROTOCOL_GUID;
102*751cbce3SNigel Croxon EFI_GUID gEfiDeviceIoProtocolGuid                   = EFI_DEVICE_IO_PROTOCOL_GUID;
103*751cbce3SNigel Croxon EFI_GUID gEfiUnicodeCollationProtocolGuid           = EFI_UNICODE_COLLATION_PROTOCOL_GUID;
104*751cbce3SNigel Croxon EFI_GUID gEfiSerialIoProtocolGuid                   = EFI_SERIAL_IO_PROTOCOL_GUID;
105*751cbce3SNigel Croxon EFI_GUID gEfiSimpleNetworkProtocolGuid              = EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
106*751cbce3SNigel Croxon EFI_GUID gEfiPxeBaseCodeProtocolGuid                = EFI_PXE_BASE_CODE_PROTOCOL_GUID;
107*751cbce3SNigel Croxon EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid        = EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_GUID;
108*751cbce3SNigel Croxon EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid = EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID;
109*751cbce3SNigel Croxon EFI_GUID gEFiUiInterfaceProtocolGuid                = EFI_UI_INTERFACE_PROTOCOL_GUID;
110*751cbce3SNigel Croxon EFI_GUID gEfiPciIoProtocolGuid                      = EFI_PCI_IO_PROTOCOL_GUID;
111*751cbce3SNigel Croxon EFI_GUID gEfiDriverBindingProtocolGuid              = EFI_DRIVER_BINDING_PROTOCOL_GUID;
112*751cbce3SNigel Croxon EFI_GUID gEfiComponentNameProtocolGuid              = EFI_COMPONENT_NAME_PROTOCOL_GUID;
113*751cbce3SNigel Croxon EFI_GUID gEfiComponentName2ProtocolGuid             = EFI_COMPONENT_NAME2_PROTOCOL_GUID;
114*751cbce3SNigel Croxon EFI_GUID gEfiHashProtocolGuid                       = EFI_HASH_PROTOCOL_GUID;
115*751cbce3SNigel Croxon EFI_GUID gEfiPlatformDriverOverrideProtocolGuid     = EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID;
116*751cbce3SNigel Croxon EFI_GUID gEfiBusSpecificDriverOverrideProtocolGuid  = EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID;
117*751cbce3SNigel Croxon EFI_GUID gEfiDriverFamilyOverrideProtocolGuid       = EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL_GUID;
118883702e8SNigel Croxon 
119530d68baSNigel Croxon //
120530d68baSNigel Croxon // File system information IDs
121530d68baSNigel Croxon //
122530d68baSNigel Croxon 
123*751cbce3SNigel Croxon EFI_GUID gEfiFileInfoGuid                           = EFI_FILE_INFO_ID;
124*751cbce3SNigel Croxon EFI_GUID gEfiFileSystemInfoGuid                     = EFI_FILE_SYSTEM_INFO_ID;
125*751cbce3SNigel Croxon EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid        = EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID;
126530d68baSNigel Croxon 
127530d68baSNigel Croxon //
128530d68baSNigel Croxon // Reference implementation public protocol IDs
129530d68baSNigel Croxon //
130530d68baSNigel Croxon 
131530d68baSNigel Croxon EFI_GUID InternalShellProtocol = INTERNAL_SHELL_GUID;
132530d68baSNigel Croxon EFI_GUID VariableStoreProtocol = VARIABLE_STORE_PROTOCOL;
133530d68baSNigel Croxon EFI_GUID LegacyBootProtocol = LEGACY_BOOT_PROTOCOL;
134530d68baSNigel Croxon EFI_GUID VgaClassProtocol = VGA_CLASS_DRIVER_PROTOCOL;
135530d68baSNigel Croxon 
136530d68baSNigel Croxon EFI_GUID TextOutSpliterProtocol = TEXT_OUT_SPLITER_PROTOCOL;
137530d68baSNigel Croxon EFI_GUID ErrorOutSpliterProtocol = ERROR_OUT_SPLITER_PROTOCOL;
138530d68baSNigel Croxon EFI_GUID TextInSpliterProtocol = TEXT_IN_SPLITER_PROTOCOL;
139530d68baSNigel Croxon /* Added for GOP support */
140*751cbce3SNigel Croxon EFI_GUID gEfiGraphicsOutputProtocolGuid             = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
141*751cbce3SNigel Croxon EFI_GUID gEfiEdidDiscoveredProtocolGuid             = EFI_EDID_DISCOVERED_PROTOCOL_GUID;
142*751cbce3SNigel Croxon EFI_GUID gEfiEdidActiveProtocolGuid                 = EFI_EDID_ACTIVE_PROTOCOL_GUID;
143*751cbce3SNigel Croxon EFI_GUID gEfiEdidOverrideProtocolGuid               = EFI_EDID_OVERRIDE_PROTOCOL_GUID;
144530d68baSNigel Croxon 
145530d68baSNigel Croxon EFI_GUID AdapterDebugProtocol = ADAPTER_DEBUG_PROTOCOL;
146530d68baSNigel Croxon 
147530d68baSNigel Croxon //
148530d68baSNigel Croxon // Device path media protocol IDs
149530d68baSNigel Croxon //
150*751cbce3SNigel Croxon EFI_GUID gEfiPcAnsiGuid                             = EFI_PC_ANSI_GUID;
151*751cbce3SNigel Croxon EFI_GUID gEfiVT100Guid                              = EFI_VT_100_GUID;
152*751cbce3SNigel Croxon EFI_GUID gEfiVT100PlusGuid                          = EFI_VT_100_PLUS_GUID;
153*751cbce3SNigel Croxon EFI_GUID gEfiVTUTF8Guid                             = EFI_VT_UTF8_GUID;
154530d68baSNigel Croxon 
155530d68baSNigel Croxon //
156530d68baSNigel Croxon // EFI GPT Partition Type GUIDs
157530d68baSNigel Croxon //
158530d68baSNigel Croxon EFI_GUID EfiPartTypeSystemPartitionGuid = EFI_PART_TYPE_EFI_SYSTEM_PART_GUID;
159530d68baSNigel Croxon EFI_GUID EfiPartTypeLegacyMbrGuid = EFI_PART_TYPE_LEGACY_MBR_GUID;
160530d68baSNigel Croxon 
161530d68baSNigel Croxon 
162530d68baSNigel Croxon //
163530d68baSNigel Croxon // Reference implementation Vendor Device Path Guids
164530d68baSNigel Croxon //
165530d68baSNigel Croxon EFI_GUID UnknownDevice      = UNKNOWN_DEVICE_GUID;
166530d68baSNigel Croxon 
167530d68baSNigel Croxon //
168530d68baSNigel Croxon // Configuration Table GUIDs
169530d68baSNigel Croxon //
170530d68baSNigel Croxon 
171530d68baSNigel Croxon EFI_GUID MpsTableGuid             = MPS_TABLE_GUID;
172530d68baSNigel Croxon EFI_GUID AcpiTableGuid            = ACPI_TABLE_GUID;
173530d68baSNigel Croxon EFI_GUID SMBIOSTableGuid          = SMBIOS_TABLE_GUID;
174530d68baSNigel Croxon EFI_GUID SalSystemTableGuid       = SAL_SYSTEM_TABLE_GUID;
175530d68baSNigel Croxon 
176530d68baSNigel Croxon //
177530d68baSNigel Croxon // Network protocol GUIDs
178530d68baSNigel Croxon //
179530d68baSNigel Croxon EFI_GUID Ip4ServiceBindingProtocol = EFI_IP4_SERVICE_BINDING_PROTOCOL;
180530d68baSNigel Croxon EFI_GUID Ip4Protocol = EFI_IP4_PROTOCOL;
181530d68baSNigel Croxon EFI_GUID Udp4ServiceBindingProtocol = EFI_UDP4_SERVICE_BINDING_PROTOCOL;
182530d68baSNigel Croxon EFI_GUID Udp4Protocol = EFI_UDP4_PROTOCOL;
183530d68baSNigel Croxon EFI_GUID Tcp4ServiceBindingProtocol = EFI_TCP4_SERVICE_BINDING_PROTOCOL;
184530d68baSNigel Croxon EFI_GUID Tcp4Protocol = EFI_TCP4_PROTOCOL;
185530d68baSNigel Croxon 
186530d68baSNigel Croxon //
187530d68baSNigel Croxon // Pointer protocol GUIDs
188530d68baSNigel Croxon //
189530d68baSNigel Croxon EFI_GUID SimplePointerProtocol    = EFI_SIMPLE_POINTER_PROTOCOL_GUID;
190530d68baSNigel Croxon EFI_GUID AbsolutePointerProtocol  = EFI_ABSOLUTE_POINTER_PROTOCOL_GUID;
191530d68baSNigel Croxon 
192