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