xref: /DragonStub/lib/data.c (revision 883702e8133ce1e50fa199aa80179b49b35c998b)
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 // ST - pointer to the EFI system table
29 //
30 
31 EFI_SYSTEM_TABLE        *ST;
32 
33 //
34 // BS - pointer to the boot services table
35 //
36 
37 EFI_BOOT_SERVICES       *BS;
38 
39 
40 //
41 // Default pool allocation type
42 //
43 
44 EFI_MEMORY_TYPE PoolAllocationType = EfiBootServicesData;
45 
46 //
47 // Unicode collation functions that are in use
48 //
49 
50 EFI_UNICODE_COLLATION_INTERFACE   LibStubUnicodeInterface = {
51     LibStubStriCmp,
52     LibStubMetaiMatch,
53     LibStubStrLwrUpr,
54     LibStubStrLwrUpr,
55     NULL,   // FatToStr
56     NULL,   // StrToFat
57     NULL    // SupportedLanguages
58 };
59 
60 EFI_UNICODE_COLLATION_INTERFACE   *UnicodeInterface = &LibStubUnicodeInterface;
61 
62 //
63 // Root device path
64 //
65 
66 EFI_DEVICE_PATH RootDevicePath[] = {
67    {END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, {END_DEVICE_PATH_LENGTH,0}}
68 };
69 
70 EFI_DEVICE_PATH EndDevicePath[] = {
71    {END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, {END_DEVICE_PATH_LENGTH, 0}}
72 };
73 
74 EFI_DEVICE_PATH EndInstanceDevicePath[] = {
75    {END_DEVICE_PATH_TYPE, END_INSTANCE_DEVICE_PATH_SUBTYPE, {END_DEVICE_PATH_LENGTH, 0}}
76 };
77 
78 
79 //
80 // EFI IDs
81 //
82 
83 EFI_GUID EfiGlobalVariable  = EFI_GLOBAL_VARIABLE;
84 EFI_GUID NullGuid = { 0,0,0,{0,0,0,0,0,0,0,0} };
85 
86 //
87 // Protocol IDs
88 //
89 
90 EFI_GUID DevicePathProtocol       = DEVICE_PATH_PROTOCOL;
91 EFI_GUID LoadedImageProtocol      = LOADED_IMAGE_PROTOCOL;
92 EFI_GUID TextInProtocol           = SIMPLE_TEXT_INPUT_PROTOCOL;
93 EFI_GUID TextOutProtocol          = SIMPLE_TEXT_OUTPUT_PROTOCOL;
94 EFI_GUID BlockIoProtocol          = BLOCK_IO_PROTOCOL;
95 EFI_GUID DiskIoProtocol           = DISK_IO_PROTOCOL;
96 EFI_GUID FileSystemProtocol       = SIMPLE_FILE_SYSTEM_PROTOCOL;
97 EFI_GUID LoadFileProtocol         = LOAD_FILE_PROTOCOL;
98 EFI_GUID DeviceIoProtocol         = DEVICE_IO_PROTOCOL;
99 EFI_GUID UnicodeCollationProtocol = UNICODE_COLLATION_PROTOCOL;
100 EFI_GUID SerialIoProtocol         = SERIAL_IO_PROTOCOL;
101 EFI_GUID SimpleNetworkProtocol    = EFI_SIMPLE_NETWORK_PROTOCOL;
102 EFI_GUID PxeBaseCodeProtocol      = EFI_PXE_BASE_CODE_PROTOCOL;
103 EFI_GUID PxeCallbackProtocol      = EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL;
104 EFI_GUID NetworkInterfaceIdentifierProtocol = EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL;
105 EFI_GUID UiProtocol               = EFI_UI_PROTOCOL;
106 EFI_GUID PciIoProtocol            = EFI_PCI_IO_PROTOCOL;
107 EFI_GUID DriverBindingProtocol    = DRIVER_BINDING_PROTOCOL;
108 EFI_GUID ComponentNameProtocol    = COMPONENT_NAME_PROTOCOL;
109 EFI_GUID ComponentName2Protocol   = COMPONENT_NAME2_PROTOCOL;
110 
111 //
112 // File system information IDs
113 //
114 
115 EFI_GUID GenericFileInfo           = EFI_FILE_INFO_ID;
116 EFI_GUID FileSystemInfo            = EFI_FILE_SYSTEM_INFO_ID;
117 EFI_GUID FileSystemVolumeLabelInfo = EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID;
118 
119 //
120 // Reference implementation public protocol IDs
121 //
122 
123 EFI_GUID InternalShellProtocol = INTERNAL_SHELL_GUID;
124 EFI_GUID VariableStoreProtocol = VARIABLE_STORE_PROTOCOL;
125 EFI_GUID LegacyBootProtocol = LEGACY_BOOT_PROTOCOL;
126 EFI_GUID VgaClassProtocol = VGA_CLASS_DRIVER_PROTOCOL;
127 
128 EFI_GUID TextOutSpliterProtocol = TEXT_OUT_SPLITER_PROTOCOL;
129 EFI_GUID ErrorOutSpliterProtocol = ERROR_OUT_SPLITER_PROTOCOL;
130 EFI_GUID TextInSpliterProtocol = TEXT_IN_SPLITER_PROTOCOL;
131 /* Added for GOP support */
132 EFI_GUID GraphicsOutputProtocol = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
133 
134 EFI_GUID AdapterDebugProtocol = ADAPTER_DEBUG_PROTOCOL;
135 
136 //
137 // Device path media protocol IDs
138 //
139 EFI_GUID PcAnsiProtocol = DEVICE_PATH_MESSAGING_PC_ANSI;
140 EFI_GUID Vt100Protocol  = DEVICE_PATH_MESSAGING_VT_100;
141 
142 //
143 // EFI GPT Partition Type GUIDs
144 //
145 EFI_GUID EfiPartTypeSystemPartitionGuid = EFI_PART_TYPE_EFI_SYSTEM_PART_GUID;
146 EFI_GUID EfiPartTypeLegacyMbrGuid = EFI_PART_TYPE_LEGACY_MBR_GUID;
147 
148 
149 //
150 // Reference implementation Vendor Device Path Guids
151 //
152 EFI_GUID UnknownDevice      = UNKNOWN_DEVICE_GUID;
153 
154 //
155 // Configuration Table GUIDs
156 //
157 
158 EFI_GUID MpsTableGuid             = MPS_TABLE_GUID;
159 EFI_GUID AcpiTableGuid            = ACPI_TABLE_GUID;
160 EFI_GUID SMBIOSTableGuid          = SMBIOS_TABLE_GUID;
161 EFI_GUID SalSystemTableGuid       = SAL_SYSTEM_TABLE_GUID;
162 
163 //
164 // Network protocol GUIDs
165 //
166 EFI_GUID Ip4ServiceBindingProtocol = EFI_IP4_SERVICE_BINDING_PROTOCOL;
167 EFI_GUID Ip4Protocol = EFI_IP4_PROTOCOL;
168 EFI_GUID Udp4ServiceBindingProtocol = EFI_UDP4_SERVICE_BINDING_PROTOCOL;
169 EFI_GUID Udp4Protocol = EFI_UDP4_PROTOCOL;
170 EFI_GUID Tcp4ServiceBindingProtocol = EFI_TCP4_SERVICE_BINDING_PROTOCOL;
171 EFI_GUID Tcp4Protocol = EFI_TCP4_PROTOCOL;
172 
173 //
174 // Pointer protocol GUIDs
175 //
176 EFI_GUID SimplePointerProtocol    = EFI_SIMPLE_POINTER_PROTOCOL_GUID;
177 EFI_GUID AbsolutePointerProtocol  = EFI_ABSOLUTE_POINTER_PROTOCOL_GUID;
178 
179