1530d68baSNigel Croxon #ifndef _EFILIB_INCLUDE_ 2530d68baSNigel Croxon #define _EFILIB_INCLUDE_ 3530d68baSNigel Croxon 4530d68baSNigel Croxon /*++ 5530d68baSNigel Croxon 6530d68baSNigel Croxon Copyright (c) 2000 Intel Corporation 7530d68baSNigel Croxon 8530d68baSNigel Croxon Module Name: 9530d68baSNigel Croxon 10530d68baSNigel Croxon efilib.h 11530d68baSNigel Croxon 12530d68baSNigel Croxon Abstract: 13530d68baSNigel Croxon 14530d68baSNigel Croxon EFI library functions 15530d68baSNigel Croxon 16530d68baSNigel Croxon 17530d68baSNigel Croxon 18530d68baSNigel Croxon Revision History 19530d68baSNigel Croxon 20530d68baSNigel Croxon --*/ 21530d68baSNigel Croxon 225e85f477SCallum Farmer #ifdef __cplusplus 235e85f477SCallum Farmer extern "C" { 245e85f477SCallum Farmer #endif 255e85f477SCallum Farmer 26530d68baSNigel Croxon #include "efidebug.h" 27530d68baSNigel Croxon #include "efipart.h" 28b1c7a1c5SPete Batard #if defined(_M_X64) || defined(__x86_64__) || defined(__amd64__) 29b1c7a1c5SPete Batard #include "x86_64/efilibplat.h" 30b1c7a1c5SPete Batard #elif defined(_M_IX86) || defined(__i386__) 31b1c7a1c5SPete Batard #include "ia32/efilibplat.h" 32b1c7a1c5SPete Batard #elif defined(_M_IA64) || defined(__ia64__) 33b1c7a1c5SPete Batard #include "ia64/efilibplat.h" 34b1c7a1c5SPete Batard #elif defined (_M_ARM64) || defined(__aarch64__) 35b1c7a1c5SPete Batard #include "aarch64/efilibplat.h" 36b1c7a1c5SPete Batard #elif defined (_M_ARM) || defined(__arm__) 37b1c7a1c5SPete Batard #include "arm/efilibplat.h" 386b285635SFabrice Fontaine #elif defined (_M_MIPS64) || defined(__mips64__) || defined(__mips64) 39b1c7a1c5SPete Batard #include "mips64el/efilibplat.h" 40b95f138fSHeinrich Schuchardt #elif defined (__riscv) && __riscv_xlen == 64 41b95f138fSHeinrich Schuchardt #include "riscv64/efilibplat.h" 42e7db4418Szhoumingtao #elif defined (__loongarch64) 43e7db4418Szhoumingtao #include "loongarch64/efilibplat.h" 44b1c7a1c5SPete Batard #endif 45530d68baSNigel Croxon #include "efilink.h" 46530d68baSNigel Croxon #include "efirtlib.h" 47530d68baSNigel Croxon #include "efistdarg.h" 48530d68baSNigel Croxon #include "pci22.h" 49530d68baSNigel Croxon #include "libsmbios.h" 50530d68baSNigel Croxon 51530d68baSNigel Croxon // 52530d68baSNigel Croxon // Public read-only data in the EFI library 53530d68baSNigel Croxon // 54530d68baSNigel Croxon 55530d68baSNigel Croxon extern EFI_SYSTEM_TABLE *ST; 569cdd67daSNigel Croxon #define gST ST 57530d68baSNigel Croxon extern EFI_BOOT_SERVICES *BS; 589cdd67daSNigel Croxon #define gBS BS 59530d68baSNigel Croxon extern EFI_RUNTIME_SERVICES *RT; 609cdd67daSNigel Croxon #define gRT RT 61530d68baSNigel Croxon 62751cbce3SNigel Croxon extern EFI_GUID gEfiDevicePathProtocolGuid; 63751cbce3SNigel Croxon #define DevicePathProtocol gEfiDevicePathProtocolGuid 64751cbce3SNigel Croxon extern EFI_GUID gEfiDevicePathToTextProtocolGuid; 65751cbce3SNigel Croxon #define DevicePathToTextProtocol gEfiDevicePathToTextProtocolGuid 66751cbce3SNigel Croxon extern EFI_GUID gEfiDevicePathFromTextProtocolGuid; 67751cbce3SNigel Croxon #define DevicePathFromTextProtocol gEfiDevicePathFromTextProtocolGuid 68ce0bd62fSKagurazaka Kotori extern EFI_GUID gEfiDevicePathUtilitiesProtocolGuid; 69ce0bd62fSKagurazaka Kotori #define DevicePathUtilitiesProtocol gEfiDevicePathUtilitiesProtocolGuid 70751cbce3SNigel Croxon extern EFI_GUID gEfiLoadedImageProtocolGuid; 71751cbce3SNigel Croxon #define LoadedImageProtocol gEfiLoadedImageProtocolGuid 72751cbce3SNigel Croxon extern EFI_GUID gEfiSimpleTextInProtocolGuid; 73751cbce3SNigel Croxon #define TextInProtocol gEfiSimpleTextInProtocolGuid 74751cbce3SNigel Croxon extern EFI_GUID gEfiSimpleTextOutProtocolGuid; 75751cbce3SNigel Croxon #define TextOutProtocol gEfiSimpleTextOutProtocolGuid 76751cbce3SNigel Croxon extern EFI_GUID gEfiGraphicsOutputProtocolGuid; 77751cbce3SNigel Croxon #define GraphicsOutputProtocol gEfiGraphicsOutputProtocolGuid 78751cbce3SNigel Croxon extern EFI_GUID gEfiEdidDiscoveredProtocolGuid; 79751cbce3SNigel Croxon #define EdidDiscoveredProtocol gEfiEdidDiscoveredProtocolGuid 80751cbce3SNigel Croxon extern EFI_GUID gEfiEdidActiveProtocolGuid; 81751cbce3SNigel Croxon #define EdidActiveProtocol gEfiEdidActiveProtocolGuid 82751cbce3SNigel Croxon extern EFI_GUID gEfiEdidOverrideProtocolGuid; 83751cbce3SNigel Croxon #define EdidOverrideProtocol gEfiEdidOverrideProtocolGuid 84751cbce3SNigel Croxon extern EFI_GUID gEfiBlockIoProtocolGuid; 85751cbce3SNigel Croxon #define BlockIoProtocol gEfiBlockIoProtocolGuid 86751cbce3SNigel Croxon extern EFI_GUID gEfiBlockIo2ProtocolGuid; 87751cbce3SNigel Croxon #define BlockIo2Protocol gEfiBlockIo2ProtocolGuid 88751cbce3SNigel Croxon extern EFI_GUID gEfiDiskIoProtocolGuid; 89751cbce3SNigel Croxon #define DiskIoProtocol gEfiDiskIoProtocolGuid 90751cbce3SNigel Croxon extern EFI_GUID gEfiDiskIo2ProtocolGuid; 91751cbce3SNigel Croxon #define DiskIo2Protocol gEfiDiskIo2ProtocolGuid 92751cbce3SNigel Croxon extern EFI_GUID gEfiSimpleFileSystemProtocolGuid; 93751cbce3SNigel Croxon #define FileSystemProtocol gEfiSimpleFileSystemProtocolGuid 94751cbce3SNigel Croxon extern EFI_GUID gEfiLoadFileProtocolGuid; 95751cbce3SNigel Croxon #define LoadFileProtocol gEfiLoadFileProtocolGuid 96751cbce3SNigel Croxon extern EFI_GUID gEfiDeviceIoProtocolGuid; 97751cbce3SNigel Croxon #define DeviceIoProtocol gEfiDeviceIoProtocolGuid 98530d68baSNigel Croxon extern EFI_GUID VariableStoreProtocol; 99530d68baSNigel Croxon extern EFI_GUID LegacyBootProtocol; 100751cbce3SNigel Croxon extern EFI_GUID gEfiUnicodeCollationProtocolGuid; 101751cbce3SNigel Croxon #define UnicodeCollationProtocol gEfiUnicodeCollationProtocolGuid 102751cbce3SNigel Croxon extern EFI_GUID gEfiSerialIoProtocolGuid; 103751cbce3SNigel Croxon #define SerialIoProtocol gEfiSerialIoProtocolGuid 104530d68baSNigel Croxon extern EFI_GUID VgaClassProtocol; 105530d68baSNigel Croxon extern EFI_GUID TextOutSpliterProtocol; 106530d68baSNigel Croxon extern EFI_GUID ErrorOutSpliterProtocol; 107530d68baSNigel Croxon extern EFI_GUID TextInSpliterProtocol; 108751cbce3SNigel Croxon extern EFI_GUID gEfiSimpleNetworkProtocolGuid; 109751cbce3SNigel Croxon #define SimpleNetworkProtocol gEfiSimpleNetworkProtocolGuid 110751cbce3SNigel Croxon extern EFI_GUID gEfiPxeBaseCodeProtocolGuid; 111751cbce3SNigel Croxon #define PxeBaseCodeProtocol gEfiPxeBaseCodeProtocolGuid 112751cbce3SNigel Croxon extern EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid; 113751cbce3SNigel Croxon #define PxeCallbackProtocol gEfiPxeBaseCodeCallbackProtocolGuid 114751cbce3SNigel Croxon extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid; 115751cbce3SNigel Croxon #define NetworkInterfaceIdentifierProtocol gEfiNetworkInterfaceIdentifierProtocolGuid 116751cbce3SNigel Croxon extern EFI_GUID gEFiUiInterfaceProtocolGuid; 117751cbce3SNigel Croxon #define UiProtocol gEFiUiInterfaceProtocolGuid 118530d68baSNigel Croxon extern EFI_GUID InternalShellProtocol; 119751cbce3SNigel Croxon extern EFI_GUID gEfiPciIoProtocolGuid; 120751cbce3SNigel Croxon #define PciIoProtocol gEfiPciIoProtocolGuid 121c108e118SNigel Croxon extern EFI_GUID gEfiPciRootBridgeIoProtocolGuid; 122751cbce3SNigel Croxon extern EFI_GUID gEfiDriverBindingProtocolGuid; 123751cbce3SNigel Croxon #define DriverBindingProtocol gEfiDriverBindingProtocolGuid 124751cbce3SNigel Croxon extern EFI_GUID gEfiComponentNameProtocolGuid; 125751cbce3SNigel Croxon #define ComponentNameProtocol gEfiComponentNameProtocolGuid 126751cbce3SNigel Croxon extern EFI_GUID gEfiComponentName2ProtocolGuid; 127751cbce3SNigel Croxon #define ComponentName2Protocol gEfiComponentName2ProtocolGuid 128751cbce3SNigel Croxon extern EFI_GUID gEfiHashProtocolGuid; 129751cbce3SNigel Croxon #define HashProtocol gEfiHashProtocolGuid 130751cbce3SNigel Croxon extern EFI_GUID gEfiPlatformDriverOverrideProtocolGuid; 131751cbce3SNigel Croxon #define PlatformDriverOverrideProtocol gEfiPlatformDriverOverrideProtocolGuid 132751cbce3SNigel Croxon extern EFI_GUID gEfiBusSpecificDriverOverrideProtocolGuid; 133751cbce3SNigel Croxon #define BusSpecificDriverOverrideProtocol gEfiBusSpecificDriverOverrideProtocolGuid 134751cbce3SNigel Croxon extern EFI_GUID gEfiDriverFamilyOverrideProtocolGuid; 135751cbce3SNigel Croxon #define DriverFamilyOverrideProtocol gEfiDriverFamilyOverrideProtocolGuid 136447ad9aaSNigel Croxon extern EFI_GUID gEfiEbcProtocolGuid; 137530d68baSNigel Croxon 138751cbce3SNigel Croxon extern EFI_GUID gEfiGlobalVariableGuid; 139751cbce3SNigel Croxon #define EfiGlobalVariable gEfiGlobalVariableGuid 140751cbce3SNigel Croxon extern EFI_GUID gEfiFileInfoGuid; 141751cbce3SNigel Croxon #define GenericFileInfo gEfiFileInfoGuid 142751cbce3SNigel Croxon extern EFI_GUID gEfiFileSystemInfoGuid; 143751cbce3SNigel Croxon #define FileSystemInfo gEfiFileSystemInfoGuid 144751cbce3SNigel Croxon extern EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid; 145751cbce3SNigel Croxon #define FileSystemVolumeLabelInfo gEfiFileSystemVolumeLabelInfoIdGuid 146751cbce3SNigel Croxon extern EFI_GUID gEfiPcAnsiGuid; 147751cbce3SNigel Croxon #define PcAnsiProtocol gEfiPcAnsiGuid 148751cbce3SNigel Croxon extern EFI_GUID gEfiVT100Guid; 149751cbce3SNigel Croxon #define Vt100Protocol gEfiVT100Guid 150751cbce3SNigel Croxon extern EFI_GUID gEfiVT100PlusGuid; 151751cbce3SNigel Croxon extern EFI_GUID gEfiVTUTF8Guid; 152751cbce3SNigel Croxon 153530d68baSNigel Croxon extern EFI_GUID NullGuid; 154530d68baSNigel Croxon extern EFI_GUID UnknownDevice; 155530d68baSNigel Croxon 156530d68baSNigel Croxon extern EFI_GUID EfiPartTypeSystemPartitionGuid; 157530d68baSNigel Croxon extern EFI_GUID EfiPartTypeLegacyMbrGuid; 158530d68baSNigel Croxon 159530d68baSNigel Croxon extern EFI_GUID MpsTableGuid; 160530d68baSNigel Croxon extern EFI_GUID AcpiTableGuid; 161530d68baSNigel Croxon extern EFI_GUID SMBIOSTableGuid; 162d857a968SPete Batard extern EFI_GUID SMBIOS3TableGuid; 163530d68baSNigel Croxon extern EFI_GUID SalSystemTableGuid; 164fbbbf47eSAlfonso Sánchez-Beato extern EFI_GUID EfiDtbTableGuid; 165530d68baSNigel Croxon 166530d68baSNigel Croxon extern EFI_GUID SimplePointerProtocol; 167530d68baSNigel Croxon extern EFI_GUID AbsolutePointerProtocol; 168530d68baSNigel Croxon 169b14cc9cbSNigel Croxon extern EFI_GUID gEfiDebugImageInfoTableGuid; 170b14cc9cbSNigel Croxon extern EFI_GUID gEfiDebugSupportProtocolGuid; 171b14cc9cbSNigel Croxon 172b82e6b6fSKagurazaka Kotori extern EFI_GUID SimpleTextInputExProtocol; 173b82e6b6fSKagurazaka Kotori 1742b26c811SJiaqing Zhao extern EFI_GUID ShellProtocolGuid; 175773f30afSJiaqing Zhao extern EFI_GUID ShellParametersProtocolGuid; 1766c04004fSJiaqing Zhao extern EFI_GUID ShellDynamicCommandProtocolGuid; 1772b26c811SJiaqing Zhao 178530d68baSNigel Croxon // 179530d68baSNigel Croxon // EFI Variable strings 180530d68baSNigel Croxon // 181530d68baSNigel Croxon #define LOAD_OPTION_ACTIVE 0x00000001 182530d68baSNigel Croxon 183530d68baSNigel Croxon #define VarLanguageCodes L"LangCodes" 184530d68baSNigel Croxon #define VarLanguage L"Lang" 185530d68baSNigel Croxon #define VarTimeout L"Timeout" 186530d68baSNigel Croxon #define VarConsoleInp L"ConIn" 187530d68baSNigel Croxon #define VarConsoleOut L"ConOut" 188530d68baSNigel Croxon #define VarErrorOut L"ErrOut" 189530d68baSNigel Croxon #define VarBootOption L"Boot%04x" 190530d68baSNigel Croxon #define VarBootOrder L"BootOrder" 191530d68baSNigel Croxon #define VarBootNext L"BootNext" 192530d68baSNigel Croxon #define VarBootCurrent L"BootCurrent" 193530d68baSNigel Croxon #define VarDriverOption L"Driver%04x" 194530d68baSNigel Croxon #define VarDriverOrder L"DriverOrder" 195530d68baSNigel Croxon #define VarConsoleInpDev L"ConInDev" 196530d68baSNigel Croxon #define VarConsoleOutDev L"ConOutDev" 197530d68baSNigel Croxon #define VarErrorOutDev L"ErrOutDev" 198530d68baSNigel Croxon 199530d68baSNigel Croxon #define LanguageCodeEnglish "eng" 200530d68baSNigel Croxon 201530d68baSNigel Croxon extern EFI_DEVICE_PATH RootDevicePath[]; 202530d68baSNigel Croxon extern EFI_DEVICE_PATH EndDevicePath[]; 203530d68baSNigel Croxon extern EFI_DEVICE_PATH EndInstanceDevicePath[]; 204530d68baSNigel Croxon 205530d68baSNigel Croxon // 206530d68baSNigel Croxon // Other public data in the EFI library 207530d68baSNigel Croxon // 208530d68baSNigel Croxon 209530d68baSNigel Croxon extern EFI_MEMORY_TYPE PoolAllocationType; 210530d68baSNigel Croxon 211530d68baSNigel Croxon // 212530d68baSNigel Croxon // STATIC - Name is internal to the module 213530d68baSNigel Croxon // INTERNAL - Name is internal to the component (i.e., directory) 214530d68baSNigel Croxon // BOOTSERVCE - Name of a boot service function 215530d68baSNigel Croxon // 216530d68baSNigel Croxon 217530d68baSNigel Croxon #define STATIC 218530d68baSNigel Croxon #define INTERNAL 219530d68baSNigel Croxon #define BOOTSERVICE 220530d68baSNigel Croxon 221530d68baSNigel Croxon // 222530d68baSNigel Croxon // Prototypes 223530d68baSNigel Croxon // 224530d68baSNigel Croxon 225530d68baSNigel Croxon VOID 226530d68baSNigel Croxon InitializeLib ( 227530d68baSNigel Croxon IN EFI_HANDLE ImageHandle, 228530d68baSNigel Croxon IN EFI_SYSTEM_TABLE *SystemTable 229530d68baSNigel Croxon ); 230530d68baSNigel Croxon 231530d68baSNigel Croxon VOID 232530d68baSNigel Croxon InitializeUnicodeSupport ( 233530d68baSNigel Croxon CHAR8 *LangCode 234530d68baSNigel Croxon ); 235530d68baSNigel Croxon 236530d68baSNigel Croxon VOID 237530d68baSNigel Croxon EFIDebugVariable ( 238530d68baSNigel Croxon VOID 239530d68baSNigel Croxon ); 240530d68baSNigel Croxon 2413f8935c3SNigel Croxon VOID 2423f8935c3SNigel Croxon Exit( 2433f8935c3SNigel Croxon IN EFI_STATUS ExitStatus, 2443f8935c3SNigel Croxon IN UINTN ExitDataSize, 2453f8935c3SNigel Croxon IN CHAR16 *ExitData OPTIONAL 2463f8935c3SNigel Croxon ); 2473f8935c3SNigel Croxon 248530d68baSNigel Croxon INTN 249530d68baSNigel Croxon GetShellArgcArgv( 250530d68baSNigel Croxon EFI_HANDLE ImageHandle, 251530d68baSNigel Croxon CHAR16 **Argv[] /* Statically allocated */ 252530d68baSNigel Croxon ); 253530d68baSNigel Croxon 254530d68baSNigel Croxon VOID 255530d68baSNigel Croxon SetCrc ( 256530d68baSNigel Croxon IN OUT EFI_TABLE_HEADER *Hdr 257530d68baSNigel Croxon ); 258530d68baSNigel Croxon 259530d68baSNigel Croxon VOID 260530d68baSNigel Croxon SetCrcAltSize ( 261530d68baSNigel Croxon IN UINTN Size, 262530d68baSNigel Croxon IN OUT EFI_TABLE_HEADER *Hdr 263530d68baSNigel Croxon ); 264530d68baSNigel Croxon 265530d68baSNigel Croxon BOOLEAN 266530d68baSNigel Croxon CheckCrc ( 267530d68baSNigel Croxon IN UINTN MaxSize, 268530d68baSNigel Croxon IN OUT EFI_TABLE_HEADER *Hdr 269530d68baSNigel Croxon ); 270530d68baSNigel Croxon 271530d68baSNigel Croxon BOOLEAN 272530d68baSNigel Croxon CheckCrcAltSize ( 273530d68baSNigel Croxon IN UINTN MaxSize, 274530d68baSNigel Croxon IN UINTN Size, 275530d68baSNigel Croxon IN OUT EFI_TABLE_HEADER *Hdr 276530d68baSNigel Croxon ); 277530d68baSNigel Croxon 278530d68baSNigel Croxon UINT32 279530d68baSNigel Croxon CalculateCrc ( 280530d68baSNigel Croxon UINT8 *pt, 281530d68baSNigel Croxon UINTN Size 282530d68baSNigel Croxon ); 283530d68baSNigel Croxon 284530d68baSNigel Croxon VOID 285530d68baSNigel Croxon ZeroMem ( 286530d68baSNigel Croxon IN VOID *Buffer, 287530d68baSNigel Croxon IN UINTN Size 288530d68baSNigel Croxon ); 289530d68baSNigel Croxon 290*deb8a7f2SPeter Jones VOID EFIAPI 291530d68baSNigel Croxon SetMem ( 292530d68baSNigel Croxon IN VOID *Buffer, 293530d68baSNigel Croxon IN UINTN Size, 294530d68baSNigel Croxon IN UINT8 Value 295530d68baSNigel Croxon ); 296530d68baSNigel Croxon 297*deb8a7f2SPeter Jones VOID EFIAPI 298530d68baSNigel Croxon CopyMem ( 299530d68baSNigel Croxon IN VOID *Dest, 300*deb8a7f2SPeter Jones IN VOID *Src, 301530d68baSNigel Croxon IN UINTN len 302530d68baSNigel Croxon ); 303530d68baSNigel Croxon 304530d68baSNigel Croxon INTN 305530d68baSNigel Croxon CompareMem ( 306530d68baSNigel Croxon IN CONST VOID *Dest, 307530d68baSNigel Croxon IN CONST VOID *Src, 308530d68baSNigel Croxon IN UINTN len 309530d68baSNigel Croxon ); 310530d68baSNigel Croxon 311530d68baSNigel Croxon INTN 312530d68baSNigel Croxon StrCmp ( 313530d68baSNigel Croxon IN CONST CHAR16 *s1, 314530d68baSNigel Croxon IN CONST CHAR16 *s2 315530d68baSNigel Croxon ); 316530d68baSNigel Croxon 317530d68baSNigel Croxon INTN 318530d68baSNigel Croxon StrnCmp ( 319530d68baSNigel Croxon IN CONST CHAR16 *s1, 320530d68baSNigel Croxon IN CONST CHAR16 *s2, 321530d68baSNigel Croxon IN UINTN len 322530d68baSNigel Croxon ); 323530d68baSNigel Croxon 324530d68baSNigel Croxon INTN 325530d68baSNigel Croxon StriCmp ( 326530d68baSNigel Croxon IN CONST CHAR16 *s1, 327530d68baSNigel Croxon IN CONST CHAR16 *s2 328530d68baSNigel Croxon ); 329530d68baSNigel Croxon 330530d68baSNigel Croxon VOID 331530d68baSNigel Croxon StrLwr ( 332530d68baSNigel Croxon IN CHAR16 *Str 333530d68baSNigel Croxon ); 334530d68baSNigel Croxon 335530d68baSNigel Croxon VOID 336530d68baSNigel Croxon StrUpr ( 337530d68baSNigel Croxon IN CHAR16 *Str 338530d68baSNigel Croxon ); 339530d68baSNigel Croxon 340530d68baSNigel Croxon VOID 341530d68baSNigel Croxon StrCpy ( 342530d68baSNigel Croxon IN CHAR16 *Dest, 343530d68baSNigel Croxon IN CONST CHAR16 *Src 344530d68baSNigel Croxon ); 345530d68baSNigel Croxon 346530d68baSNigel Croxon VOID 3479485c65fSPeter Jones StrnCpy ( 3489485c65fSPeter Jones IN CHAR16 *Dest, 3499485c65fSPeter Jones IN CONST CHAR16 *Src, 3509485c65fSPeter Jones IN UINTN Len 3519485c65fSPeter Jones ); 3529485c65fSPeter Jones 3539485c65fSPeter Jones CHAR16 * 3549485c65fSPeter Jones StpCpy ( 3559485c65fSPeter Jones IN CHAR16 *Dest, 3569485c65fSPeter Jones IN CONST CHAR16 *Src 3579485c65fSPeter Jones ); 3589485c65fSPeter Jones 3599485c65fSPeter Jones CHAR16 * 3609485c65fSPeter Jones StpnCpy ( 3619485c65fSPeter Jones IN CHAR16 *Dest, 3629485c65fSPeter Jones IN CONST CHAR16 *Src, 3639485c65fSPeter Jones IN UINTN Len 3649485c65fSPeter Jones ); 3659485c65fSPeter Jones 3669485c65fSPeter Jones VOID 367530d68baSNigel Croxon StrCat ( 368530d68baSNigel Croxon IN CHAR16 *Dest, 369530d68baSNigel Croxon IN CONST CHAR16 *Src 370530d68baSNigel Croxon ); 371530d68baSNigel Croxon 3729485c65fSPeter Jones VOID 3739485c65fSPeter Jones StrnCat ( 3749485c65fSPeter Jones IN CHAR16 *Dest, 3759485c65fSPeter Jones IN CONST CHAR16 *Src, 3769485c65fSPeter Jones IN UINTN Len 3779485c65fSPeter Jones ); 3789485c65fSPeter Jones 379530d68baSNigel Croxon UINTN 380530d68baSNigel Croxon StrLen ( 381530d68baSNigel Croxon IN CONST CHAR16 *s1 382530d68baSNigel Croxon ); 383530d68baSNigel Croxon 384530d68baSNigel Croxon UINTN 3859485c65fSPeter Jones StrnLen ( 3869485c65fSPeter Jones IN CONST CHAR16 *s1, 3879485c65fSPeter Jones IN UINTN Len 3889485c65fSPeter Jones ); 3899485c65fSPeter Jones 3909485c65fSPeter Jones UINTN 391530d68baSNigel Croxon StrSize ( 392530d68baSNigel Croxon IN CONST CHAR16 *s1 393530d68baSNigel Croxon ); 394530d68baSNigel Croxon 395530d68baSNigel Croxon CHAR16 * 396530d68baSNigel Croxon StrDuplicate ( 397530d68baSNigel Croxon IN CONST CHAR16 *Src 398530d68baSNigel Croxon ); 399530d68baSNigel Croxon 400530d68baSNigel Croxon UINTN 401530d68baSNigel Croxon strlena ( 402530d68baSNigel Croxon IN CONST CHAR8 *s1 403530d68baSNigel Croxon ); 404530d68baSNigel Croxon 405530d68baSNigel Croxon UINTN 406530d68baSNigel Croxon strcmpa ( 407530d68baSNigel Croxon IN CONST CHAR8 *s1, 408530d68baSNigel Croxon IN CONST CHAR8 *s2 409530d68baSNigel Croxon ); 410530d68baSNigel Croxon 411530d68baSNigel Croxon UINTN 412530d68baSNigel Croxon strncmpa ( 413530d68baSNigel Croxon IN CONST CHAR8 *s1, 414530d68baSNigel Croxon IN CONST CHAR8 *s2, 415530d68baSNigel Croxon IN UINTN len 416530d68baSNigel Croxon ); 417530d68baSNigel Croxon 418530d68baSNigel Croxon UINTN 419530d68baSNigel Croxon xtoi ( 420530d68baSNigel Croxon CONST CHAR16 *str 421530d68baSNigel Croxon ); 422530d68baSNigel Croxon 423530d68baSNigel Croxon UINTN 424530d68baSNigel Croxon Atoi ( 425530d68baSNigel Croxon CONST CHAR16 *str 426530d68baSNigel Croxon ); 427530d68baSNigel Croxon 428530d68baSNigel Croxon BOOLEAN 429530d68baSNigel Croxon MetaMatch ( 430530d68baSNigel Croxon IN CHAR16 *String, 431530d68baSNigel Croxon IN CHAR16 *Pattern 432530d68baSNigel Croxon ); 433530d68baSNigel Croxon 434530d68baSNigel Croxon BOOLEAN 435530d68baSNigel Croxon MetaiMatch ( 436530d68baSNigel Croxon IN CHAR16 *String, 437530d68baSNigel Croxon IN CHAR16 *Pattern 438530d68baSNigel Croxon ); 439530d68baSNigel Croxon 440530d68baSNigel Croxon UINT64 441530d68baSNigel Croxon LShiftU64 ( 442530d68baSNigel Croxon IN UINT64 Operand, 443530d68baSNigel Croxon IN UINTN Count 444530d68baSNigel Croxon ); 445530d68baSNigel Croxon 446530d68baSNigel Croxon UINT64 447530d68baSNigel Croxon RShiftU64 ( 448530d68baSNigel Croxon IN UINT64 Operand, 449530d68baSNigel Croxon IN UINTN Count 450530d68baSNigel Croxon ); 451530d68baSNigel Croxon 452530d68baSNigel Croxon UINT64 453530d68baSNigel Croxon MultU64x32 ( 454530d68baSNigel Croxon IN UINT64 Multiplicand, 455530d68baSNigel Croxon IN UINTN Multiplier 456530d68baSNigel Croxon ); 457530d68baSNigel Croxon 458530d68baSNigel Croxon UINT64 459530d68baSNigel Croxon DivU64x32 ( 460530d68baSNigel Croxon IN UINT64 Dividend, 461530d68baSNigel Croxon IN UINTN Divisor, 462530d68baSNigel Croxon OUT UINTN *Remainder OPTIONAL 463530d68baSNigel Croxon ); 464530d68baSNigel Croxon 465530d68baSNigel Croxon VOID 466530d68baSNigel Croxon InitializeLock ( 467530d68baSNigel Croxon IN OUT FLOCK *Lock, 468530d68baSNigel Croxon IN EFI_TPL Priority 469530d68baSNigel Croxon ); 470530d68baSNigel Croxon 471530d68baSNigel Croxon VOID 472530d68baSNigel Croxon AcquireLock ( 473530d68baSNigel Croxon IN FLOCK *Lock 474530d68baSNigel Croxon ); 475530d68baSNigel Croxon 476530d68baSNigel Croxon VOID 477530d68baSNigel Croxon ReleaseLock ( 478530d68baSNigel Croxon IN FLOCK *Lock 479530d68baSNigel Croxon ); 480530d68baSNigel Croxon 481530d68baSNigel Croxon 482530d68baSNigel Croxon INTN 483530d68baSNigel Croxon CompareGuid( 484530d68baSNigel Croxon IN EFI_GUID *Guid1, 485530d68baSNigel Croxon IN EFI_GUID *Guid2 486530d68baSNigel Croxon ); 487530d68baSNigel Croxon 488530d68baSNigel Croxon VOID * 489530d68baSNigel Croxon AllocatePool ( 490530d68baSNigel Croxon IN UINTN Size 491530d68baSNigel Croxon ); 492530d68baSNigel Croxon 493530d68baSNigel Croxon VOID * 494530d68baSNigel Croxon AllocateZeroPool ( 495530d68baSNigel Croxon IN UINTN Size 496530d68baSNigel Croxon ); 497530d68baSNigel Croxon 498530d68baSNigel Croxon VOID * 499530d68baSNigel Croxon ReallocatePool ( 500530d68baSNigel Croxon IN VOID *OldPool, 501530d68baSNigel Croxon IN UINTN OldSize, 502530d68baSNigel Croxon IN UINTN NewSize 503530d68baSNigel Croxon ); 504530d68baSNigel Croxon 505530d68baSNigel Croxon VOID 506530d68baSNigel Croxon FreePool ( 507530d68baSNigel Croxon IN VOID *p 508530d68baSNigel Croxon ); 509530d68baSNigel Croxon 510530d68baSNigel Croxon 511530d68baSNigel Croxon VOID 512530d68baSNigel Croxon Output ( 513530d68baSNigel Croxon IN CHAR16 *Str 514530d68baSNigel Croxon ); 515530d68baSNigel Croxon 516530d68baSNigel Croxon VOID 517530d68baSNigel Croxon Input ( 518530d68baSNigel Croxon IN CHAR16 *Prompt OPTIONAL, 519530d68baSNigel Croxon OUT CHAR16 *InStr, 520530d68baSNigel Croxon IN UINTN StrLen 521530d68baSNigel Croxon ); 522530d68baSNigel Croxon 523530d68baSNigel Croxon VOID 524530d68baSNigel Croxon IInput ( 525530d68baSNigel Croxon IN SIMPLE_TEXT_OUTPUT_INTERFACE *ConOut, 526530d68baSNigel Croxon IN SIMPLE_INPUT_INTERFACE *ConIn, 527530d68baSNigel Croxon IN CHAR16 *Prompt OPTIONAL, 528530d68baSNigel Croxon OUT CHAR16 *InStr, 529530d68baSNigel Croxon IN UINTN StrLen 530530d68baSNigel Croxon ); 531530d68baSNigel Croxon 532530d68baSNigel Croxon UINTN 533530d68baSNigel Croxon Print ( 534fa1b9779SNigel Croxon IN CONST CHAR16 *fmt, 535530d68baSNigel Croxon ... 536530d68baSNigel Croxon ); 537530d68baSNigel Croxon 538530d68baSNigel Croxon UINTN 539530d68baSNigel Croxon VPrint ( 540fa1b9779SNigel Croxon IN CONST CHAR16 *fmt, 541530d68baSNigel Croxon va_list args 542530d68baSNigel Croxon ); 543530d68baSNigel Croxon 544530d68baSNigel Croxon UINTN 545b39be0d5SPete Batard UnicodeSPrint ( 546530d68baSNigel Croxon OUT CHAR16 *Str, 547530d68baSNigel Croxon IN UINTN StrSize, 548fa1b9779SNigel Croxon IN CONST CHAR16 *fmt, 549530d68baSNigel Croxon ... 550530d68baSNigel Croxon ); 551530d68baSNigel Croxon 552530d68baSNigel Croxon UINTN 553b39be0d5SPete Batard UnicodeVSPrint ( 554530d68baSNigel Croxon OUT CHAR16 *Str, 555530d68baSNigel Croxon IN UINTN StrSize, 556fa1b9779SNigel Croxon IN CONST CHAR16 *fmt, 557530d68baSNigel Croxon va_list args 558530d68baSNigel Croxon ); 559530d68baSNigel Croxon 560530d68baSNigel Croxon CHAR16 * 561530d68baSNigel Croxon VPoolPrint ( 562fa1b9779SNigel Croxon IN CONST CHAR16 *fmt, 563530d68baSNigel Croxon va_list args 564530d68baSNigel Croxon ); 565530d68baSNigel Croxon 566530d68baSNigel Croxon CHAR16 * 567530d68baSNigel Croxon PoolPrint ( 568fa1b9779SNigel Croxon IN CONST CHAR16 *fmt, 569530d68baSNigel Croxon ... 570530d68baSNigel Croxon ); 571530d68baSNigel Croxon 572530d68baSNigel Croxon typedef struct { 573530d68baSNigel Croxon CHAR16 *str; 574530d68baSNigel Croxon UINTN len; 575530d68baSNigel Croxon UINTN maxlen; 576530d68baSNigel Croxon } POOL_PRINT; 577530d68baSNigel Croxon 578530d68baSNigel Croxon CHAR16 * 579530d68baSNigel Croxon CatPrint ( 580530d68baSNigel Croxon IN OUT POOL_PRINT *Str, 581fa1b9779SNigel Croxon IN CONST CHAR16 *fmt, 582530d68baSNigel Croxon ... 583530d68baSNigel Croxon ); 584530d68baSNigel Croxon 585530d68baSNigel Croxon UINTN 586530d68baSNigel Croxon PrintAt ( 587530d68baSNigel Croxon IN UINTN Column, 588530d68baSNigel Croxon IN UINTN Row, 589fa1b9779SNigel Croxon IN CONST CHAR16 *fmt, 590530d68baSNigel Croxon ... 591530d68baSNigel Croxon ); 592530d68baSNigel Croxon 593530d68baSNigel Croxon UINTN 594530d68baSNigel Croxon IPrint ( 595530d68baSNigel Croxon IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out, 596fa1b9779SNigel Croxon IN CONST CHAR16 *fmt, 597530d68baSNigel Croxon ... 598530d68baSNigel Croxon ); 599530d68baSNigel Croxon 600530d68baSNigel Croxon UINTN 601530d68baSNigel Croxon IPrintAt ( 602530d68baSNigel Croxon IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out, 603530d68baSNigel Croxon IN UINTN Column, 604530d68baSNigel Croxon IN UINTN Row, 605fa1b9779SNigel Croxon IN CONST CHAR16 *fmt, 606530d68baSNigel Croxon ... 607530d68baSNigel Croxon ); 608530d68baSNigel Croxon 609530d68baSNigel Croxon UINTN 6100247cb7cSPete Batard AsciiPrint ( 611fa1b9779SNigel Croxon IN CONST CHAR8 *fmt, 612530d68baSNigel Croxon ... 613530d68baSNigel Croxon ); 614530d68baSNigel Croxon 6150247cb7cSPete Batard UINTN 6160247cb7cSPete Batard AsciiVSPrint( 6170247cb7cSPete Batard OUT CHAR8 *Str, 6180247cb7cSPete Batard IN UINTN StrSize, 6190247cb7cSPete Batard IN CONST CHAR8 *fmt, 6200247cb7cSPete Batard va_list args 6210247cb7cSPete Batard ); 6220247cb7cSPete Batard 623b39be0d5SPete Batard // 624b39be0d5SPete Batard // For compatibility with previous gnu-efi versions 625b39be0d5SPete Batard // 626b39be0d5SPete Batard #define SPrint UnicodeSPrint 627b39be0d5SPete Batard #define VSPrint UnicodeVSPrint 628b39be0d5SPete Batard #define APrint AsciiPrint 629b39be0d5SPete Batard 630530d68baSNigel Croxon VOID 631530d68baSNigel Croxon ValueToHex ( 632530d68baSNigel Croxon IN CHAR16 *Buffer, 633530d68baSNigel Croxon IN UINT64 v 634530d68baSNigel Croxon ); 635530d68baSNigel Croxon 636530d68baSNigel Croxon VOID 637530d68baSNigel Croxon ValueToString ( 638530d68baSNigel Croxon IN CHAR16 *Buffer, 639530d68baSNigel Croxon IN BOOLEAN Comma, 640530d68baSNigel Croxon IN INT64 v 641530d68baSNigel Croxon ); 642530d68baSNigel Croxon 643530d68baSNigel Croxon VOID 644b2c4db06SNigel Croxon FloatToString ( 645b2c4db06SNigel Croxon IN CHAR16 *Buffer, 646b2c4db06SNigel Croxon IN BOOLEAN Comma, 647b2c4db06SNigel Croxon IN double v 648b2c4db06SNigel Croxon ); 649b2c4db06SNigel Croxon 650b2c4db06SNigel Croxon VOID 651530d68baSNigel Croxon TimeToString ( 652530d68baSNigel Croxon OUT CHAR16 *Buffer, 653530d68baSNigel Croxon IN EFI_TIME *Time 654530d68baSNigel Croxon ); 655530d68baSNigel Croxon 656530d68baSNigel Croxon VOID 657530d68baSNigel Croxon GuidToString ( 658530d68baSNigel Croxon OUT CHAR16 *Buffer, 659530d68baSNigel Croxon IN EFI_GUID *Guid 660530d68baSNigel Croxon ); 661530d68baSNigel Croxon 662530d68baSNigel Croxon VOID 663530d68baSNigel Croxon StatusToString ( 664530d68baSNigel Croxon OUT CHAR16 *Buffer, 665530d68baSNigel Croxon EFI_STATUS Status 666530d68baSNigel Croxon ); 667530d68baSNigel Croxon 668530d68baSNigel Croxon VOID 669530d68baSNigel Croxon DumpHex ( 670530d68baSNigel Croxon IN UINTN Indent, 671530d68baSNigel Croxon IN UINTN Offset, 672530d68baSNigel Croxon IN UINTN DataSize, 673530d68baSNigel Croxon IN VOID *UserData 674530d68baSNigel Croxon ); 675530d68baSNigel Croxon 676530d68baSNigel Croxon BOOLEAN 677530d68baSNigel Croxon GrowBuffer( 678530d68baSNigel Croxon IN OUT EFI_STATUS *Status, 679530d68baSNigel Croxon IN OUT VOID **Buffer, 680530d68baSNigel Croxon IN UINTN BufferSize 681530d68baSNigel Croxon ); 682530d68baSNigel Croxon 683530d68baSNigel Croxon EFI_MEMORY_DESCRIPTOR * 684530d68baSNigel Croxon LibMemoryMap ( 685530d68baSNigel Croxon OUT UINTN *NoEntries, 686530d68baSNigel Croxon OUT UINTN *MapKey, 687530d68baSNigel Croxon OUT UINTN *DescriptorSize, 688530d68baSNigel Croxon OUT UINT32 *DescriptorVersion 689530d68baSNigel Croxon ); 690530d68baSNigel Croxon 691530d68baSNigel Croxon VOID * 692530d68baSNigel Croxon LibGetVariable ( 693530d68baSNigel Croxon IN CHAR16 *Name, 694530d68baSNigel Croxon IN EFI_GUID *VendorGuid 695530d68baSNigel Croxon ); 696530d68baSNigel Croxon 697530d68baSNigel Croxon VOID * 698530d68baSNigel Croxon LibGetVariableAndSize ( 699530d68baSNigel Croxon IN CHAR16 *Name, 700530d68baSNigel Croxon IN EFI_GUID *VendorGuid, 701530d68baSNigel Croxon OUT UINTN *VarSize 702530d68baSNigel Croxon ); 703530d68baSNigel Croxon 704530d68baSNigel Croxon EFI_STATUS 705530d68baSNigel Croxon LibDeleteVariable ( 706530d68baSNigel Croxon IN CHAR16 *VarName, 707530d68baSNigel Croxon IN EFI_GUID *VarGuid 708530d68baSNigel Croxon ); 709530d68baSNigel Croxon 710530d68baSNigel Croxon EFI_STATUS 711530d68baSNigel Croxon LibSetNVVariable ( 712530d68baSNigel Croxon IN CHAR16 *VarName, 713530d68baSNigel Croxon IN EFI_GUID *VarGuid, 714530d68baSNigel Croxon IN UINTN DataSize, 715530d68baSNigel Croxon IN VOID *Data 716530d68baSNigel Croxon ); 717530d68baSNigel Croxon 718530d68baSNigel Croxon EFI_STATUS 719530d68baSNigel Croxon LibSetVariable ( 720530d68baSNigel Croxon IN CHAR16 *VarName, 721530d68baSNigel Croxon IN EFI_GUID *VarGuid, 722530d68baSNigel Croxon IN UINTN DataSize, 723530d68baSNigel Croxon IN VOID *Data 724530d68baSNigel Croxon ); 725530d68baSNigel Croxon EFI_STATUS 726530d68baSNigel Croxon LibInsertToTailOfBootOrder ( 727530d68baSNigel Croxon IN UINT16 BootOption, 728530d68baSNigel Croxon IN BOOLEAN OnlyInsertIfEmpty 729530d68baSNigel Croxon ); 730530d68baSNigel Croxon 731530d68baSNigel Croxon EFI_STATUS 732530d68baSNigel Croxon LibLocateProtocol ( 733530d68baSNigel Croxon IN EFI_GUID *ProtocolGuid, 734530d68baSNigel Croxon OUT VOID **Interface 735530d68baSNigel Croxon ); 736530d68baSNigel Croxon 737530d68baSNigel Croxon EFI_STATUS 738530d68baSNigel Croxon LibLocateHandle ( 739530d68baSNigel Croxon IN EFI_LOCATE_SEARCH_TYPE SearchType, 740530d68baSNigel Croxon IN EFI_GUID *Protocol OPTIONAL, 741530d68baSNigel Croxon IN VOID *SearchKey OPTIONAL, 742530d68baSNigel Croxon IN OUT UINTN *NoHandles, 743530d68baSNigel Croxon OUT EFI_HANDLE **Buffer 744530d68baSNigel Croxon ); 745530d68baSNigel Croxon 746530d68baSNigel Croxon EFI_STATUS 747530d68baSNigel Croxon LibLocateHandleByDiskSignature ( 748530d68baSNigel Croxon IN UINT8 MBRType, 749530d68baSNigel Croxon IN UINT8 SignatureType, 750530d68baSNigel Croxon IN VOID *Signature, 751530d68baSNigel Croxon IN OUT UINTN *NoHandles, 752530d68baSNigel Croxon OUT EFI_HANDLE **Buffer 753530d68baSNigel Croxon ); 754530d68baSNigel Croxon 755530d68baSNigel Croxon EFI_STATUS 756530d68baSNigel Croxon LibInstallProtocolInterfaces ( 757530d68baSNigel Croxon IN OUT EFI_HANDLE *Handle, 758530d68baSNigel Croxon ... 759530d68baSNigel Croxon ); 760530d68baSNigel Croxon 761530d68baSNigel Croxon VOID 762530d68baSNigel Croxon LibUninstallProtocolInterfaces ( 763530d68baSNigel Croxon IN EFI_HANDLE Handle, 764530d68baSNigel Croxon ... 765530d68baSNigel Croxon ); 766530d68baSNigel Croxon 767530d68baSNigel Croxon EFI_STATUS 768530d68baSNigel Croxon LibReinstallProtocolInterfaces ( 769530d68baSNigel Croxon IN OUT EFI_HANDLE *Handle, 770530d68baSNigel Croxon ... 771530d68baSNigel Croxon ); 772530d68baSNigel Croxon 773530d68baSNigel Croxon EFI_EVENT 774530d68baSNigel Croxon LibCreateProtocolNotifyEvent ( 775530d68baSNigel Croxon IN EFI_GUID *ProtocolGuid, 776530d68baSNigel Croxon IN EFI_TPL NotifyTpl, 777530d68baSNigel Croxon IN EFI_EVENT_NOTIFY NotifyFunction, 778530d68baSNigel Croxon IN VOID *NotifyContext, 779530d68baSNigel Croxon OUT VOID *Registration 780530d68baSNigel Croxon ); 781530d68baSNigel Croxon 782530d68baSNigel Croxon EFI_STATUS 783530d68baSNigel Croxon WaitForSingleEvent ( 784530d68baSNigel Croxon IN EFI_EVENT Event, 785530d68baSNigel Croxon IN UINT64 Timeout OPTIONAL 786530d68baSNigel Croxon ); 787530d68baSNigel Croxon 788530d68baSNigel Croxon VOID 789530d68baSNigel Croxon WaitForEventWithTimeout ( 790530d68baSNigel Croxon IN EFI_EVENT Event, 791530d68baSNigel Croxon IN UINTN Timeout, 792530d68baSNigel Croxon IN UINTN Row, 793530d68baSNigel Croxon IN UINTN Column, 794530d68baSNigel Croxon IN CHAR16 *String, 795530d68baSNigel Croxon IN EFI_INPUT_KEY TimeoutKey, 796530d68baSNigel Croxon OUT EFI_INPUT_KEY *Key 797530d68baSNigel Croxon ); 798530d68baSNigel Croxon 799530d68baSNigel Croxon EFI_FILE_HANDLE 800530d68baSNigel Croxon LibOpenRoot ( 801530d68baSNigel Croxon IN EFI_HANDLE DeviceHandle 802530d68baSNigel Croxon ); 803530d68baSNigel Croxon 804530d68baSNigel Croxon EFI_FILE_INFO * 805530d68baSNigel Croxon LibFileInfo ( 806530d68baSNigel Croxon IN EFI_FILE_HANDLE FHand 807530d68baSNigel Croxon ); 808530d68baSNigel Croxon 809530d68baSNigel Croxon EFI_FILE_SYSTEM_INFO * 810530d68baSNigel Croxon LibFileSystemInfo ( 811530d68baSNigel Croxon IN EFI_FILE_HANDLE FHand 812530d68baSNigel Croxon ); 813530d68baSNigel Croxon 814530d68baSNigel Croxon EFI_FILE_SYSTEM_VOLUME_LABEL_INFO * 815530d68baSNigel Croxon LibFileSystemVolumeLabelInfo ( 816530d68baSNigel Croxon IN EFI_FILE_HANDLE FHand 817530d68baSNigel Croxon ); 818530d68baSNigel Croxon 819530d68baSNigel Croxon BOOLEAN 820530d68baSNigel Croxon ValidMBR( 821530d68baSNigel Croxon IN MASTER_BOOT_RECORD *Mbr, 822530d68baSNigel Croxon IN EFI_BLOCK_IO *BlkIo 823530d68baSNigel Croxon ); 824530d68baSNigel Croxon 825530d68baSNigel Croxon BOOLEAN 826530d68baSNigel Croxon LibMatchDevicePaths ( 827530d68baSNigel Croxon IN EFI_DEVICE_PATH *Multi, 828530d68baSNigel Croxon IN EFI_DEVICE_PATH *Single 829530d68baSNigel Croxon ); 830530d68baSNigel Croxon 831530d68baSNigel Croxon EFI_DEVICE_PATH * 832530d68baSNigel Croxon LibDuplicateDevicePathInstance ( 833530d68baSNigel Croxon IN EFI_DEVICE_PATH *DevPath 834530d68baSNigel Croxon ); 835530d68baSNigel Croxon 836530d68baSNigel Croxon EFI_DEVICE_PATH * 837530d68baSNigel Croxon DevicePathFromHandle ( 838530d68baSNigel Croxon IN EFI_HANDLE Handle 839530d68baSNigel Croxon ); 840530d68baSNigel Croxon 841530d68baSNigel Croxon EFI_DEVICE_PATH * 842530d68baSNigel Croxon DevicePathInstance ( 843530d68baSNigel Croxon IN OUT EFI_DEVICE_PATH **DevicePath, 844530d68baSNigel Croxon OUT UINTN *Size 845530d68baSNigel Croxon ); 846530d68baSNigel Croxon 847530d68baSNigel Croxon UINTN 848530d68baSNigel Croxon DevicePathInstanceCount ( 849530d68baSNigel Croxon IN EFI_DEVICE_PATH *DevicePath 850530d68baSNigel Croxon ); 851530d68baSNigel Croxon 852530d68baSNigel Croxon EFI_DEVICE_PATH * 853530d68baSNigel Croxon AppendDevicePath ( 854530d68baSNigel Croxon IN EFI_DEVICE_PATH *Src1, 855530d68baSNigel Croxon IN EFI_DEVICE_PATH *Src2 856530d68baSNigel Croxon ); 857530d68baSNigel Croxon 858530d68baSNigel Croxon EFI_DEVICE_PATH * 859530d68baSNigel Croxon AppendDevicePathNode ( 860530d68baSNigel Croxon IN EFI_DEVICE_PATH *Src1, 861530d68baSNigel Croxon IN EFI_DEVICE_PATH *Src2 862530d68baSNigel Croxon ); 863530d68baSNigel Croxon 864530d68baSNigel Croxon EFI_DEVICE_PATH* 865530d68baSNigel Croxon AppendDevicePathInstance ( 866530d68baSNigel Croxon IN EFI_DEVICE_PATH *Src, 867530d68baSNigel Croxon IN EFI_DEVICE_PATH *Instance 868530d68baSNigel Croxon ); 869530d68baSNigel Croxon 870530d68baSNigel Croxon EFI_DEVICE_PATH * 871530d68baSNigel Croxon FileDevicePath ( 872530d68baSNigel Croxon IN EFI_HANDLE Device OPTIONAL, 873530d68baSNigel Croxon IN CHAR16 *FileName 874530d68baSNigel Croxon ); 875530d68baSNigel Croxon 876530d68baSNigel Croxon UINTN 877530d68baSNigel Croxon DevicePathSize ( 878530d68baSNigel Croxon IN EFI_DEVICE_PATH *DevPath 879530d68baSNigel Croxon ); 880530d68baSNigel Croxon 881530d68baSNigel Croxon EFI_DEVICE_PATH * 882530d68baSNigel Croxon DuplicateDevicePath ( 883530d68baSNigel Croxon IN EFI_DEVICE_PATH *DevPath 884530d68baSNigel Croxon ); 885530d68baSNigel Croxon 886530d68baSNigel Croxon EFI_DEVICE_PATH * 887530d68baSNigel Croxon UnpackDevicePath ( 888530d68baSNigel Croxon IN EFI_DEVICE_PATH *DevPath 889530d68baSNigel Croxon ); 890530d68baSNigel Croxon 891530d68baSNigel Croxon EFI_STATUS 892530d68baSNigel Croxon LibDevicePathToInterface ( 893530d68baSNigel Croxon IN EFI_GUID *Protocol, 894530d68baSNigel Croxon IN EFI_DEVICE_PATH *FilePath, 895530d68baSNigel Croxon OUT VOID **Interface 896530d68baSNigel Croxon ); 897530d68baSNigel Croxon 898530d68baSNigel Croxon CHAR16 * 899530d68baSNigel Croxon DevicePathToStr ( 900530d68baSNigel Croxon EFI_DEVICE_PATH *DevPath 901530d68baSNigel Croxon ); 902530d68baSNigel Croxon 903530d68baSNigel Croxon // 904530d68baSNigel Croxon // BugBug: I need my own include files 905530d68baSNigel Croxon // 906530d68baSNigel Croxon typedef struct { 907530d68baSNigel Croxon UINT8 Register; 908530d68baSNigel Croxon UINT8 Function; 909530d68baSNigel Croxon UINT8 Device; 910530d68baSNigel Croxon UINT8 Bus; 911530d68baSNigel Croxon UINT32 Reserved; 912530d68baSNigel Croxon } EFI_ADDRESS; 913530d68baSNigel Croxon 914530d68baSNigel Croxon typedef union { 915530d68baSNigel Croxon UINT64 Address; 916530d68baSNigel Croxon EFI_ADDRESS EfiAddress; 917530d68baSNigel Croxon } EFI_PCI_ADDRESS_UNION; 918530d68baSNigel Croxon 919530d68baSNigel Croxon 920530d68baSNigel Croxon EFI_STATUS 921530d68baSNigel Croxon PciFindDeviceClass ( 922530d68baSNigel Croxon IN OUT EFI_PCI_ADDRESS_UNION *Address, 923530d68baSNigel Croxon IN UINT8 BaseClass, 924530d68baSNigel Croxon IN UINT8 SubClass 925530d68baSNigel Croxon ); 926530d68baSNigel Croxon 927530d68baSNigel Croxon EFI_STATUS 928530d68baSNigel Croxon PciFindDevice ( 929530d68baSNigel Croxon IN OUT EFI_PCI_ADDRESS_UNION *DeviceAddress, 930530d68baSNigel Croxon IN UINT16 VendorId, 931530d68baSNigel Croxon IN UINT16 DeviceId, 932530d68baSNigel Croxon IN OUT PCI_TYPE00 *Pci 933530d68baSNigel Croxon ); 934530d68baSNigel Croxon 935530d68baSNigel Croxon // 936530d68baSNigel Croxon // SIMPLE_READ_FILE object used to access files 937530d68baSNigel Croxon // 938530d68baSNigel Croxon 939530d68baSNigel Croxon typedef VOID *SIMPLE_READ_FILE; 940530d68baSNigel Croxon 941530d68baSNigel Croxon EFI_STATUS 942530d68baSNigel Croxon OpenSimpleReadFile ( 943530d68baSNigel Croxon IN BOOLEAN BootPolicy, 944530d68baSNigel Croxon IN VOID *SourceBuffer OPTIONAL, 945530d68baSNigel Croxon IN UINTN SourceSize, 946530d68baSNigel Croxon IN OUT EFI_DEVICE_PATH **FilePath, 947530d68baSNigel Croxon OUT EFI_HANDLE *DeviceHandle, 948530d68baSNigel Croxon OUT SIMPLE_READ_FILE *SimpleReadHandle 949530d68baSNigel Croxon ); 950530d68baSNigel Croxon 951530d68baSNigel Croxon EFI_STATUS 952530d68baSNigel Croxon ReadSimpleReadFile ( 953530d68baSNigel Croxon IN SIMPLE_READ_FILE SimpleReadHandle, 954530d68baSNigel Croxon IN UINTN Offset, 955530d68baSNigel Croxon IN OUT UINTN *ReadSize, 956530d68baSNigel Croxon OUT VOID *Buffer 957530d68baSNigel Croxon ); 958530d68baSNigel Croxon 959530d68baSNigel Croxon 960530d68baSNigel Croxon VOID 961530d68baSNigel Croxon CloseSimpleReadFile ( 962530d68baSNigel Croxon IN SIMPLE_READ_FILE SimpleReadHandle 963530d68baSNigel Croxon ); 964530d68baSNigel Croxon 965530d68baSNigel Croxon VOID 966530d68baSNigel Croxon InitializeGuid ( 967530d68baSNigel Croxon VOID 968530d68baSNigel Croxon ); 969530d68baSNigel Croxon 970530d68baSNigel Croxon UINT8 971530d68baSNigel Croxon DecimaltoBCD( 972530d68baSNigel Croxon IN UINT8 DecValue 973530d68baSNigel Croxon ); 974530d68baSNigel Croxon 975530d68baSNigel Croxon UINT8 976530d68baSNigel Croxon BCDtoDecimal( 977530d68baSNigel Croxon IN UINT8 BcdValue 978530d68baSNigel Croxon ); 979530d68baSNigel Croxon 980530d68baSNigel Croxon EFI_STATUS 981530d68baSNigel Croxon LibGetSystemConfigurationTable( 982530d68baSNigel Croxon IN EFI_GUID *TableGuid, 983530d68baSNigel Croxon IN OUT VOID **Table 984530d68baSNigel Croxon ); 985530d68baSNigel Croxon 986530d68baSNigel Croxon BOOLEAN 987530d68baSNigel Croxon LibIsValidTextGraphics ( 988530d68baSNigel Croxon IN CHAR16 Graphic, 989530d68baSNigel Croxon OUT CHAR8 *PcAnsi, OPTIONAL 990530d68baSNigel Croxon OUT CHAR8 *Ascii OPTIONAL 991530d68baSNigel Croxon ); 992530d68baSNigel Croxon 993530d68baSNigel Croxon BOOLEAN 994530d68baSNigel Croxon IsValidAscii ( 995530d68baSNigel Croxon IN CHAR16 Ascii 996530d68baSNigel Croxon ); 997530d68baSNigel Croxon 998530d68baSNigel Croxon BOOLEAN 999530d68baSNigel Croxon IsValidEfiCntlChar ( 1000530d68baSNigel Croxon IN CHAR16 c 1001530d68baSNigel Croxon ); 1002530d68baSNigel Croxon 1003530d68baSNigel Croxon CHAR16 * 1004530d68baSNigel Croxon LibGetUiString ( 1005530d68baSNigel Croxon IN EFI_HANDLE Handle, 1006530d68baSNigel Croxon IN UI_STRING_TYPE StringType, 1007530d68baSNigel Croxon IN ISO_639_2 *LangCode, 1008530d68baSNigel Croxon IN BOOLEAN ReturnDevicePathStrOnMismatch 1009530d68baSNigel Croxon ); 1010530d68baSNigel Croxon 1011530d68baSNigel Croxon CHAR8* 1012530d68baSNigel Croxon LibGetSmbiosString ( 1013530d68baSNigel Croxon IN SMBIOS_STRUCTURE_POINTER *Smbios, 1014530d68baSNigel Croxon IN UINT16 StringNumber 1015530d68baSNigel Croxon ); 1016530d68baSNigel Croxon 1017530d68baSNigel Croxon EFI_STATUS 1018530d68baSNigel Croxon LibGetSmbiosSystemGuidAndSerialNumber ( 1019530d68baSNigel Croxon IN EFI_GUID *SystemGuid, 1020530d68baSNigel Croxon OUT CHAR8 **SystemSerialNumber 1021530d68baSNigel Croxon ); 1022530d68baSNigel Croxon 1023530d68baSNigel Croxon 1024530d68baSNigel Croxon EFI_STATUS 1025530d68baSNigel Croxon InitializeGlobalIoDevice ( 1026530d68baSNigel Croxon IN EFI_DEVICE_PATH *DevicePath, 1027530d68baSNigel Croxon IN EFI_GUID *Protocol, 1028530d68baSNigel Croxon IN CHAR8 *ErrorStr, 1029530d68baSNigel Croxon OUT EFI_DEVICE_IO_INTERFACE **GlobalIoFncs 1030530d68baSNigel Croxon ); 1031530d68baSNigel Croxon 1032530d68baSNigel Croxon UINT32 1033530d68baSNigel Croxon ReadPort ( 1034530d68baSNigel Croxon IN EFI_DEVICE_IO_INTERFACE *GlobalIoFncs, 1035530d68baSNigel Croxon IN EFI_IO_WIDTH Width, 1036530d68baSNigel Croxon IN UINTN Port 1037530d68baSNigel Croxon ); 1038530d68baSNigel Croxon 1039530d68baSNigel Croxon UINT32 1040530d68baSNigel Croxon WritePort ( 1041530d68baSNigel Croxon IN EFI_DEVICE_IO_INTERFACE *GlobalIoFncs, 1042530d68baSNigel Croxon IN EFI_IO_WIDTH Width, 1043530d68baSNigel Croxon IN UINTN Port, 1044530d68baSNigel Croxon IN UINTN Data 1045530d68baSNigel Croxon ); 1046530d68baSNigel Croxon 1047530d68baSNigel Croxon UINT32 1048530d68baSNigel Croxon ReadPciConfig ( 1049530d68baSNigel Croxon IN EFI_DEVICE_IO_INTERFACE *GlobalIoFncs, 1050530d68baSNigel Croxon IN EFI_IO_WIDTH Width, 1051530d68baSNigel Croxon IN UINTN Port 1052530d68baSNigel Croxon ); 1053530d68baSNigel Croxon 1054530d68baSNigel Croxon UINT32 1055530d68baSNigel Croxon WritePciConfig ( 1056530d68baSNigel Croxon IN EFI_DEVICE_IO_INTERFACE *GlobalIoFncs, 1057530d68baSNigel Croxon IN EFI_IO_WIDTH Width, 1058530d68baSNigel Croxon IN UINTN Port, 1059530d68baSNigel Croxon IN UINTN Data 1060530d68baSNigel Croxon ); 1061530d68baSNigel Croxon 10627cc4f3a2SKagurazaka Kotori VOID 10637cc4f3a2SKagurazaka Kotori Pause ( 10647cc4f3a2SKagurazaka Kotori VOID 10657cc4f3a2SKagurazaka Kotori ); 10667cc4f3a2SKagurazaka Kotori 1067530d68baSNigel Croxon extern EFI_DEVICE_IO_INTERFACE *GlobalIoFncs; 1068530d68baSNigel Croxon 1069530d68baSNigel Croxon #define outp(_Port, _DataByte) (UINT8)WritePort(GlobalIoFncs, IO_UINT8, (UINTN)_Port, (UINTN)_DataByte) 1070530d68baSNigel Croxon #define inp(_Port) (UINT8)ReadPort(GlobalIoFncs, IO_UINT8, (UINTN)_Port) 1071530d68baSNigel Croxon #define outpw(_Port, _DataByte) (UINT16)WritePort(GlobalIoFncs, IO_UINT16, (UINTN)_Port, (UINTN)_DataByte) 1072530d68baSNigel Croxon #define inpw(_Port) (UINT16)ReadPort(GlobalIoFncs, IO_UINT16, (UINTN)_Port) 1073530d68baSNigel Croxon #define outpd(_Port, _DataByte) (UINT32)WritePort(GlobalIoFncs, IO_UINT32, (UINTN)_Port, (UINTN)_DataByte) 1074530d68baSNigel Croxon #define inpd(_Port) (UINT32)ReadPort(GlobalIoFncs, IO_UINT32, (UINTN)_Port) 1075530d68baSNigel Croxon 1076530d68baSNigel Croxon #define writepci8(_Addr, _DataByte) (UINT8)WritePciConfig(GlobalIoFncs, IO_UINT8, (UINTN)_Addr, (UINTN)_DataByte) 1077530d68baSNigel Croxon #define readpci8(_Addr) (UINT8)ReadPciConfig(GlobalIoFncs, IO_UINT8, (UINTN)_Addr) 1078530d68baSNigel Croxon #define writepci16(_Addr, _DataByte) (UINT16)WritePciConfig(GlobalIoFncs, IO_UINT16, (UINTN)_Addr, (UINTN)_DataByte) 1079530d68baSNigel Croxon #define readpci16(_Addr) (UINT16)ReadPciConfig(GlobalIoFncs, IO_UINT16, (UINTN)_Addr) 1080530d68baSNigel Croxon #define writepci32(_Addr, _DataByte) (UINT32)WritePciConfig(GlobalIoFncs, IO_UINT32, (UINTN)_Addr, (UINTN)_DataByte) 1081530d68baSNigel Croxon #define readpci32(_Addr) (UINT32)ReadPciConfig(GlobalIoFncs, IO_UINT32, (UINTN)_Addr) 1082530d68baSNigel Croxon 1083530d68baSNigel Croxon #define Port80(_PostCode) GlobalIoFncs->Io.Write (GlobalIoFncs, IO_UINT16, (UINT64)0x80, 1, &(_PostCode)) 1084530d68baSNigel Croxon 10855e85f477SCallum Farmer #ifdef __cplusplus 10865e85f477SCallum Farmer } 10875e85f477SCallum Farmer #endif 10885e85f477SCallum Farmer 1089530d68baSNigel Croxon #endif 1090