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 22530d68baSNigel Croxon #include "efidebug.h" 23530d68baSNigel Croxon #include "efipart.h" 24530d68baSNigel Croxon #include "efilibplat.h" 25530d68baSNigel Croxon #include "efilink.h" 26530d68baSNigel Croxon #include "efirtlib.h" 27530d68baSNigel Croxon #include "efistdarg.h" 28530d68baSNigel Croxon #include "pci22.h" 29530d68baSNigel Croxon #include "libsmbios.h" 30530d68baSNigel Croxon 31530d68baSNigel Croxon // 32530d68baSNigel Croxon // Public read-only data in the EFI library 33530d68baSNigel Croxon // 34530d68baSNigel Croxon 35530d68baSNigel Croxon extern EFI_SYSTEM_TABLE *ST; 36*9cdd67daSNigel Croxon #define gST ST 37530d68baSNigel Croxon extern EFI_BOOT_SERVICES *BS; 38*9cdd67daSNigel Croxon #define gBS BS 39530d68baSNigel Croxon extern EFI_RUNTIME_SERVICES *RT; 40*9cdd67daSNigel Croxon #define gRT RT 41530d68baSNigel Croxon 42751cbce3SNigel Croxon extern EFI_GUID gEfiDevicePathProtocolGuid; 43751cbce3SNigel Croxon #define DevicePathProtocol gEfiDevicePathProtocolGuid 44751cbce3SNigel Croxon extern EFI_GUID gEfiDevicePathToTextProtocolGuid; 45751cbce3SNigel Croxon #define DevicePathToTextProtocol gEfiDevicePathToTextProtocolGuid 46751cbce3SNigel Croxon extern EFI_GUID gEfiDevicePathFromTextProtocolGuid; 47751cbce3SNigel Croxon #define DevicePathFromTextProtocol gEfiDevicePathFromTextProtocolGuid 48751cbce3SNigel Croxon extern EFI_GUID gEfiLoadedImageProtocolGuid; 49751cbce3SNigel Croxon #define LoadedImageProtocol gEfiLoadedImageProtocolGuid 50751cbce3SNigel Croxon extern EFI_GUID gEfiSimpleTextInProtocolGuid; 51751cbce3SNigel Croxon #define TextInProtocol gEfiSimpleTextInProtocolGuid 52751cbce3SNigel Croxon extern EFI_GUID gEfiSimpleTextOutProtocolGuid; 53751cbce3SNigel Croxon #define TextOutProtocol gEfiSimpleTextOutProtocolGuid 54751cbce3SNigel Croxon extern EFI_GUID gEfiGraphicsOutputProtocolGuid; 55751cbce3SNigel Croxon #define GraphicsOutputProtocol gEfiGraphicsOutputProtocolGuid 56751cbce3SNigel Croxon extern EFI_GUID gEfiEdidDiscoveredProtocolGuid; 57751cbce3SNigel Croxon #define EdidDiscoveredProtocol gEfiEdidDiscoveredProtocolGuid 58751cbce3SNigel Croxon extern EFI_GUID gEfiEdidActiveProtocolGuid; 59751cbce3SNigel Croxon #define EdidActiveProtocol gEfiEdidActiveProtocolGuid 60751cbce3SNigel Croxon extern EFI_GUID gEfiEdidOverrideProtocolGuid; 61751cbce3SNigel Croxon #define EdidOverrideProtocol gEfiEdidOverrideProtocolGuid 62751cbce3SNigel Croxon extern EFI_GUID gEfiBlockIoProtocolGuid; 63751cbce3SNigel Croxon #define BlockIoProtocol gEfiBlockIoProtocolGuid 64751cbce3SNigel Croxon extern EFI_GUID gEfiBlockIo2ProtocolGuid; 65751cbce3SNigel Croxon #define BlockIo2Protocol gEfiBlockIo2ProtocolGuid 66751cbce3SNigel Croxon extern EFI_GUID gEfiDiskIoProtocolGuid; 67751cbce3SNigel Croxon #define DiskIoProtocol gEfiDiskIoProtocolGuid 68751cbce3SNigel Croxon extern EFI_GUID gEfiDiskIo2ProtocolGuid; 69751cbce3SNigel Croxon #define DiskIo2Protocol gEfiDiskIo2ProtocolGuid 70751cbce3SNigel Croxon extern EFI_GUID gEfiSimpleFileSystemProtocolGuid; 71751cbce3SNigel Croxon #define FileSystemProtocol gEfiSimpleFileSystemProtocolGuid 72751cbce3SNigel Croxon extern EFI_GUID gEfiLoadFileProtocolGuid; 73751cbce3SNigel Croxon #define LoadFileProtocol gEfiLoadFileProtocolGuid 74751cbce3SNigel Croxon extern EFI_GUID gEfiDeviceIoProtocolGuid; 75751cbce3SNigel Croxon #define DeviceIoProtocol gEfiDeviceIoProtocolGuid 76530d68baSNigel Croxon extern EFI_GUID VariableStoreProtocol; 77530d68baSNigel Croxon extern EFI_GUID LegacyBootProtocol; 78751cbce3SNigel Croxon extern EFI_GUID gEfiUnicodeCollationProtocolGuid; 79751cbce3SNigel Croxon #define UnicodeCollationProtocol gEfiUnicodeCollationProtocolGuid 80751cbce3SNigel Croxon extern EFI_GUID gEfiSerialIoProtocolGuid; 81751cbce3SNigel Croxon #define SerialIoProtocol gEfiSerialIoProtocolGuid 82530d68baSNigel Croxon extern EFI_GUID VgaClassProtocol; 83530d68baSNigel Croxon extern EFI_GUID TextOutSpliterProtocol; 84530d68baSNigel Croxon extern EFI_GUID ErrorOutSpliterProtocol; 85530d68baSNigel Croxon extern EFI_GUID TextInSpliterProtocol; 86751cbce3SNigel Croxon extern EFI_GUID gEfiSimpleNetworkProtocolGuid; 87751cbce3SNigel Croxon #define SimpleNetworkProtocol gEfiSimpleNetworkProtocolGuid 88751cbce3SNigel Croxon extern EFI_GUID gEfiPxeBaseCodeProtocolGuid; 89751cbce3SNigel Croxon #define PxeBaseCodeProtocol gEfiPxeBaseCodeProtocolGuid 90751cbce3SNigel Croxon extern EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid; 91751cbce3SNigel Croxon #define PxeCallbackProtocol gEfiPxeBaseCodeCallbackProtocolGuid 92751cbce3SNigel Croxon extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid; 93751cbce3SNigel Croxon #define NetworkInterfaceIdentifierProtocol gEfiNetworkInterfaceIdentifierProtocolGuid 94751cbce3SNigel Croxon extern EFI_GUID gEFiUiInterfaceProtocolGuid; 95751cbce3SNigel Croxon #define UiProtocol gEFiUiInterfaceProtocolGuid 96530d68baSNigel Croxon extern EFI_GUID InternalShellProtocol; 97751cbce3SNigel Croxon extern EFI_GUID gEfiPciIoProtocolGuid; 98751cbce3SNigel Croxon #define PciIoProtocol gEfiPciIoProtocolGuid 99751cbce3SNigel Croxon extern EFI_GUID gEfiDriverBindingProtocolGuid; 100751cbce3SNigel Croxon #define DriverBindingProtocol gEfiDriverBindingProtocolGuid 101751cbce3SNigel Croxon extern EFI_GUID gEfiComponentNameProtocolGuid; 102751cbce3SNigel Croxon #define ComponentNameProtocol gEfiComponentNameProtocolGuid 103751cbce3SNigel Croxon extern EFI_GUID gEfiComponentName2ProtocolGuid; 104751cbce3SNigel Croxon #define ComponentName2Protocol gEfiComponentName2ProtocolGuid 105751cbce3SNigel Croxon extern EFI_GUID gEfiHashProtocolGuid; 106751cbce3SNigel Croxon #define HashProtocol gEfiHashProtocolGuid 107751cbce3SNigel Croxon extern EFI_GUID gEfiPlatformDriverOverrideProtocolGuid; 108751cbce3SNigel Croxon #define PlatformDriverOverrideProtocol gEfiPlatformDriverOverrideProtocolGuid 109751cbce3SNigel Croxon extern EFI_GUID gEfiBusSpecificDriverOverrideProtocolGuid; 110751cbce3SNigel Croxon #define BusSpecificDriverOverrideProtocol gEfiBusSpecificDriverOverrideProtocolGuid 111751cbce3SNigel Croxon extern EFI_GUID gEfiDriverFamilyOverrideProtocolGuid; 112751cbce3SNigel Croxon #define DriverFamilyOverrideProtocol gEfiDriverFamilyOverrideProtocolGuid 113530d68baSNigel Croxon 114751cbce3SNigel Croxon extern EFI_GUID gEfiGlobalVariableGuid; 115751cbce3SNigel Croxon #define EfiGlobalVariable gEfiGlobalVariableGuid 116751cbce3SNigel Croxon extern EFI_GUID gEfiFileInfoGuid; 117751cbce3SNigel Croxon #define GenericFileInfo gEfiFileInfoGuid 118751cbce3SNigel Croxon extern EFI_GUID gEfiFileSystemInfoGuid; 119751cbce3SNigel Croxon #define FileSystemInfo gEfiFileSystemInfoGuid 120751cbce3SNigel Croxon extern EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid; 121751cbce3SNigel Croxon #define FileSystemVolumeLabelInfo gEfiFileSystemVolumeLabelInfoIdGuid 122751cbce3SNigel Croxon extern EFI_GUID gEfiPcAnsiGuid; 123751cbce3SNigel Croxon #define PcAnsiProtocol gEfiPcAnsiGuid 124751cbce3SNigel Croxon extern EFI_GUID gEfiVT100Guid; 125751cbce3SNigel Croxon #define Vt100Protocol gEfiVT100Guid 126751cbce3SNigel Croxon extern EFI_GUID gEfiVT100PlusGuid; 127751cbce3SNigel Croxon extern EFI_GUID gEfiVTUTF8Guid; 128751cbce3SNigel Croxon 129530d68baSNigel Croxon extern EFI_GUID NullGuid; 130530d68baSNigel Croxon extern EFI_GUID UnknownDevice; 131530d68baSNigel Croxon 132530d68baSNigel Croxon extern EFI_GUID EfiPartTypeSystemPartitionGuid; 133530d68baSNigel Croxon extern EFI_GUID EfiPartTypeLegacyMbrGuid; 134530d68baSNigel Croxon 135530d68baSNigel Croxon extern EFI_GUID MpsTableGuid; 136530d68baSNigel Croxon extern EFI_GUID AcpiTableGuid; 137530d68baSNigel Croxon extern EFI_GUID SMBIOSTableGuid; 138530d68baSNigel Croxon extern EFI_GUID SalSystemTableGuid; 139530d68baSNigel Croxon 140530d68baSNigel Croxon extern EFI_GUID SimplePointerProtocol; 141530d68baSNigel Croxon extern EFI_GUID AbsolutePointerProtocol; 142530d68baSNigel Croxon 143530d68baSNigel Croxon // 144530d68baSNigel Croxon // EFI Variable strings 145530d68baSNigel Croxon // 146530d68baSNigel Croxon #define LOAD_OPTION_ACTIVE 0x00000001 147530d68baSNigel Croxon 148530d68baSNigel Croxon #define VarLanguageCodes L"LangCodes" 149530d68baSNigel Croxon #define VarLanguage L"Lang" 150530d68baSNigel Croxon #define VarTimeout L"Timeout" 151530d68baSNigel Croxon #define VarConsoleInp L"ConIn" 152530d68baSNigel Croxon #define VarConsoleOut L"ConOut" 153530d68baSNigel Croxon #define VarErrorOut L"ErrOut" 154530d68baSNigel Croxon #define VarBootOption L"Boot%04x" 155530d68baSNigel Croxon #define VarBootOrder L"BootOrder" 156530d68baSNigel Croxon #define VarBootNext L"BootNext" 157530d68baSNigel Croxon #define VarBootCurrent L"BootCurrent" 158530d68baSNigel Croxon #define VarDriverOption L"Driver%04x" 159530d68baSNigel Croxon #define VarDriverOrder L"DriverOrder" 160530d68baSNigel Croxon #define VarConsoleInpDev L"ConInDev" 161530d68baSNigel Croxon #define VarConsoleOutDev L"ConOutDev" 162530d68baSNigel Croxon #define VarErrorOutDev L"ErrOutDev" 163530d68baSNigel Croxon 164530d68baSNigel Croxon #define LanguageCodeEnglish "eng" 165530d68baSNigel Croxon 166530d68baSNigel Croxon extern EFI_DEVICE_PATH RootDevicePath[]; 167530d68baSNigel Croxon extern EFI_DEVICE_PATH EndDevicePath[]; 168530d68baSNigel Croxon extern EFI_DEVICE_PATH EndInstanceDevicePath[]; 169530d68baSNigel Croxon 170530d68baSNigel Croxon // 171530d68baSNigel Croxon // Other public data in the EFI library 172530d68baSNigel Croxon // 173530d68baSNigel Croxon 174530d68baSNigel Croxon extern EFI_MEMORY_TYPE PoolAllocationType; 175530d68baSNigel Croxon 176530d68baSNigel Croxon // 177530d68baSNigel Croxon // STATIC - Name is internal to the module 178530d68baSNigel Croxon // INTERNAL - Name is internal to the component (i.e., directory) 179530d68baSNigel Croxon // BOOTSERVCE - Name of a boot service function 180530d68baSNigel Croxon // 181530d68baSNigel Croxon 182530d68baSNigel Croxon #define STATIC 183530d68baSNigel Croxon #define INTERNAL 184530d68baSNigel Croxon #define BOOTSERVICE 185530d68baSNigel Croxon 186530d68baSNigel Croxon // 187530d68baSNigel Croxon // Prototypes 188530d68baSNigel Croxon // 189530d68baSNigel Croxon 190530d68baSNigel Croxon VOID 191530d68baSNigel Croxon InitializeLib ( 192530d68baSNigel Croxon IN EFI_HANDLE ImageHandle, 193530d68baSNigel Croxon IN EFI_SYSTEM_TABLE *SystemTable 194530d68baSNigel Croxon ); 195530d68baSNigel Croxon 196530d68baSNigel Croxon VOID 197530d68baSNigel Croxon InitializeUnicodeSupport ( 198530d68baSNigel Croxon CHAR8 *LangCode 199530d68baSNigel Croxon ); 200530d68baSNigel Croxon 201530d68baSNigel Croxon VOID 202530d68baSNigel Croxon EFIDebugVariable ( 203530d68baSNigel Croxon VOID 204530d68baSNigel Croxon ); 205530d68baSNigel Croxon 206530d68baSNigel Croxon INTN 207530d68baSNigel Croxon GetShellArgcArgv( 208530d68baSNigel Croxon EFI_HANDLE ImageHandle, 209530d68baSNigel Croxon CHAR16 **Argv[] /* Statically allocated */ 210530d68baSNigel Croxon ); 211530d68baSNigel Croxon 212530d68baSNigel Croxon VOID 213530d68baSNigel Croxon SetCrc ( 214530d68baSNigel Croxon IN OUT EFI_TABLE_HEADER *Hdr 215530d68baSNigel Croxon ); 216530d68baSNigel Croxon 217530d68baSNigel Croxon VOID 218530d68baSNigel Croxon SetCrcAltSize ( 219530d68baSNigel Croxon IN UINTN Size, 220530d68baSNigel Croxon IN OUT EFI_TABLE_HEADER *Hdr 221530d68baSNigel Croxon ); 222530d68baSNigel Croxon 223530d68baSNigel Croxon BOOLEAN 224530d68baSNigel Croxon CheckCrc ( 225530d68baSNigel Croxon IN UINTN MaxSize, 226530d68baSNigel Croxon IN OUT EFI_TABLE_HEADER *Hdr 227530d68baSNigel Croxon ); 228530d68baSNigel Croxon 229530d68baSNigel Croxon BOOLEAN 230530d68baSNigel Croxon CheckCrcAltSize ( 231530d68baSNigel Croxon IN UINTN MaxSize, 232530d68baSNigel Croxon IN UINTN Size, 233530d68baSNigel Croxon IN OUT EFI_TABLE_HEADER *Hdr 234530d68baSNigel Croxon ); 235530d68baSNigel Croxon 236530d68baSNigel Croxon UINT32 237530d68baSNigel Croxon CalculateCrc ( 238530d68baSNigel Croxon UINT8 *pt, 239530d68baSNigel Croxon UINTN Size 240530d68baSNigel Croxon ); 241530d68baSNigel Croxon 242530d68baSNigel Croxon VOID 243530d68baSNigel Croxon ZeroMem ( 244530d68baSNigel Croxon IN VOID *Buffer, 245530d68baSNigel Croxon IN UINTN Size 246530d68baSNigel Croxon ); 247530d68baSNigel Croxon 248530d68baSNigel Croxon VOID 249530d68baSNigel Croxon SetMem ( 250530d68baSNigel Croxon IN VOID *Buffer, 251530d68baSNigel Croxon IN UINTN Size, 252530d68baSNigel Croxon IN UINT8 Value 253530d68baSNigel Croxon ); 254530d68baSNigel Croxon 255530d68baSNigel Croxon VOID 256530d68baSNigel Croxon CopyMem ( 257530d68baSNigel Croxon IN VOID *Dest, 258530d68baSNigel Croxon IN CONST VOID *Src, 259530d68baSNigel Croxon IN UINTN len 260530d68baSNigel Croxon ); 261530d68baSNigel Croxon 262530d68baSNigel Croxon INTN 263530d68baSNigel Croxon CompareMem ( 264530d68baSNigel Croxon IN CONST VOID *Dest, 265530d68baSNigel Croxon IN CONST VOID *Src, 266530d68baSNigel Croxon IN UINTN len 267530d68baSNigel Croxon ); 268530d68baSNigel Croxon 269530d68baSNigel Croxon INTN 270530d68baSNigel Croxon StrCmp ( 271530d68baSNigel Croxon IN CONST CHAR16 *s1, 272530d68baSNigel Croxon IN CONST CHAR16 *s2 273530d68baSNigel Croxon ); 274530d68baSNigel Croxon 275530d68baSNigel Croxon INTN 276530d68baSNigel Croxon StrnCmp ( 277530d68baSNigel Croxon IN CONST CHAR16 *s1, 278530d68baSNigel Croxon IN CONST CHAR16 *s2, 279530d68baSNigel Croxon IN UINTN len 280530d68baSNigel Croxon ); 281530d68baSNigel Croxon 282530d68baSNigel Croxon INTN 283530d68baSNigel Croxon StriCmp ( 284530d68baSNigel Croxon IN CONST CHAR16 *s1, 285530d68baSNigel Croxon IN CONST CHAR16 *s2 286530d68baSNigel Croxon ); 287530d68baSNigel Croxon 288530d68baSNigel Croxon VOID 289530d68baSNigel Croxon StrLwr ( 290530d68baSNigel Croxon IN CHAR16 *Str 291530d68baSNigel Croxon ); 292530d68baSNigel Croxon 293530d68baSNigel Croxon VOID 294530d68baSNigel Croxon StrUpr ( 295530d68baSNigel Croxon IN CHAR16 *Str 296530d68baSNigel Croxon ); 297530d68baSNigel Croxon 298530d68baSNigel Croxon VOID 299530d68baSNigel Croxon StrCpy ( 300530d68baSNigel Croxon IN CHAR16 *Dest, 301530d68baSNigel Croxon IN CONST CHAR16 *Src 302530d68baSNigel Croxon ); 303530d68baSNigel Croxon 304530d68baSNigel Croxon VOID 305530d68baSNigel Croxon StrCat ( 306530d68baSNigel Croxon IN CHAR16 *Dest, 307530d68baSNigel Croxon IN CONST CHAR16 *Src 308530d68baSNigel Croxon ); 309530d68baSNigel Croxon 310530d68baSNigel Croxon UINTN 311530d68baSNigel Croxon StrLen ( 312530d68baSNigel Croxon IN CONST CHAR16 *s1 313530d68baSNigel Croxon ); 314530d68baSNigel Croxon 315530d68baSNigel Croxon UINTN 316530d68baSNigel Croxon StrSize ( 317530d68baSNigel Croxon IN CONST CHAR16 *s1 318530d68baSNigel Croxon ); 319530d68baSNigel Croxon 320530d68baSNigel Croxon CHAR16 * 321530d68baSNigel Croxon StrDuplicate ( 322530d68baSNigel Croxon IN CONST CHAR16 *Src 323530d68baSNigel Croxon ); 324530d68baSNigel Croxon 325530d68baSNigel Croxon UINTN 326530d68baSNigel Croxon strlena ( 327530d68baSNigel Croxon IN CONST CHAR8 *s1 328530d68baSNigel Croxon ); 329530d68baSNigel Croxon 330530d68baSNigel Croxon UINTN 331530d68baSNigel Croxon strcmpa ( 332530d68baSNigel Croxon IN CONST CHAR8 *s1, 333530d68baSNigel Croxon IN CONST CHAR8 *s2 334530d68baSNigel Croxon ); 335530d68baSNigel Croxon 336530d68baSNigel Croxon UINTN 337530d68baSNigel Croxon strncmpa ( 338530d68baSNigel Croxon IN CONST CHAR8 *s1, 339530d68baSNigel Croxon IN CONST CHAR8 *s2, 340530d68baSNigel Croxon IN UINTN len 341530d68baSNigel Croxon ); 342530d68baSNigel Croxon 343530d68baSNigel Croxon UINTN 344530d68baSNigel Croxon xtoi ( 345530d68baSNigel Croxon CONST CHAR16 *str 346530d68baSNigel Croxon ); 347530d68baSNigel Croxon 348530d68baSNigel Croxon UINTN 349530d68baSNigel Croxon Atoi ( 350530d68baSNigel Croxon CONST CHAR16 *str 351530d68baSNigel Croxon ); 352530d68baSNigel Croxon 353530d68baSNigel Croxon BOOLEAN 354530d68baSNigel Croxon MetaMatch ( 355530d68baSNigel Croxon IN CHAR16 *String, 356530d68baSNigel Croxon IN CHAR16 *Pattern 357530d68baSNigel Croxon ); 358530d68baSNigel Croxon 359530d68baSNigel Croxon BOOLEAN 360530d68baSNigel Croxon MetaiMatch ( 361530d68baSNigel Croxon IN CHAR16 *String, 362530d68baSNigel Croxon IN CHAR16 *Pattern 363530d68baSNigel Croxon ); 364530d68baSNigel Croxon 365530d68baSNigel Croxon UINT64 366530d68baSNigel Croxon LShiftU64 ( 367530d68baSNigel Croxon IN UINT64 Operand, 368530d68baSNigel Croxon IN UINTN Count 369530d68baSNigel Croxon ); 370530d68baSNigel Croxon 371530d68baSNigel Croxon UINT64 372530d68baSNigel Croxon RShiftU64 ( 373530d68baSNigel Croxon IN UINT64 Operand, 374530d68baSNigel Croxon IN UINTN Count 375530d68baSNigel Croxon ); 376530d68baSNigel Croxon 377530d68baSNigel Croxon UINT64 378530d68baSNigel Croxon MultU64x32 ( 379530d68baSNigel Croxon IN UINT64 Multiplicand, 380530d68baSNigel Croxon IN UINTN Multiplier 381530d68baSNigel Croxon ); 382530d68baSNigel Croxon 383530d68baSNigel Croxon UINT64 384530d68baSNigel Croxon DivU64x32 ( 385530d68baSNigel Croxon IN UINT64 Dividend, 386530d68baSNigel Croxon IN UINTN Divisor, 387530d68baSNigel Croxon OUT UINTN *Remainder OPTIONAL 388530d68baSNigel Croxon ); 389530d68baSNigel Croxon 390530d68baSNigel Croxon VOID 391530d68baSNigel Croxon InitializeLock ( 392530d68baSNigel Croxon IN OUT FLOCK *Lock, 393530d68baSNigel Croxon IN EFI_TPL Priority 394530d68baSNigel Croxon ); 395530d68baSNigel Croxon 396530d68baSNigel Croxon VOID 397530d68baSNigel Croxon AcquireLock ( 398530d68baSNigel Croxon IN FLOCK *Lock 399530d68baSNigel Croxon ); 400530d68baSNigel Croxon 401530d68baSNigel Croxon VOID 402530d68baSNigel Croxon ReleaseLock ( 403530d68baSNigel Croxon IN FLOCK *Lock 404530d68baSNigel Croxon ); 405530d68baSNigel Croxon 406530d68baSNigel Croxon 407530d68baSNigel Croxon INTN 408530d68baSNigel Croxon CompareGuid( 409530d68baSNigel Croxon IN EFI_GUID *Guid1, 410530d68baSNigel Croxon IN EFI_GUID *Guid2 411530d68baSNigel Croxon ); 412530d68baSNigel Croxon 413530d68baSNigel Croxon VOID * 414530d68baSNigel Croxon AllocatePool ( 415530d68baSNigel Croxon IN UINTN Size 416530d68baSNigel Croxon ); 417530d68baSNigel Croxon 418530d68baSNigel Croxon VOID * 419530d68baSNigel Croxon AllocateZeroPool ( 420530d68baSNigel Croxon IN UINTN Size 421530d68baSNigel Croxon ); 422530d68baSNigel Croxon 423530d68baSNigel Croxon VOID * 424530d68baSNigel Croxon ReallocatePool ( 425530d68baSNigel Croxon IN VOID *OldPool, 426530d68baSNigel Croxon IN UINTN OldSize, 427530d68baSNigel Croxon IN UINTN NewSize 428530d68baSNigel Croxon ); 429530d68baSNigel Croxon 430530d68baSNigel Croxon VOID 431530d68baSNigel Croxon FreePool ( 432530d68baSNigel Croxon IN VOID *p 433530d68baSNigel Croxon ); 434530d68baSNigel Croxon 435530d68baSNigel Croxon 436530d68baSNigel Croxon VOID 437530d68baSNigel Croxon Output ( 438530d68baSNigel Croxon IN CHAR16 *Str 439530d68baSNigel Croxon ); 440530d68baSNigel Croxon 441530d68baSNigel Croxon VOID 442530d68baSNigel Croxon Input ( 443530d68baSNigel Croxon IN CHAR16 *Prompt OPTIONAL, 444530d68baSNigel Croxon OUT CHAR16 *InStr, 445530d68baSNigel Croxon IN UINTN StrLen 446530d68baSNigel Croxon ); 447530d68baSNigel Croxon 448530d68baSNigel Croxon VOID 449530d68baSNigel Croxon IInput ( 450530d68baSNigel Croxon IN SIMPLE_TEXT_OUTPUT_INTERFACE *ConOut, 451530d68baSNigel Croxon IN SIMPLE_INPUT_INTERFACE *ConIn, 452530d68baSNigel Croxon IN CHAR16 *Prompt OPTIONAL, 453530d68baSNigel Croxon OUT CHAR16 *InStr, 454530d68baSNigel Croxon IN UINTN StrLen 455530d68baSNigel Croxon ); 456530d68baSNigel Croxon 457530d68baSNigel Croxon UINTN 458530d68baSNigel Croxon Print ( 459530d68baSNigel Croxon IN CHAR16 *fmt, 460530d68baSNigel Croxon ... 461530d68baSNigel Croxon ); 462530d68baSNigel Croxon 463530d68baSNigel Croxon UINTN 464530d68baSNigel Croxon VPrint ( 465530d68baSNigel Croxon IN CHAR16 *fmt, 466530d68baSNigel Croxon va_list args 467530d68baSNigel Croxon ); 468530d68baSNigel Croxon 469530d68baSNigel Croxon UINTN 470530d68baSNigel Croxon SPrint ( 471530d68baSNigel Croxon OUT CHAR16 *Str, 472530d68baSNigel Croxon IN UINTN StrSize, 473530d68baSNigel Croxon IN CHAR16 *fmt, 474530d68baSNigel Croxon ... 475530d68baSNigel Croxon ); 476530d68baSNigel Croxon 477530d68baSNigel Croxon UINTN 478530d68baSNigel Croxon VSPrint ( 479530d68baSNigel Croxon OUT CHAR16 *Str, 480530d68baSNigel Croxon IN UINTN StrSize, 481530d68baSNigel Croxon IN CHAR16 *fmt, 482530d68baSNigel Croxon va_list args 483530d68baSNigel Croxon ); 484530d68baSNigel Croxon 485530d68baSNigel Croxon CHAR16 * 486530d68baSNigel Croxon VPoolPrint ( 487530d68baSNigel Croxon IN CHAR16 *fmt, 488530d68baSNigel Croxon va_list args 489530d68baSNigel Croxon ); 490530d68baSNigel Croxon 491530d68baSNigel Croxon CHAR16 * 492530d68baSNigel Croxon PoolPrint ( 493530d68baSNigel Croxon IN CHAR16 *fmt, 494530d68baSNigel Croxon ... 495530d68baSNigel Croxon ); 496530d68baSNigel Croxon 497530d68baSNigel Croxon typedef struct { 498530d68baSNigel Croxon CHAR16 *str; 499530d68baSNigel Croxon UINTN len; 500530d68baSNigel Croxon UINTN maxlen; 501530d68baSNigel Croxon } POOL_PRINT; 502530d68baSNigel Croxon 503530d68baSNigel Croxon CHAR16 * 504530d68baSNigel Croxon CatPrint ( 505530d68baSNigel Croxon IN OUT POOL_PRINT *Str, 506530d68baSNigel Croxon IN CHAR16 *fmt, 507530d68baSNigel Croxon ... 508530d68baSNigel Croxon ); 509530d68baSNigel Croxon 510530d68baSNigel Croxon UINTN 511530d68baSNigel Croxon PrintAt ( 512530d68baSNigel Croxon IN UINTN Column, 513530d68baSNigel Croxon IN UINTN Row, 514530d68baSNigel Croxon IN CHAR16 *fmt, 515530d68baSNigel Croxon ... 516530d68baSNigel Croxon ); 517530d68baSNigel Croxon 518530d68baSNigel Croxon UINTN 519530d68baSNigel Croxon IPrint ( 520530d68baSNigel Croxon IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out, 521530d68baSNigel Croxon IN CHAR16 *fmt, 522530d68baSNigel Croxon ... 523530d68baSNigel Croxon ); 524530d68baSNigel Croxon 525530d68baSNigel Croxon UINTN 526530d68baSNigel Croxon IPrintAt ( 527530d68baSNigel Croxon IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out, 528530d68baSNigel Croxon IN UINTN Column, 529530d68baSNigel Croxon IN UINTN Row, 530530d68baSNigel Croxon IN CHAR16 *fmt, 531530d68baSNigel Croxon ... 532530d68baSNigel Croxon ); 533530d68baSNigel Croxon 534530d68baSNigel Croxon UINTN 535530d68baSNigel Croxon APrint ( 536530d68baSNigel Croxon IN CHAR8 *fmt, 537530d68baSNigel Croxon ... 538530d68baSNigel Croxon ); 539530d68baSNigel Croxon 540530d68baSNigel Croxon VOID 541530d68baSNigel Croxon ValueToHex ( 542530d68baSNigel Croxon IN CHAR16 *Buffer, 543530d68baSNigel Croxon IN UINT64 v 544530d68baSNigel Croxon ); 545530d68baSNigel Croxon 546530d68baSNigel Croxon VOID 547530d68baSNigel Croxon ValueToString ( 548530d68baSNigel Croxon IN CHAR16 *Buffer, 549530d68baSNigel Croxon IN BOOLEAN Comma, 550530d68baSNigel Croxon IN INT64 v 551530d68baSNigel Croxon ); 552530d68baSNigel Croxon 553530d68baSNigel Croxon VOID 554b2c4db06SNigel Croxon FloatToString ( 555b2c4db06SNigel Croxon IN CHAR16 *Buffer, 556b2c4db06SNigel Croxon IN BOOLEAN Comma, 557b2c4db06SNigel Croxon IN double v 558b2c4db06SNigel Croxon ); 559b2c4db06SNigel Croxon 560b2c4db06SNigel Croxon VOID 561530d68baSNigel Croxon TimeToString ( 562530d68baSNigel Croxon OUT CHAR16 *Buffer, 563530d68baSNigel Croxon IN EFI_TIME *Time 564530d68baSNigel Croxon ); 565530d68baSNigel Croxon 566530d68baSNigel Croxon VOID 567530d68baSNigel Croxon GuidToString ( 568530d68baSNigel Croxon OUT CHAR16 *Buffer, 569530d68baSNigel Croxon IN EFI_GUID *Guid 570530d68baSNigel Croxon ); 571530d68baSNigel Croxon 572530d68baSNigel Croxon VOID 573530d68baSNigel Croxon StatusToString ( 574530d68baSNigel Croxon OUT CHAR16 *Buffer, 575530d68baSNigel Croxon EFI_STATUS Status 576530d68baSNigel Croxon ); 577530d68baSNigel Croxon 578530d68baSNigel Croxon VOID 579530d68baSNigel Croxon DumpHex ( 580530d68baSNigel Croxon IN UINTN Indent, 581530d68baSNigel Croxon IN UINTN Offset, 582530d68baSNigel Croxon IN UINTN DataSize, 583530d68baSNigel Croxon IN VOID *UserData 584530d68baSNigel Croxon ); 585530d68baSNigel Croxon 586530d68baSNigel Croxon BOOLEAN 587530d68baSNigel Croxon GrowBuffer( 588530d68baSNigel Croxon IN OUT EFI_STATUS *Status, 589530d68baSNigel Croxon IN OUT VOID **Buffer, 590530d68baSNigel Croxon IN UINTN BufferSize 591530d68baSNigel Croxon ); 592530d68baSNigel Croxon 593530d68baSNigel Croxon EFI_MEMORY_DESCRIPTOR * 594530d68baSNigel Croxon LibMemoryMap ( 595530d68baSNigel Croxon OUT UINTN *NoEntries, 596530d68baSNigel Croxon OUT UINTN *MapKey, 597530d68baSNigel Croxon OUT UINTN *DescriptorSize, 598530d68baSNigel Croxon OUT UINT32 *DescriptorVersion 599530d68baSNigel Croxon ); 600530d68baSNigel Croxon 601530d68baSNigel Croxon VOID * 602530d68baSNigel Croxon LibGetVariable ( 603530d68baSNigel Croxon IN CHAR16 *Name, 604530d68baSNigel Croxon IN EFI_GUID *VendorGuid 605530d68baSNigel Croxon ); 606530d68baSNigel Croxon 607530d68baSNigel Croxon VOID * 608530d68baSNigel Croxon LibGetVariableAndSize ( 609530d68baSNigel Croxon IN CHAR16 *Name, 610530d68baSNigel Croxon IN EFI_GUID *VendorGuid, 611530d68baSNigel Croxon OUT UINTN *VarSize 612530d68baSNigel Croxon ); 613530d68baSNigel Croxon 614530d68baSNigel Croxon EFI_STATUS 615530d68baSNigel Croxon LibDeleteVariable ( 616530d68baSNigel Croxon IN CHAR16 *VarName, 617530d68baSNigel Croxon IN EFI_GUID *VarGuid 618530d68baSNigel Croxon ); 619530d68baSNigel Croxon 620530d68baSNigel Croxon EFI_STATUS 621530d68baSNigel Croxon LibSetNVVariable ( 622530d68baSNigel Croxon IN CHAR16 *VarName, 623530d68baSNigel Croxon IN EFI_GUID *VarGuid, 624530d68baSNigel Croxon IN UINTN DataSize, 625530d68baSNigel Croxon IN VOID *Data 626530d68baSNigel Croxon ); 627530d68baSNigel Croxon 628530d68baSNigel Croxon EFI_STATUS 629530d68baSNigel Croxon LibSetVariable ( 630530d68baSNigel Croxon IN CHAR16 *VarName, 631530d68baSNigel Croxon IN EFI_GUID *VarGuid, 632530d68baSNigel Croxon IN UINTN DataSize, 633530d68baSNigel Croxon IN VOID *Data 634530d68baSNigel Croxon ); 635530d68baSNigel Croxon EFI_STATUS 636530d68baSNigel Croxon LibInsertToTailOfBootOrder ( 637530d68baSNigel Croxon IN UINT16 BootOption, 638530d68baSNigel Croxon IN BOOLEAN OnlyInsertIfEmpty 639530d68baSNigel Croxon ); 640530d68baSNigel Croxon 641530d68baSNigel Croxon EFI_STATUS 642530d68baSNigel Croxon LibLocateProtocol ( 643530d68baSNigel Croxon IN EFI_GUID *ProtocolGuid, 644530d68baSNigel Croxon OUT VOID **Interface 645530d68baSNigel Croxon ); 646530d68baSNigel Croxon 647530d68baSNigel Croxon EFI_STATUS 648530d68baSNigel Croxon LibLocateHandle ( 649530d68baSNigel Croxon IN EFI_LOCATE_SEARCH_TYPE SearchType, 650530d68baSNigel Croxon IN EFI_GUID *Protocol OPTIONAL, 651530d68baSNigel Croxon IN VOID *SearchKey OPTIONAL, 652530d68baSNigel Croxon IN OUT UINTN *NoHandles, 653530d68baSNigel Croxon OUT EFI_HANDLE **Buffer 654530d68baSNigel Croxon ); 655530d68baSNigel Croxon 656530d68baSNigel Croxon EFI_STATUS 657530d68baSNigel Croxon LibLocateHandleByDiskSignature ( 658530d68baSNigel Croxon IN UINT8 MBRType, 659530d68baSNigel Croxon IN UINT8 SignatureType, 660530d68baSNigel Croxon IN VOID *Signature, 661530d68baSNigel Croxon IN OUT UINTN *NoHandles, 662530d68baSNigel Croxon OUT EFI_HANDLE **Buffer 663530d68baSNigel Croxon ); 664530d68baSNigel Croxon 665530d68baSNigel Croxon EFI_STATUS 666530d68baSNigel Croxon LibInstallProtocolInterfaces ( 667530d68baSNigel Croxon IN OUT EFI_HANDLE *Handle, 668530d68baSNigel Croxon ... 669530d68baSNigel Croxon ); 670530d68baSNigel Croxon 671530d68baSNigel Croxon VOID 672530d68baSNigel Croxon LibUninstallProtocolInterfaces ( 673530d68baSNigel Croxon IN EFI_HANDLE Handle, 674530d68baSNigel Croxon ... 675530d68baSNigel Croxon ); 676530d68baSNigel Croxon 677530d68baSNigel Croxon EFI_STATUS 678530d68baSNigel Croxon LibReinstallProtocolInterfaces ( 679530d68baSNigel Croxon IN OUT EFI_HANDLE *Handle, 680530d68baSNigel Croxon ... 681530d68baSNigel Croxon ); 682530d68baSNigel Croxon 683530d68baSNigel Croxon EFI_EVENT 684530d68baSNigel Croxon LibCreateProtocolNotifyEvent ( 685530d68baSNigel Croxon IN EFI_GUID *ProtocolGuid, 686530d68baSNigel Croxon IN EFI_TPL NotifyTpl, 687530d68baSNigel Croxon IN EFI_EVENT_NOTIFY NotifyFunction, 688530d68baSNigel Croxon IN VOID *NotifyContext, 689530d68baSNigel Croxon OUT VOID *Registration 690530d68baSNigel Croxon ); 691530d68baSNigel Croxon 692530d68baSNigel Croxon EFI_STATUS 693530d68baSNigel Croxon WaitForSingleEvent ( 694530d68baSNigel Croxon IN EFI_EVENT Event, 695530d68baSNigel Croxon IN UINT64 Timeout OPTIONAL 696530d68baSNigel Croxon ); 697530d68baSNigel Croxon 698530d68baSNigel Croxon VOID 699530d68baSNigel Croxon WaitForEventWithTimeout ( 700530d68baSNigel Croxon IN EFI_EVENT Event, 701530d68baSNigel Croxon IN UINTN Timeout, 702530d68baSNigel Croxon IN UINTN Row, 703530d68baSNigel Croxon IN UINTN Column, 704530d68baSNigel Croxon IN CHAR16 *String, 705530d68baSNigel Croxon IN EFI_INPUT_KEY TimeoutKey, 706530d68baSNigel Croxon OUT EFI_INPUT_KEY *Key 707530d68baSNigel Croxon ); 708530d68baSNigel Croxon 709530d68baSNigel Croxon EFI_FILE_HANDLE 710530d68baSNigel Croxon LibOpenRoot ( 711530d68baSNigel Croxon IN EFI_HANDLE DeviceHandle 712530d68baSNigel Croxon ); 713530d68baSNigel Croxon 714530d68baSNigel Croxon EFI_FILE_INFO * 715530d68baSNigel Croxon LibFileInfo ( 716530d68baSNigel Croxon IN EFI_FILE_HANDLE FHand 717530d68baSNigel Croxon ); 718530d68baSNigel Croxon 719530d68baSNigel Croxon EFI_FILE_SYSTEM_INFO * 720530d68baSNigel Croxon LibFileSystemInfo ( 721530d68baSNigel Croxon IN EFI_FILE_HANDLE FHand 722530d68baSNigel Croxon ); 723530d68baSNigel Croxon 724530d68baSNigel Croxon EFI_FILE_SYSTEM_VOLUME_LABEL_INFO * 725530d68baSNigel Croxon LibFileSystemVolumeLabelInfo ( 726530d68baSNigel Croxon IN EFI_FILE_HANDLE FHand 727530d68baSNigel Croxon ); 728530d68baSNigel Croxon 729530d68baSNigel Croxon BOOLEAN 730530d68baSNigel Croxon ValidMBR( 731530d68baSNigel Croxon IN MASTER_BOOT_RECORD *Mbr, 732530d68baSNigel Croxon IN EFI_BLOCK_IO *BlkIo 733530d68baSNigel Croxon ); 734530d68baSNigel Croxon 735530d68baSNigel Croxon BOOLEAN 736530d68baSNigel Croxon LibMatchDevicePaths ( 737530d68baSNigel Croxon IN EFI_DEVICE_PATH *Multi, 738530d68baSNigel Croxon IN EFI_DEVICE_PATH *Single 739530d68baSNigel Croxon ); 740530d68baSNigel Croxon 741530d68baSNigel Croxon EFI_DEVICE_PATH * 742530d68baSNigel Croxon LibDuplicateDevicePathInstance ( 743530d68baSNigel Croxon IN EFI_DEVICE_PATH *DevPath 744530d68baSNigel Croxon ); 745530d68baSNigel Croxon 746530d68baSNigel Croxon EFI_DEVICE_PATH * 747530d68baSNigel Croxon DevicePathFromHandle ( 748530d68baSNigel Croxon IN EFI_HANDLE Handle 749530d68baSNigel Croxon ); 750530d68baSNigel Croxon 751530d68baSNigel Croxon EFI_DEVICE_PATH * 752530d68baSNigel Croxon DevicePathInstance ( 753530d68baSNigel Croxon IN OUT EFI_DEVICE_PATH **DevicePath, 754530d68baSNigel Croxon OUT UINTN *Size 755530d68baSNigel Croxon ); 756530d68baSNigel Croxon 757530d68baSNigel Croxon UINTN 758530d68baSNigel Croxon DevicePathInstanceCount ( 759530d68baSNigel Croxon IN EFI_DEVICE_PATH *DevicePath 760530d68baSNigel Croxon ); 761530d68baSNigel Croxon 762530d68baSNigel Croxon EFI_DEVICE_PATH * 763530d68baSNigel Croxon AppendDevicePath ( 764530d68baSNigel Croxon IN EFI_DEVICE_PATH *Src1, 765530d68baSNigel Croxon IN EFI_DEVICE_PATH *Src2 766530d68baSNigel Croxon ); 767530d68baSNigel Croxon 768530d68baSNigel Croxon EFI_DEVICE_PATH * 769530d68baSNigel Croxon AppendDevicePathNode ( 770530d68baSNigel Croxon IN EFI_DEVICE_PATH *Src1, 771530d68baSNigel Croxon IN EFI_DEVICE_PATH *Src2 772530d68baSNigel Croxon ); 773530d68baSNigel Croxon 774530d68baSNigel Croxon EFI_DEVICE_PATH* 775530d68baSNigel Croxon AppendDevicePathInstance ( 776530d68baSNigel Croxon IN EFI_DEVICE_PATH *Src, 777530d68baSNigel Croxon IN EFI_DEVICE_PATH *Instance 778530d68baSNigel Croxon ); 779530d68baSNigel Croxon 780530d68baSNigel Croxon EFI_DEVICE_PATH * 781530d68baSNigel Croxon FileDevicePath ( 782530d68baSNigel Croxon IN EFI_HANDLE Device OPTIONAL, 783530d68baSNigel Croxon IN CHAR16 *FileName 784530d68baSNigel Croxon ); 785530d68baSNigel Croxon 786530d68baSNigel Croxon UINTN 787530d68baSNigel Croxon DevicePathSize ( 788530d68baSNigel Croxon IN EFI_DEVICE_PATH *DevPath 789530d68baSNigel Croxon ); 790530d68baSNigel Croxon 791530d68baSNigel Croxon EFI_DEVICE_PATH * 792530d68baSNigel Croxon DuplicateDevicePath ( 793530d68baSNigel Croxon IN EFI_DEVICE_PATH *DevPath 794530d68baSNigel Croxon ); 795530d68baSNigel Croxon 796530d68baSNigel Croxon EFI_DEVICE_PATH * 797530d68baSNigel Croxon UnpackDevicePath ( 798530d68baSNigel Croxon IN EFI_DEVICE_PATH *DevPath 799530d68baSNigel Croxon ); 800530d68baSNigel Croxon 801530d68baSNigel Croxon EFI_STATUS 802530d68baSNigel Croxon LibDevicePathToInterface ( 803530d68baSNigel Croxon IN EFI_GUID *Protocol, 804530d68baSNigel Croxon IN EFI_DEVICE_PATH *FilePath, 805530d68baSNigel Croxon OUT VOID **Interface 806530d68baSNigel Croxon ); 807530d68baSNigel Croxon 808530d68baSNigel Croxon CHAR16 * 809530d68baSNigel Croxon DevicePathToStr ( 810530d68baSNigel Croxon EFI_DEVICE_PATH *DevPath 811530d68baSNigel Croxon ); 812530d68baSNigel Croxon 813530d68baSNigel Croxon // 814530d68baSNigel Croxon // BugBug: I need my own include files 815530d68baSNigel Croxon // 816530d68baSNigel Croxon typedef struct { 817530d68baSNigel Croxon UINT8 Register; 818530d68baSNigel Croxon UINT8 Function; 819530d68baSNigel Croxon UINT8 Device; 820530d68baSNigel Croxon UINT8 Bus; 821530d68baSNigel Croxon UINT32 Reserved; 822530d68baSNigel Croxon } EFI_ADDRESS; 823530d68baSNigel Croxon 824530d68baSNigel Croxon typedef union { 825530d68baSNigel Croxon UINT64 Address; 826530d68baSNigel Croxon EFI_ADDRESS EfiAddress; 827530d68baSNigel Croxon } EFI_PCI_ADDRESS_UNION; 828530d68baSNigel Croxon 829530d68baSNigel Croxon 830530d68baSNigel Croxon EFI_STATUS 831530d68baSNigel Croxon PciFindDeviceClass ( 832530d68baSNigel Croxon IN OUT EFI_PCI_ADDRESS_UNION *Address, 833530d68baSNigel Croxon IN UINT8 BaseClass, 834530d68baSNigel Croxon IN UINT8 SubClass 835530d68baSNigel Croxon ); 836530d68baSNigel Croxon 837530d68baSNigel Croxon EFI_STATUS 838530d68baSNigel Croxon PciFindDevice ( 839530d68baSNigel Croxon IN OUT EFI_PCI_ADDRESS_UNION *DeviceAddress, 840530d68baSNigel Croxon IN UINT16 VendorId, 841530d68baSNigel Croxon IN UINT16 DeviceId, 842530d68baSNigel Croxon IN OUT PCI_TYPE00 *Pci 843530d68baSNigel Croxon ); 844530d68baSNigel Croxon 845530d68baSNigel Croxon // 846530d68baSNigel Croxon // SIMPLE_READ_FILE object used to access files 847530d68baSNigel Croxon // 848530d68baSNigel Croxon 849530d68baSNigel Croxon typedef VOID *SIMPLE_READ_FILE; 850530d68baSNigel Croxon 851530d68baSNigel Croxon EFI_STATUS 852530d68baSNigel Croxon OpenSimpleReadFile ( 853530d68baSNigel Croxon IN BOOLEAN BootPolicy, 854530d68baSNigel Croxon IN VOID *SourceBuffer OPTIONAL, 855530d68baSNigel Croxon IN UINTN SourceSize, 856530d68baSNigel Croxon IN OUT EFI_DEVICE_PATH **FilePath, 857530d68baSNigel Croxon OUT EFI_HANDLE *DeviceHandle, 858530d68baSNigel Croxon OUT SIMPLE_READ_FILE *SimpleReadHandle 859530d68baSNigel Croxon ); 860530d68baSNigel Croxon 861530d68baSNigel Croxon EFI_STATUS 862530d68baSNigel Croxon ReadSimpleReadFile ( 863530d68baSNigel Croxon IN SIMPLE_READ_FILE SimpleReadHandle, 864530d68baSNigel Croxon IN UINTN Offset, 865530d68baSNigel Croxon IN OUT UINTN *ReadSize, 866530d68baSNigel Croxon OUT VOID *Buffer 867530d68baSNigel Croxon ); 868530d68baSNigel Croxon 869530d68baSNigel Croxon 870530d68baSNigel Croxon VOID 871530d68baSNigel Croxon CloseSimpleReadFile ( 872530d68baSNigel Croxon IN SIMPLE_READ_FILE SimpleReadHandle 873530d68baSNigel Croxon ); 874530d68baSNigel Croxon 875530d68baSNigel Croxon VOID 876530d68baSNigel Croxon InitializeGuid ( 877530d68baSNigel Croxon VOID 878530d68baSNigel Croxon ); 879530d68baSNigel Croxon 880530d68baSNigel Croxon UINT8 881530d68baSNigel Croxon DecimaltoBCD( 882530d68baSNigel Croxon IN UINT8 DecValue 883530d68baSNigel Croxon ); 884530d68baSNigel Croxon 885530d68baSNigel Croxon UINT8 886530d68baSNigel Croxon BCDtoDecimal( 887530d68baSNigel Croxon IN UINT8 BcdValue 888530d68baSNigel Croxon ); 889530d68baSNigel Croxon 890530d68baSNigel Croxon EFI_STATUS 891530d68baSNigel Croxon LibGetSystemConfigurationTable( 892530d68baSNigel Croxon IN EFI_GUID *TableGuid, 893530d68baSNigel Croxon IN OUT VOID **Table 894530d68baSNigel Croxon ); 895530d68baSNigel Croxon 896530d68baSNigel Croxon BOOLEAN 897530d68baSNigel Croxon LibIsValidTextGraphics ( 898530d68baSNigel Croxon IN CHAR16 Graphic, 899530d68baSNigel Croxon OUT CHAR8 *PcAnsi, OPTIONAL 900530d68baSNigel Croxon OUT CHAR8 *Ascii OPTIONAL 901530d68baSNigel Croxon ); 902530d68baSNigel Croxon 903530d68baSNigel Croxon BOOLEAN 904530d68baSNigel Croxon IsValidAscii ( 905530d68baSNigel Croxon IN CHAR16 Ascii 906530d68baSNigel Croxon ); 907530d68baSNigel Croxon 908530d68baSNigel Croxon BOOLEAN 909530d68baSNigel Croxon IsValidEfiCntlChar ( 910530d68baSNigel Croxon IN CHAR16 c 911530d68baSNigel Croxon ); 912530d68baSNigel Croxon 913530d68baSNigel Croxon CHAR16 * 914530d68baSNigel Croxon LibGetUiString ( 915530d68baSNigel Croxon IN EFI_HANDLE Handle, 916530d68baSNigel Croxon IN UI_STRING_TYPE StringType, 917530d68baSNigel Croxon IN ISO_639_2 *LangCode, 918530d68baSNigel Croxon IN BOOLEAN ReturnDevicePathStrOnMismatch 919530d68baSNigel Croxon ); 920530d68baSNigel Croxon 921530d68baSNigel Croxon CHAR8* 922530d68baSNigel Croxon LibGetSmbiosString ( 923530d68baSNigel Croxon IN SMBIOS_STRUCTURE_POINTER *Smbios, 924530d68baSNigel Croxon IN UINT16 StringNumber 925530d68baSNigel Croxon ); 926530d68baSNigel Croxon 927530d68baSNigel Croxon EFI_STATUS 928530d68baSNigel Croxon LibGetSmbiosSystemGuidAndSerialNumber ( 929530d68baSNigel Croxon IN EFI_GUID *SystemGuid, 930530d68baSNigel Croxon OUT CHAR8 **SystemSerialNumber 931530d68baSNigel Croxon ); 932530d68baSNigel Croxon 933530d68baSNigel Croxon 934530d68baSNigel Croxon EFI_STATUS 935530d68baSNigel Croxon InitializeGlobalIoDevice ( 936530d68baSNigel Croxon IN EFI_DEVICE_PATH *DevicePath, 937530d68baSNigel Croxon IN EFI_GUID *Protocol, 938530d68baSNigel Croxon IN CHAR8 *ErrorStr, 939530d68baSNigel Croxon OUT EFI_DEVICE_IO_INTERFACE **GlobalIoFncs 940530d68baSNigel Croxon ); 941530d68baSNigel Croxon 942530d68baSNigel Croxon UINT32 943530d68baSNigel Croxon ReadPort ( 944530d68baSNigel Croxon IN EFI_DEVICE_IO_INTERFACE *GlobalIoFncs, 945530d68baSNigel Croxon IN EFI_IO_WIDTH Width, 946530d68baSNigel Croxon IN UINTN Port 947530d68baSNigel Croxon ); 948530d68baSNigel Croxon 949530d68baSNigel Croxon UINT32 950530d68baSNigel Croxon WritePort ( 951530d68baSNigel Croxon IN EFI_DEVICE_IO_INTERFACE *GlobalIoFncs, 952530d68baSNigel Croxon IN EFI_IO_WIDTH Width, 953530d68baSNigel Croxon IN UINTN Port, 954530d68baSNigel Croxon IN UINTN Data 955530d68baSNigel Croxon ); 956530d68baSNigel Croxon 957530d68baSNigel Croxon UINT32 958530d68baSNigel Croxon ReadPciConfig ( 959530d68baSNigel Croxon IN EFI_DEVICE_IO_INTERFACE *GlobalIoFncs, 960530d68baSNigel Croxon IN EFI_IO_WIDTH Width, 961530d68baSNigel Croxon IN UINTN Port 962530d68baSNigel Croxon ); 963530d68baSNigel Croxon 964530d68baSNigel Croxon UINT32 965530d68baSNigel Croxon WritePciConfig ( 966530d68baSNigel Croxon IN EFI_DEVICE_IO_INTERFACE *GlobalIoFncs, 967530d68baSNigel Croxon IN EFI_IO_WIDTH Width, 968530d68baSNigel Croxon IN UINTN Port, 969530d68baSNigel Croxon IN UINTN Data 970530d68baSNigel Croxon ); 971530d68baSNigel Croxon 972530d68baSNigel Croxon extern EFI_DEVICE_IO_INTERFACE *GlobalIoFncs; 973530d68baSNigel Croxon 974530d68baSNigel Croxon #define outp(_Port, _DataByte) (UINT8)WritePort(GlobalIoFncs, IO_UINT8, (UINTN)_Port, (UINTN)_DataByte) 975530d68baSNigel Croxon #define inp(_Port) (UINT8)ReadPort(GlobalIoFncs, IO_UINT8, (UINTN)_Port) 976530d68baSNigel Croxon #define outpw(_Port, _DataByte) (UINT16)WritePort(GlobalIoFncs, IO_UINT16, (UINTN)_Port, (UINTN)_DataByte) 977530d68baSNigel Croxon #define inpw(_Port) (UINT16)ReadPort(GlobalIoFncs, IO_UINT16, (UINTN)_Port) 978530d68baSNigel Croxon #define outpd(_Port, _DataByte) (UINT32)WritePort(GlobalIoFncs, IO_UINT32, (UINTN)_Port, (UINTN)_DataByte) 979530d68baSNigel Croxon #define inpd(_Port) (UINT32)ReadPort(GlobalIoFncs, IO_UINT32, (UINTN)_Port) 980530d68baSNigel Croxon 981530d68baSNigel Croxon #define writepci8(_Addr, _DataByte) (UINT8)WritePciConfig(GlobalIoFncs, IO_UINT8, (UINTN)_Addr, (UINTN)_DataByte) 982530d68baSNigel Croxon #define readpci8(_Addr) (UINT8)ReadPciConfig(GlobalIoFncs, IO_UINT8, (UINTN)_Addr) 983530d68baSNigel Croxon #define writepci16(_Addr, _DataByte) (UINT16)WritePciConfig(GlobalIoFncs, IO_UINT16, (UINTN)_Addr, (UINTN)_DataByte) 984530d68baSNigel Croxon #define readpci16(_Addr) (UINT16)ReadPciConfig(GlobalIoFncs, IO_UINT16, (UINTN)_Addr) 985530d68baSNigel Croxon #define writepci32(_Addr, _DataByte) (UINT32)WritePciConfig(GlobalIoFncs, IO_UINT32, (UINTN)_Addr, (UINTN)_DataByte) 986530d68baSNigel Croxon #define readpci32(_Addr) (UINT32)ReadPciConfig(GlobalIoFncs, IO_UINT32, (UINTN)_Addr) 987530d68baSNigel Croxon 988530d68baSNigel Croxon #define Pause() WaitForSingleEvent (ST->ConIn->WaitForKey, 0) 989530d68baSNigel Croxon #define Port80(_PostCode) GlobalIoFncs->Io.Write (GlobalIoFncs, IO_UINT16, (UINT64)0x80, 1, &(_PostCode)) 990530d68baSNigel Croxon 991530d68baSNigel Croxon #endif 992