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 83751cbce3SNigel 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 90751cbce3SNigel Croxon EFI_GUID gEfiDevicePathProtocolGuid = EFI_DEVICE_PATH_PROTOCOL_GUID; 91751cbce3SNigel Croxon EFI_GUID gEfiDevicePathToTextProtocolGuid = EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID; 92751cbce3SNigel Croxon EFI_GUID gEfiDevicePathFromTextProtocolGuid = EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID; 93751cbce3SNigel Croxon EFI_GUID gEfiLoadedImageProtocolGuid = EFI_LOADED_IMAGE_PROTOCOL_GUID; 94751cbce3SNigel Croxon EFI_GUID gEfiSimpleTextInProtocolGuid = EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID; 95751cbce3SNigel Croxon EFI_GUID gEfiSimpleTextOutProtocolGuid = EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID; 96751cbce3SNigel Croxon EFI_GUID gEfiBlockIoProtocolGuid = EFI_BLOCK_IO_PROTOCOL_GUID; 97751cbce3SNigel Croxon EFI_GUID gEfiBlockIo2ProtocolGuid = EFI_BLOCK_IO2_PROTOCOL_GUID; 98751cbce3SNigel Croxon EFI_GUID gEfiDiskIoProtocolGuid = EFI_DISK_IO_PROTOCOL_GUID; 99751cbce3SNigel Croxon EFI_GUID gEfiDiskIo2ProtocolGuid = EFI_DISK_IO2_PROTOCOL_GUID; 100751cbce3SNigel Croxon EFI_GUID gEfiSimpleFileSystemProtocolGuid = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID; 101751cbce3SNigel Croxon EFI_GUID gEfiLoadFileProtocolGuid = EFI_LOAD_FILE_PROTOCOL_GUID; 102751cbce3SNigel Croxon EFI_GUID gEfiDeviceIoProtocolGuid = EFI_DEVICE_IO_PROTOCOL_GUID; 103751cbce3SNigel Croxon EFI_GUID gEfiUnicodeCollationProtocolGuid = EFI_UNICODE_COLLATION_PROTOCOL_GUID; 104751cbce3SNigel Croxon EFI_GUID gEfiSerialIoProtocolGuid = EFI_SERIAL_IO_PROTOCOL_GUID; 105751cbce3SNigel Croxon EFI_GUID gEfiSimpleNetworkProtocolGuid = EFI_SIMPLE_NETWORK_PROTOCOL_GUID; 106751cbce3SNigel Croxon EFI_GUID gEfiPxeBaseCodeProtocolGuid = EFI_PXE_BASE_CODE_PROTOCOL_GUID; 107751cbce3SNigel Croxon EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid = EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_GUID; 108751cbce3SNigel Croxon EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid = EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID; 109751cbce3SNigel Croxon EFI_GUID gEFiUiInterfaceProtocolGuid = EFI_UI_INTERFACE_PROTOCOL_GUID; 110751cbce3SNigel Croxon EFI_GUID gEfiPciIoProtocolGuid = EFI_PCI_IO_PROTOCOL_GUID; 111c108e118SNigel Croxon EFI_GUID gEfiPciRootBridgeIoProtocolGuid = EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID; 112751cbce3SNigel Croxon EFI_GUID gEfiDriverBindingProtocolGuid = EFI_DRIVER_BINDING_PROTOCOL_GUID; 113751cbce3SNigel Croxon EFI_GUID gEfiComponentNameProtocolGuid = EFI_COMPONENT_NAME_PROTOCOL_GUID; 114751cbce3SNigel Croxon EFI_GUID gEfiComponentName2ProtocolGuid = EFI_COMPONENT_NAME2_PROTOCOL_GUID; 115751cbce3SNigel Croxon EFI_GUID gEfiHashProtocolGuid = EFI_HASH_PROTOCOL_GUID; 116751cbce3SNigel Croxon EFI_GUID gEfiPlatformDriverOverrideProtocolGuid = EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID; 117751cbce3SNigel Croxon EFI_GUID gEfiBusSpecificDriverOverrideProtocolGuid = EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID; 118751cbce3SNigel Croxon EFI_GUID gEfiDriverFamilyOverrideProtocolGuid = EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL_GUID; 119*447ad9aaSNigel Croxon EFI_GUID gEfiEbcProtocolGuid = EFI_EBC_PROTOCOL_GUID; 120883702e8SNigel Croxon 121530d68baSNigel Croxon // 122530d68baSNigel Croxon // File system information IDs 123530d68baSNigel Croxon // 124530d68baSNigel Croxon 125751cbce3SNigel Croxon EFI_GUID gEfiFileInfoGuid = EFI_FILE_INFO_ID; 126751cbce3SNigel Croxon EFI_GUID gEfiFileSystemInfoGuid = EFI_FILE_SYSTEM_INFO_ID; 127751cbce3SNigel Croxon EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid = EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID; 128530d68baSNigel Croxon 129530d68baSNigel Croxon // 130530d68baSNigel Croxon // Reference implementation public protocol IDs 131530d68baSNigel Croxon // 132530d68baSNigel Croxon 133530d68baSNigel Croxon EFI_GUID InternalShellProtocol = INTERNAL_SHELL_GUID; 134530d68baSNigel Croxon EFI_GUID VariableStoreProtocol = VARIABLE_STORE_PROTOCOL; 135530d68baSNigel Croxon EFI_GUID LegacyBootProtocol = LEGACY_BOOT_PROTOCOL; 136530d68baSNigel Croxon EFI_GUID VgaClassProtocol = VGA_CLASS_DRIVER_PROTOCOL; 137530d68baSNigel Croxon 138530d68baSNigel Croxon EFI_GUID TextOutSpliterProtocol = TEXT_OUT_SPLITER_PROTOCOL; 139530d68baSNigel Croxon EFI_GUID ErrorOutSpliterProtocol = ERROR_OUT_SPLITER_PROTOCOL; 140530d68baSNigel Croxon EFI_GUID TextInSpliterProtocol = TEXT_IN_SPLITER_PROTOCOL; 141530d68baSNigel Croxon /* Added for GOP support */ 142751cbce3SNigel Croxon EFI_GUID gEfiGraphicsOutputProtocolGuid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; 143751cbce3SNigel Croxon EFI_GUID gEfiEdidDiscoveredProtocolGuid = EFI_EDID_DISCOVERED_PROTOCOL_GUID; 144751cbce3SNigel Croxon EFI_GUID gEfiEdidActiveProtocolGuid = EFI_EDID_ACTIVE_PROTOCOL_GUID; 145751cbce3SNigel Croxon EFI_GUID gEfiEdidOverrideProtocolGuid = EFI_EDID_OVERRIDE_PROTOCOL_GUID; 146530d68baSNigel Croxon 147530d68baSNigel Croxon EFI_GUID AdapterDebugProtocol = ADAPTER_DEBUG_PROTOCOL; 148530d68baSNigel Croxon 149530d68baSNigel Croxon // 150530d68baSNigel Croxon // Device path media protocol IDs 151530d68baSNigel Croxon // 152751cbce3SNigel Croxon EFI_GUID gEfiPcAnsiGuid = EFI_PC_ANSI_GUID; 153751cbce3SNigel Croxon EFI_GUID gEfiVT100Guid = EFI_VT_100_GUID; 154751cbce3SNigel Croxon EFI_GUID gEfiVT100PlusGuid = EFI_VT_100_PLUS_GUID; 155751cbce3SNigel Croxon EFI_GUID gEfiVTUTF8Guid = EFI_VT_UTF8_GUID; 156530d68baSNigel Croxon 157530d68baSNigel Croxon // 158530d68baSNigel Croxon // EFI GPT Partition Type GUIDs 159530d68baSNigel Croxon // 160530d68baSNigel Croxon EFI_GUID EfiPartTypeSystemPartitionGuid = EFI_PART_TYPE_EFI_SYSTEM_PART_GUID; 161530d68baSNigel Croxon EFI_GUID EfiPartTypeLegacyMbrGuid = EFI_PART_TYPE_LEGACY_MBR_GUID; 162530d68baSNigel Croxon 163530d68baSNigel Croxon 164530d68baSNigel Croxon // 165530d68baSNigel Croxon // Reference implementation Vendor Device Path Guids 166530d68baSNigel Croxon // 167530d68baSNigel Croxon EFI_GUID UnknownDevice = UNKNOWN_DEVICE_GUID; 168530d68baSNigel Croxon 169530d68baSNigel Croxon // 170530d68baSNigel Croxon // Configuration Table GUIDs 171530d68baSNigel Croxon // 172530d68baSNigel Croxon 173530d68baSNigel Croxon EFI_GUID MpsTableGuid = MPS_TABLE_GUID; 174530d68baSNigel Croxon EFI_GUID AcpiTableGuid = ACPI_TABLE_GUID; 175530d68baSNigel Croxon EFI_GUID SMBIOSTableGuid = SMBIOS_TABLE_GUID; 176530d68baSNigel Croxon EFI_GUID SalSystemTableGuid = SAL_SYSTEM_TABLE_GUID; 177530d68baSNigel Croxon 178530d68baSNigel Croxon // 179530d68baSNigel Croxon // Network protocol GUIDs 180530d68baSNigel Croxon // 181530d68baSNigel Croxon EFI_GUID Ip4ServiceBindingProtocol = EFI_IP4_SERVICE_BINDING_PROTOCOL; 182530d68baSNigel Croxon EFI_GUID Ip4Protocol = EFI_IP4_PROTOCOL; 183530d68baSNigel Croxon EFI_GUID Udp4ServiceBindingProtocol = EFI_UDP4_SERVICE_BINDING_PROTOCOL; 184530d68baSNigel Croxon EFI_GUID Udp4Protocol = EFI_UDP4_PROTOCOL; 185530d68baSNigel Croxon EFI_GUID Tcp4ServiceBindingProtocol = EFI_TCP4_SERVICE_BINDING_PROTOCOL; 186530d68baSNigel Croxon EFI_GUID Tcp4Protocol = EFI_TCP4_PROTOCOL; 187530d68baSNigel Croxon 188530d68baSNigel Croxon // 189530d68baSNigel Croxon // Pointer protocol GUIDs 190530d68baSNigel Croxon // 191530d68baSNigel Croxon EFI_GUID SimplePointerProtocol = EFI_SIMPLE_POINTER_PROTOCOL_GUID; 192530d68baSNigel Croxon EFI_GUID AbsolutePointerProtocol = EFI_ABSOLUTE_POINTER_PROTOCOL_GUID; 193530d68baSNigel Croxon 194