xref: /DragonStub/lib/data.c (revision 2a1200f36faf0d67c7150686e44c578c19a897ef)
1 /*++
2 
3 Copyright (c) 1998  Intel Corporation
4 
5 Module Name:
6 
7     data.c
8 
9 Abstract:
10 
11     EFI library global data
12 
13 
14 
15 Revision History
16 
17 --*/
18 
19 #include "lib.h"
20 
21 //
22 // LibInitialized - TRUE once InitializeLib() is called for the first time
23 //
24 
25 BOOLEAN  LibInitialized = FALSE;
26 
27 //
28 // ImageHandle - Current ImageHandle, as passed to InitializeLib
29 //
30 EFI_HANDLE LibImageHandle;
31 
32 //
33 // ST - pointer to the EFI system table
34 //
35 
36 EFI_SYSTEM_TABLE        *ST;
37 
38 //
39 // BS - pointer to the boot services table
40 //
41 
42 EFI_BOOT_SERVICES       *BS;
43 
44 
45 //
46 // Default pool allocation type
47 //
48 
49 EFI_MEMORY_TYPE PoolAllocationType = EfiBootServicesData;
50 
51 //
52 // Unicode collation functions that are in use
53 //
54 
55 EFI_UNICODE_COLLATION_INTERFACE   LibStubUnicodeInterface = {
56     LibStubStriCmp,
57     LibStubMetaiMatch,
58     LibStubStrLwrUpr,
59     LibStubStrLwrUpr,
60     NULL,   // FatToStr
61     NULL,   // StrToFat
62     NULL    // SupportedLanguages
63 };
64 
65 EFI_UNICODE_COLLATION_INTERFACE   *UnicodeInterface = &LibStubUnicodeInterface;
66 
67 //
68 // Root device path
69 //
70 
71 EFI_DEVICE_PATH RootDevicePath[] = {
72    {END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, {END_DEVICE_PATH_LENGTH,0}}
73 };
74 
75 EFI_DEVICE_PATH EndDevicePath[] = {
76    {END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, {END_DEVICE_PATH_LENGTH, 0}}
77 };
78 
79 EFI_DEVICE_PATH EndInstanceDevicePath[] = {
80    {END_DEVICE_PATH_TYPE, END_INSTANCE_DEVICE_PATH_SUBTYPE, {END_DEVICE_PATH_LENGTH, 0}}
81 };
82 
83 
84 //
85 // EFI IDs
86 //
87 
88 EFI_GUID gEfiGlobalVariableGuid = EFI_GLOBAL_VARIABLE;
89 EFI_GUID NullGuid = { 0,0,0,{0,0,0,0,0,0,0,0} };
90 
91 //
92 // Protocol IDs
93 //
94 
95 EFI_GUID gEfiDevicePathProtocolGuid                 = EFI_DEVICE_PATH_PROTOCOL_GUID;
96 EFI_GUID gEfiDevicePathToTextProtocolGuid           = EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID;
97 EFI_GUID gEfiDevicePathFromTextProtocolGuid         = EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID;
98 EFI_GUID gEfiDevicePathUtilitiesProtocolGuid        = EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID;
99 EFI_GUID gEfiLoadedImageProtocolGuid                = EFI_LOADED_IMAGE_PROTOCOL_GUID;
100 EFI_GUID gEfiSimpleTextInProtocolGuid               = EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID;
101 EFI_GUID gEfiSimpleTextOutProtocolGuid              = EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID;
102 EFI_GUID gEfiBlockIoProtocolGuid                    = EFI_BLOCK_IO_PROTOCOL_GUID;
103 EFI_GUID gEfiBlockIo2ProtocolGuid                   = EFI_BLOCK_IO2_PROTOCOL_GUID;
104 EFI_GUID gEfiDiskIoProtocolGuid                     = EFI_DISK_IO_PROTOCOL_GUID;
105 EFI_GUID gEfiDiskIo2ProtocolGuid                    = EFI_DISK_IO2_PROTOCOL_GUID;
106 EFI_GUID gEfiSimpleFileSystemProtocolGuid           = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID;
107 EFI_GUID gEfiLoadFileProtocolGuid                   = EFI_LOAD_FILE_PROTOCOL_GUID;
108 EFI_GUID gEfiDeviceIoProtocolGuid                   = EFI_DEVICE_IO_PROTOCOL_GUID;
109 EFI_GUID gEfiUnicodeCollationProtocolGuid           = EFI_UNICODE_COLLATION_PROTOCOL_GUID;
110 EFI_GUID gEfiSerialIoProtocolGuid                   = EFI_SERIAL_IO_PROTOCOL_GUID;
111 EFI_GUID gEfiSimpleNetworkProtocolGuid              = EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
112 EFI_GUID gEfiPxeBaseCodeProtocolGuid                = EFI_PXE_BASE_CODE_PROTOCOL_GUID;
113 EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid        = EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_GUID;
114 EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid = EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID;
115 EFI_GUID gEFiUiInterfaceProtocolGuid                = EFI_UI_INTERFACE_PROTOCOL_GUID;
116 EFI_GUID gEfiPciIoProtocolGuid                      = EFI_PCI_IO_PROTOCOL_GUID;
117 EFI_GUID gEfiPciRootBridgeIoProtocolGuid            = EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID;
118 EFI_GUID gEfiDriverBindingProtocolGuid              = EFI_DRIVER_BINDING_PROTOCOL_GUID;
119 EFI_GUID gEfiComponentNameProtocolGuid              = EFI_COMPONENT_NAME_PROTOCOL_GUID;
120 EFI_GUID gEfiComponentName2ProtocolGuid             = EFI_COMPONENT_NAME2_PROTOCOL_GUID;
121 EFI_GUID gEfiHashProtocolGuid                       = EFI_HASH_PROTOCOL_GUID;
122 EFI_GUID gEfiPlatformDriverOverrideProtocolGuid     = EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID;
123 EFI_GUID gEfiBusSpecificDriverOverrideProtocolGuid  = EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID;
124 EFI_GUID gEfiDriverFamilyOverrideProtocolGuid       = EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL_GUID;
125 EFI_GUID gEfiEbcProtocolGuid                        = EFI_EBC_PROTOCOL_GUID;
126 
127 //
128 // File system information IDs
129 //
130 
131 EFI_GUID gEfiFileInfoGuid                           = EFI_FILE_INFO_ID;
132 EFI_GUID gEfiFileSystemInfoGuid                     = EFI_FILE_SYSTEM_INFO_ID;
133 EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid        = EFI_FILE_SYSTEM_VOLUME_LABEL_ID;
134 
135 //
136 // Reference implementation public protocol IDs
137 //
138 
139 EFI_GUID InternalShellProtocol = INTERNAL_SHELL_GUID;
140 EFI_GUID VariableStoreProtocol = VARIABLE_STORE_PROTOCOL;
141 EFI_GUID LegacyBootProtocol = LEGACY_BOOT_PROTOCOL;
142 EFI_GUID VgaClassProtocol = VGA_CLASS_DRIVER_PROTOCOL;
143 
144 EFI_GUID TextOutSpliterProtocol = TEXT_OUT_SPLITER_PROTOCOL;
145 EFI_GUID ErrorOutSpliterProtocol = ERROR_OUT_SPLITER_PROTOCOL;
146 EFI_GUID TextInSpliterProtocol = TEXT_IN_SPLITER_PROTOCOL;
147 /* Added for GOP support */
148 EFI_GUID gEfiGraphicsOutputProtocolGuid             = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
149 EFI_GUID gEfiEdidDiscoveredProtocolGuid             = EFI_EDID_DISCOVERED_PROTOCOL_GUID;
150 EFI_GUID gEfiEdidActiveProtocolGuid                 = EFI_EDID_ACTIVE_PROTOCOL_GUID;
151 EFI_GUID gEfiEdidOverrideProtocolGuid               = EFI_EDID_OVERRIDE_PROTOCOL_GUID;
152 
153 EFI_GUID AdapterDebugProtocol = ADAPTER_DEBUG_PROTOCOL;
154 
155 //
156 // Device path media protocol IDs
157 //
158 EFI_GUID gEfiPcAnsiGuid                             = EFI_PC_ANSI_GUID;
159 EFI_GUID gEfiVT100Guid                              = EFI_VT_100_GUID;
160 EFI_GUID gEfiVT100PlusGuid                          = EFI_VT_100_PLUS_GUID;
161 EFI_GUID gEfiVTUTF8Guid                             = EFI_VT_UTF8_GUID;
162 
163 //
164 // EFI GPT Partition Type GUIDs
165 //
166 EFI_GUID EfiPartTypeSystemPartitionGuid = EFI_PART_TYPE_EFI_SYSTEM_PART_GUID;
167 EFI_GUID EfiPartTypeLegacyMbrGuid = EFI_PART_TYPE_LEGACY_MBR_GUID;
168 
169 
170 //
171 // Reference implementation Vendor Device Path Guids
172 //
173 EFI_GUID UnknownDevice      = UNKNOWN_DEVICE_GUID;
174 
175 //
176 // Configuration Table GUIDs
177 //
178 
179 EFI_GUID MpsTableGuid             = MPS_TABLE_GUID;
180 EFI_GUID AcpiTableGuid            = ACPI_TABLE_GUID;
181 EFI_GUID SMBIOSTableGuid          = SMBIOS_TABLE_GUID;
182 EFI_GUID SMBIOS3TableGuid         = SMBIOS3_TABLE_GUID;
183 EFI_GUID SalSystemTableGuid       = SAL_SYSTEM_TABLE_GUID;
184 
185 //
186 // Network protocol GUIDs
187 //
188 EFI_GUID Ip4ServiceBindingProtocol = EFI_IP4_SERVICE_BINDING_PROTOCOL;
189 EFI_GUID Ip4Protocol = EFI_IP4_PROTOCOL;
190 EFI_GUID Udp4ServiceBindingProtocol = EFI_UDP4_SERVICE_BINDING_PROTOCOL;
191 EFI_GUID Udp4Protocol = EFI_UDP4_PROTOCOL;
192 EFI_GUID Tcp4ServiceBindingProtocol = EFI_TCP4_SERVICE_BINDING_PROTOCOL;
193 EFI_GUID Tcp4Protocol = EFI_TCP4_PROTOCOL;
194 
195 //
196 // Pointer protocol GUIDs
197 //
198 EFI_GUID SimplePointerProtocol   = EFI_SIMPLE_POINTER_PROTOCOL_GUID;
199 EFI_GUID AbsolutePointerProtocol = EFI_ABSOLUTE_POINTER_PROTOCOL_GUID;
200 
201 //
202 // Debugger protocol GUIDs
203 //
204 EFI_GUID gEfiDebugImageInfoTableGuid  = EFI_DEBUG_IMAGE_INFO_TABLE_GUID;
205 EFI_GUID gEfiDebugSupportProtocolGuid = EFI_DEBUG_SUPPORT_PROTOCOL_GUID;
206 
207 //
208 // Console extension protocol GUIDs
209 //
210 EFI_GUID SimpleTextInputExProtocol = EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID;
211 
212 //
213 // Shell protocol GUIDs
214 //
215 EFI_GUID ShellProtocolGuid               = EFI_SHELL_PROTOCOL_GUID;
216 EFI_GUID ShellParametersProtocolGuid     = EFI_SHELL_PARAMETERS_PROTOCOL_GUID;
217 EFI_GUID ShellDynamicCommandProtocolGuid = EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_GUID;
218