xref: /DragonStub/lib/data.c (revision b82e6b6f5b2c492479fce3b243c18432fed3dd84)
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 //
283f8935c3SNigel Croxon // ImageHandle - Current ImageHandle, as passed to InitializeLib
293f8935c3SNigel Croxon //
303f8935c3SNigel Croxon EFI_HANDLE LibImageHandle;
313f8935c3SNigel Croxon 
323f8935c3SNigel Croxon //
33530d68baSNigel Croxon // ST - pointer to the EFI system table
34530d68baSNigel Croxon //
35530d68baSNigel Croxon 
36530d68baSNigel Croxon EFI_SYSTEM_TABLE        *ST;
37530d68baSNigel Croxon 
38530d68baSNigel Croxon //
39530d68baSNigel Croxon // BS - pointer to the boot services table
40530d68baSNigel Croxon //
41530d68baSNigel Croxon 
42530d68baSNigel Croxon EFI_BOOT_SERVICES       *BS;
43530d68baSNigel Croxon 
44530d68baSNigel Croxon 
45530d68baSNigel Croxon //
46530d68baSNigel Croxon // Default pool allocation type
47530d68baSNigel Croxon //
48530d68baSNigel Croxon 
49530d68baSNigel Croxon EFI_MEMORY_TYPE PoolAllocationType = EfiBootServicesData;
50530d68baSNigel Croxon 
51530d68baSNigel Croxon //
52530d68baSNigel Croxon // Unicode collation functions that are in use
53530d68baSNigel Croxon //
54530d68baSNigel Croxon 
55530d68baSNigel Croxon EFI_UNICODE_COLLATION_INTERFACE   LibStubUnicodeInterface = {
56530d68baSNigel Croxon     LibStubStriCmp,
57530d68baSNigel Croxon     LibStubMetaiMatch,
58530d68baSNigel Croxon     LibStubStrLwrUpr,
59530d68baSNigel Croxon     LibStubStrLwrUpr,
60530d68baSNigel Croxon     NULL,   // FatToStr
61530d68baSNigel Croxon     NULL,   // StrToFat
62530d68baSNigel Croxon     NULL    // SupportedLanguages
63530d68baSNigel Croxon };
64530d68baSNigel Croxon 
65530d68baSNigel Croxon EFI_UNICODE_COLLATION_INTERFACE   *UnicodeInterface = &LibStubUnicodeInterface;
66530d68baSNigel Croxon 
67530d68baSNigel Croxon //
68530d68baSNigel Croxon // Root device path
69530d68baSNigel Croxon //
70530d68baSNigel Croxon 
71530d68baSNigel Croxon EFI_DEVICE_PATH RootDevicePath[] = {
72530d68baSNigel Croxon    {END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, {END_DEVICE_PATH_LENGTH,0}}
73530d68baSNigel Croxon };
74530d68baSNigel Croxon 
75530d68baSNigel Croxon EFI_DEVICE_PATH EndDevicePath[] = {
76530d68baSNigel Croxon    {END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, {END_DEVICE_PATH_LENGTH, 0}}
77530d68baSNigel Croxon };
78530d68baSNigel Croxon 
79530d68baSNigel Croxon EFI_DEVICE_PATH EndInstanceDevicePath[] = {
80530d68baSNigel Croxon    {END_DEVICE_PATH_TYPE, END_INSTANCE_DEVICE_PATH_SUBTYPE, {END_DEVICE_PATH_LENGTH, 0}}
81530d68baSNigel Croxon };
82530d68baSNigel Croxon 
83530d68baSNigel Croxon 
84530d68baSNigel Croxon //
85530d68baSNigel Croxon // EFI IDs
86530d68baSNigel Croxon //
87530d68baSNigel Croxon 
88751cbce3SNigel Croxon EFI_GUID gEfiGlobalVariableGuid = EFI_GLOBAL_VARIABLE;
89530d68baSNigel Croxon EFI_GUID NullGuid = { 0,0,0,{0,0,0,0,0,0,0,0} };
90530d68baSNigel Croxon 
91530d68baSNigel Croxon //
92530d68baSNigel Croxon // Protocol IDs
93530d68baSNigel Croxon //
94530d68baSNigel Croxon 
95751cbce3SNigel Croxon EFI_GUID gEfiDevicePathProtocolGuid                 = EFI_DEVICE_PATH_PROTOCOL_GUID;
96751cbce3SNigel Croxon EFI_GUID gEfiDevicePathToTextProtocolGuid           = EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID;
97751cbce3SNigel Croxon EFI_GUID gEfiDevicePathFromTextProtocolGuid         = EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID;
98751cbce3SNigel Croxon EFI_GUID gEfiLoadedImageProtocolGuid                = EFI_LOADED_IMAGE_PROTOCOL_GUID;
99751cbce3SNigel Croxon EFI_GUID gEfiSimpleTextInProtocolGuid               = EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID;
100751cbce3SNigel Croxon EFI_GUID gEfiSimpleTextOutProtocolGuid              = EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID;
101751cbce3SNigel Croxon EFI_GUID gEfiBlockIoProtocolGuid                    = EFI_BLOCK_IO_PROTOCOL_GUID;
102751cbce3SNigel Croxon EFI_GUID gEfiBlockIo2ProtocolGuid                   = EFI_BLOCK_IO2_PROTOCOL_GUID;
103751cbce3SNigel Croxon EFI_GUID gEfiDiskIoProtocolGuid                     = EFI_DISK_IO_PROTOCOL_GUID;
104751cbce3SNigel Croxon EFI_GUID gEfiDiskIo2ProtocolGuid                    = EFI_DISK_IO2_PROTOCOL_GUID;
105751cbce3SNigel Croxon EFI_GUID gEfiSimpleFileSystemProtocolGuid           = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID;
106751cbce3SNigel Croxon EFI_GUID gEfiLoadFileProtocolGuid                   = EFI_LOAD_FILE_PROTOCOL_GUID;
107751cbce3SNigel Croxon EFI_GUID gEfiDeviceIoProtocolGuid                   = EFI_DEVICE_IO_PROTOCOL_GUID;
108751cbce3SNigel Croxon EFI_GUID gEfiUnicodeCollationProtocolGuid           = EFI_UNICODE_COLLATION_PROTOCOL_GUID;
109751cbce3SNigel Croxon EFI_GUID gEfiSerialIoProtocolGuid                   = EFI_SERIAL_IO_PROTOCOL_GUID;
110751cbce3SNigel Croxon EFI_GUID gEfiSimpleNetworkProtocolGuid              = EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
111751cbce3SNigel Croxon EFI_GUID gEfiPxeBaseCodeProtocolGuid                = EFI_PXE_BASE_CODE_PROTOCOL_GUID;
112751cbce3SNigel Croxon EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid        = EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_GUID;
113751cbce3SNigel Croxon EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid = EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID;
114751cbce3SNigel Croxon EFI_GUID gEFiUiInterfaceProtocolGuid                = EFI_UI_INTERFACE_PROTOCOL_GUID;
115751cbce3SNigel Croxon EFI_GUID gEfiPciIoProtocolGuid                      = EFI_PCI_IO_PROTOCOL_GUID;
116c108e118SNigel Croxon EFI_GUID gEfiPciRootBridgeIoProtocolGuid            = EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID;
117751cbce3SNigel Croxon EFI_GUID gEfiDriverBindingProtocolGuid              = EFI_DRIVER_BINDING_PROTOCOL_GUID;
118751cbce3SNigel Croxon EFI_GUID gEfiComponentNameProtocolGuid              = EFI_COMPONENT_NAME_PROTOCOL_GUID;
119751cbce3SNigel Croxon EFI_GUID gEfiComponentName2ProtocolGuid             = EFI_COMPONENT_NAME2_PROTOCOL_GUID;
120751cbce3SNigel Croxon EFI_GUID gEfiHashProtocolGuid                       = EFI_HASH_PROTOCOL_GUID;
121751cbce3SNigel Croxon EFI_GUID gEfiPlatformDriverOverrideProtocolGuid     = EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID;
122751cbce3SNigel Croxon EFI_GUID gEfiBusSpecificDriverOverrideProtocolGuid  = EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID;
123751cbce3SNigel Croxon EFI_GUID gEfiDriverFamilyOverrideProtocolGuid       = EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL_GUID;
124447ad9aaSNigel Croxon EFI_GUID gEfiEbcProtocolGuid                        = EFI_EBC_PROTOCOL_GUID;
125883702e8SNigel Croxon 
126530d68baSNigel Croxon //
127530d68baSNigel Croxon // File system information IDs
128530d68baSNigel Croxon //
129530d68baSNigel Croxon 
130751cbce3SNigel Croxon EFI_GUID gEfiFileInfoGuid                           = EFI_FILE_INFO_ID;
131751cbce3SNigel Croxon EFI_GUID gEfiFileSystemInfoGuid                     = EFI_FILE_SYSTEM_INFO_ID;
132751cbce3SNigel Croxon EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid        = EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID;
133530d68baSNigel Croxon 
134530d68baSNigel Croxon //
135530d68baSNigel Croxon // Reference implementation public protocol IDs
136530d68baSNigel Croxon //
137530d68baSNigel Croxon 
138530d68baSNigel Croxon EFI_GUID InternalShellProtocol = INTERNAL_SHELL_GUID;
139530d68baSNigel Croxon EFI_GUID VariableStoreProtocol = VARIABLE_STORE_PROTOCOL;
140530d68baSNigel Croxon EFI_GUID LegacyBootProtocol = LEGACY_BOOT_PROTOCOL;
141530d68baSNigel Croxon EFI_GUID VgaClassProtocol = VGA_CLASS_DRIVER_PROTOCOL;
142530d68baSNigel Croxon 
143530d68baSNigel Croxon EFI_GUID TextOutSpliterProtocol = TEXT_OUT_SPLITER_PROTOCOL;
144530d68baSNigel Croxon EFI_GUID ErrorOutSpliterProtocol = ERROR_OUT_SPLITER_PROTOCOL;
145530d68baSNigel Croxon EFI_GUID TextInSpliterProtocol = TEXT_IN_SPLITER_PROTOCOL;
146530d68baSNigel Croxon /* Added for GOP support */
147751cbce3SNigel Croxon EFI_GUID gEfiGraphicsOutputProtocolGuid             = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
148751cbce3SNigel Croxon EFI_GUID gEfiEdidDiscoveredProtocolGuid             = EFI_EDID_DISCOVERED_PROTOCOL_GUID;
149751cbce3SNigel Croxon EFI_GUID gEfiEdidActiveProtocolGuid                 = EFI_EDID_ACTIVE_PROTOCOL_GUID;
150751cbce3SNigel Croxon EFI_GUID gEfiEdidOverrideProtocolGuid               = EFI_EDID_OVERRIDE_PROTOCOL_GUID;
151530d68baSNigel Croxon 
152530d68baSNigel Croxon EFI_GUID AdapterDebugProtocol = ADAPTER_DEBUG_PROTOCOL;
153530d68baSNigel Croxon 
154530d68baSNigel Croxon //
155530d68baSNigel Croxon // Device path media protocol IDs
156530d68baSNigel Croxon //
157751cbce3SNigel Croxon EFI_GUID gEfiPcAnsiGuid                             = EFI_PC_ANSI_GUID;
158751cbce3SNigel Croxon EFI_GUID gEfiVT100Guid                              = EFI_VT_100_GUID;
159751cbce3SNigel Croxon EFI_GUID gEfiVT100PlusGuid                          = EFI_VT_100_PLUS_GUID;
160751cbce3SNigel Croxon EFI_GUID gEfiVTUTF8Guid                             = EFI_VT_UTF8_GUID;
161530d68baSNigel Croxon 
162530d68baSNigel Croxon //
163530d68baSNigel Croxon // EFI GPT Partition Type GUIDs
164530d68baSNigel Croxon //
165530d68baSNigel Croxon EFI_GUID EfiPartTypeSystemPartitionGuid = EFI_PART_TYPE_EFI_SYSTEM_PART_GUID;
166530d68baSNigel Croxon EFI_GUID EfiPartTypeLegacyMbrGuid = EFI_PART_TYPE_LEGACY_MBR_GUID;
167530d68baSNigel Croxon 
168530d68baSNigel Croxon 
169530d68baSNigel Croxon //
170530d68baSNigel Croxon // Reference implementation Vendor Device Path Guids
171530d68baSNigel Croxon //
172530d68baSNigel Croxon EFI_GUID UnknownDevice      = UNKNOWN_DEVICE_GUID;
173530d68baSNigel Croxon 
174530d68baSNigel Croxon //
175530d68baSNigel Croxon // Configuration Table GUIDs
176530d68baSNigel Croxon //
177530d68baSNigel Croxon 
178530d68baSNigel Croxon EFI_GUID MpsTableGuid             = MPS_TABLE_GUID;
179530d68baSNigel Croxon EFI_GUID AcpiTableGuid            = ACPI_TABLE_GUID;
180530d68baSNigel Croxon EFI_GUID SMBIOSTableGuid          = SMBIOS_TABLE_GUID;
181d857a968SPete Batard EFI_GUID SMBIOS3TableGuid         = SMBIOS3_TABLE_GUID;
182530d68baSNigel Croxon EFI_GUID SalSystemTableGuid       = SAL_SYSTEM_TABLE_GUID;
183530d68baSNigel Croxon 
184530d68baSNigel Croxon //
185530d68baSNigel Croxon // Network protocol GUIDs
186530d68baSNigel Croxon //
187530d68baSNigel Croxon EFI_GUID Ip4ServiceBindingProtocol = EFI_IP4_SERVICE_BINDING_PROTOCOL;
188530d68baSNigel Croxon EFI_GUID Ip4Protocol = EFI_IP4_PROTOCOL;
189530d68baSNigel Croxon EFI_GUID Udp4ServiceBindingProtocol = EFI_UDP4_SERVICE_BINDING_PROTOCOL;
190530d68baSNigel Croxon EFI_GUID Udp4Protocol = EFI_UDP4_PROTOCOL;
191530d68baSNigel Croxon EFI_GUID Tcp4ServiceBindingProtocol = EFI_TCP4_SERVICE_BINDING_PROTOCOL;
192530d68baSNigel Croxon EFI_GUID Tcp4Protocol = EFI_TCP4_PROTOCOL;
193530d68baSNigel Croxon 
194530d68baSNigel Croxon //
195530d68baSNigel Croxon // Pointer protocol GUIDs
196530d68baSNigel Croxon //
197530d68baSNigel Croxon EFI_GUID SimplePointerProtocol    = EFI_SIMPLE_POINTER_PROTOCOL_GUID;
198530d68baSNigel Croxon EFI_GUID AbsolutePointerProtocol  = EFI_ABSOLUTE_POINTER_PROTOCOL_GUID;
199530d68baSNigel Croxon 
200b14cc9cbSNigel Croxon //
201b14cc9cbSNigel Croxon // Debugger protocol GUIDs
202b14cc9cbSNigel Croxon //
203b14cc9cbSNigel Croxon EFI_GUID gEfiDebugImageInfoTableGuid           = EFI_DEBUG_IMAGE_INFO_TABLE_GUID;
204b14cc9cbSNigel Croxon EFI_GUID gEfiDebugSupportProtocolGuid          = EFI_DEBUG_SUPPORT_PROTOCOL_GUID;
205*b82e6b6fSKagurazaka Kotori 
206*b82e6b6fSKagurazaka Kotori //
207*b82e6b6fSKagurazaka Kotori // Console extension protocol GUIDs
208*b82e6b6fSKagurazaka Kotori //
209*b82e6b6fSKagurazaka Kotori EFI_GUID SimpleTextInputExProtocol = EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID;
210