1530d68baSNigel Croxon #ifndef _EFI_API_H 2530d68baSNigel Croxon #define _EFI_API_H 3530d68baSNigel Croxon 4530d68baSNigel Croxon /*++ 5530d68baSNigel Croxon 6530d68baSNigel Croxon Copyright (c) 1998 Intel Corporation 7530d68baSNigel Croxon 8530d68baSNigel Croxon Module Name: 9530d68baSNigel Croxon 10530d68baSNigel Croxon efiapi.h 11530d68baSNigel Croxon 12530d68baSNigel Croxon Abstract: 13530d68baSNigel Croxon 14530d68baSNigel Croxon Global EFI runtime & boot service interfaces 15530d68baSNigel Croxon 16530d68baSNigel Croxon 17530d68baSNigel Croxon 18530d68baSNigel Croxon 19530d68baSNigel Croxon Revision History 20530d68baSNigel Croxon 21530d68baSNigel Croxon --*/ 22530d68baSNigel Croxon 23530d68baSNigel Croxon // 24530d68baSNigel Croxon // EFI Specification Revision 25530d68baSNigel Croxon // 26530d68baSNigel Croxon 27530d68baSNigel Croxon #define EFI_SPECIFICATION_MAJOR_REVISION 1 28530d68baSNigel Croxon #define EFI_SPECIFICATION_MINOR_REVISION 02 29530d68baSNigel Croxon 30530d68baSNigel Croxon // 31530d68baSNigel Croxon // Declare forward referenced data structures 32530d68baSNigel Croxon // 33530d68baSNigel Croxon 34530d68baSNigel Croxon INTERFACE_DECL(_EFI_SYSTEM_TABLE); 35530d68baSNigel Croxon 36530d68baSNigel Croxon // 37530d68baSNigel Croxon // EFI Memory 38530d68baSNigel Croxon // 39530d68baSNigel Croxon 40530d68baSNigel Croxon typedef 41530d68baSNigel Croxon EFI_STATUS 42530d68baSNigel Croxon (EFIAPI *EFI_ALLOCATE_PAGES) ( 43530d68baSNigel Croxon IN EFI_ALLOCATE_TYPE Type, 44530d68baSNigel Croxon IN EFI_MEMORY_TYPE MemoryType, 45530d68baSNigel Croxon IN UINTN NoPages, 46530d68baSNigel Croxon OUT EFI_PHYSICAL_ADDRESS *Memory 47530d68baSNigel Croxon ); 48530d68baSNigel Croxon 49530d68baSNigel Croxon typedef 50530d68baSNigel Croxon EFI_STATUS 51530d68baSNigel Croxon (EFIAPI *EFI_FREE_PAGES) ( 52530d68baSNigel Croxon IN EFI_PHYSICAL_ADDRESS Memory, 53530d68baSNigel Croxon IN UINTN NoPages 54530d68baSNigel Croxon ); 55530d68baSNigel Croxon 56530d68baSNigel Croxon typedef 57530d68baSNigel Croxon EFI_STATUS 58530d68baSNigel Croxon (EFIAPI *EFI_GET_MEMORY_MAP) ( 59530d68baSNigel Croxon IN OUT UINTN *MemoryMapSize, 60530d68baSNigel Croxon IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap, 61530d68baSNigel Croxon OUT UINTN *MapKey, 62530d68baSNigel Croxon OUT UINTN *DescriptorSize, 63530d68baSNigel Croxon OUT UINT32 *DescriptorVersion 64530d68baSNigel Croxon ); 65530d68baSNigel Croxon 66530d68baSNigel Croxon #define NextMemoryDescriptor(Ptr,Size) ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) Ptr) + Size)) 67530d68baSNigel Croxon 68530d68baSNigel Croxon 69530d68baSNigel Croxon typedef 70530d68baSNigel Croxon EFI_STATUS 71530d68baSNigel Croxon (EFIAPI *EFI_ALLOCATE_POOL) ( 72530d68baSNigel Croxon IN EFI_MEMORY_TYPE PoolType, 73530d68baSNigel Croxon IN UINTN Size, 74530d68baSNigel Croxon OUT VOID **Buffer 75530d68baSNigel Croxon ); 76530d68baSNigel Croxon 77530d68baSNigel Croxon typedef 78530d68baSNigel Croxon EFI_STATUS 79530d68baSNigel Croxon (EFIAPI *EFI_FREE_POOL) ( 80530d68baSNigel Croxon IN VOID *Buffer 81530d68baSNigel Croxon ); 82530d68baSNigel Croxon 83530d68baSNigel Croxon typedef 84530d68baSNigel Croxon EFI_STATUS 85530d68baSNigel Croxon (EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP) ( 86530d68baSNigel Croxon IN UINTN MemoryMapSize, 87530d68baSNigel Croxon IN UINTN DescriptorSize, 88530d68baSNigel Croxon IN UINT32 DescriptorVersion, 89530d68baSNigel Croxon IN EFI_MEMORY_DESCRIPTOR *VirtualMap 90530d68baSNigel Croxon ); 91530d68baSNigel Croxon 92530d68baSNigel Croxon 93530d68baSNigel Croxon #define EFI_OPTIONAL_PTR 0x00000001 94530d68baSNigel Croxon #define EFI_INTERNAL_FNC 0x00000002 // Pointer to internal runtime fnc 95530d68baSNigel Croxon #define EFI_INTERNAL_PTR 0x00000004 // Pointer to internal runtime data 96530d68baSNigel Croxon 97530d68baSNigel Croxon 98530d68baSNigel Croxon typedef 99530d68baSNigel Croxon EFI_STATUS 100530d68baSNigel Croxon (EFIAPI *EFI_CONVERT_POINTER) ( 101530d68baSNigel Croxon IN UINTN DebugDisposition, 102530d68baSNigel Croxon IN OUT VOID **Address 103530d68baSNigel Croxon ); 104530d68baSNigel Croxon 105530d68baSNigel Croxon 106530d68baSNigel Croxon // 107530d68baSNigel Croxon // EFI Events 108530d68baSNigel Croxon // 109530d68baSNigel Croxon 110530d68baSNigel Croxon #define EVT_TIMER 0x80000000 111530d68baSNigel Croxon #define EVT_RUNTIME 0x40000000 112530d68baSNigel Croxon #define EVT_RUNTIME_CONTEXT 0x20000000 113530d68baSNigel Croxon 114530d68baSNigel Croxon #define EVT_NOTIFY_WAIT 0x00000100 115530d68baSNigel Croxon #define EVT_NOTIFY_SIGNAL 0x00000200 116530d68baSNigel Croxon 117530d68baSNigel Croxon #define EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201 118530d68baSNigel Croxon #define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202 119530d68baSNigel Croxon 120530d68baSNigel Croxon #define EVT_EFI_SIGNAL_MASK 0x000000FF 1219cdd67daSNigel Croxon #define EVT_EFI_SIGNAL_MAX 4 1229cdd67daSNigel Croxon 1239cdd67daSNigel Croxon #define EFI_EVENT_TIMER EVT_TIMER 1249cdd67daSNigel Croxon #define EFI_EVENT_RUNTIME EVT_RUNTIME 1259cdd67daSNigel Croxon #define EFI_EVENT_RUNTIME_CONTEXT EVT_RUNTIME_CONTEXT 1269cdd67daSNigel Croxon #define EFI_EVENT_NOTIFY_WAIT EVT_NOTIFY_WAIT 1279cdd67daSNigel Croxon #define EFI_EVENT_NOTIFY_SIGNAL EVT_NOTIFY_SIGNAL 1289cdd67daSNigel Croxon #define EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES EVT_SIGNAL_EXIT_BOOT_SERVICES 1299cdd67daSNigel Croxon #define EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 1309cdd67daSNigel Croxon #define EFI_EVENT_EFI_SIGNAL_MASK EVT_EFI_SIGNAL_MASK 1319cdd67daSNigel Croxon #define EFI_EVENT_EFI_SIGNAL_MAX EVT_EFI_SIGNAL_MAX 1329cdd67daSNigel Croxon 133530d68baSNigel Croxon 134530d68baSNigel Croxon typedef 135530d68baSNigel Croxon VOID 136530d68baSNigel Croxon (EFIAPI *EFI_EVENT_NOTIFY) ( 137530d68baSNigel Croxon IN EFI_EVENT Event, 138530d68baSNigel Croxon IN VOID *Context 139530d68baSNigel Croxon ); 140530d68baSNigel Croxon 141530d68baSNigel Croxon typedef 142530d68baSNigel Croxon EFI_STATUS 143530d68baSNigel Croxon (EFIAPI *EFI_CREATE_EVENT) ( 144530d68baSNigel Croxon IN UINT32 Type, 145530d68baSNigel Croxon IN EFI_TPL NotifyTpl, 146530d68baSNigel Croxon IN EFI_EVENT_NOTIFY NotifyFunction, 147530d68baSNigel Croxon IN VOID *NotifyContext, 148530d68baSNigel Croxon OUT EFI_EVENT *Event 149530d68baSNigel Croxon ); 150530d68baSNigel Croxon 151530d68baSNigel Croxon typedef enum { 152530d68baSNigel Croxon TimerCancel, 153530d68baSNigel Croxon TimerPeriodic, 154530d68baSNigel Croxon TimerRelative, 155530d68baSNigel Croxon TimerTypeMax 156530d68baSNigel Croxon } EFI_TIMER_DELAY; 157530d68baSNigel Croxon 158530d68baSNigel Croxon typedef 159530d68baSNigel Croxon EFI_STATUS 160530d68baSNigel Croxon (EFIAPI *EFI_SET_TIMER) ( 161530d68baSNigel Croxon IN EFI_EVENT Event, 162530d68baSNigel Croxon IN EFI_TIMER_DELAY Type, 163530d68baSNigel Croxon IN UINT64 TriggerTime 164530d68baSNigel Croxon ); 165530d68baSNigel Croxon 166530d68baSNigel Croxon typedef 167530d68baSNigel Croxon EFI_STATUS 168530d68baSNigel Croxon (EFIAPI *EFI_SIGNAL_EVENT) ( 169530d68baSNigel Croxon IN EFI_EVENT Event 170530d68baSNigel Croxon ); 171530d68baSNigel Croxon 172530d68baSNigel Croxon typedef 173530d68baSNigel Croxon EFI_STATUS 174530d68baSNigel Croxon (EFIAPI *EFI_WAIT_FOR_EVENT) ( 175530d68baSNigel Croxon IN UINTN NumberOfEvents, 176530d68baSNigel Croxon IN EFI_EVENT *Event, 177530d68baSNigel Croxon OUT UINTN *Index 178530d68baSNigel Croxon ); 179530d68baSNigel Croxon 180530d68baSNigel Croxon typedef 181530d68baSNigel Croxon EFI_STATUS 182530d68baSNigel Croxon (EFIAPI *EFI_CLOSE_EVENT) ( 183530d68baSNigel Croxon IN EFI_EVENT Event 184530d68baSNigel Croxon ); 185530d68baSNigel Croxon 186530d68baSNigel Croxon typedef 187530d68baSNigel Croxon EFI_STATUS 188530d68baSNigel Croxon (EFIAPI *EFI_CHECK_EVENT) ( 189530d68baSNigel Croxon IN EFI_EVENT Event 190530d68baSNigel Croxon ); 191530d68baSNigel Croxon 192530d68baSNigel Croxon // 193530d68baSNigel Croxon // Task priority level 194530d68baSNigel Croxon // 195530d68baSNigel Croxon 196530d68baSNigel Croxon #define TPL_APPLICATION 4 197530d68baSNigel Croxon #define TPL_CALLBACK 8 198530d68baSNigel Croxon #define TPL_NOTIFY 16 199530d68baSNigel Croxon #define TPL_HIGH_LEVEL 31 2009cdd67daSNigel Croxon #define EFI_TPL_APPLICATION TPL_APPLICATION 2019cdd67daSNigel Croxon #define EFI_TPL_CALLBACK TPL_CALLBACK 2029cdd67daSNigel Croxon #define EFI_TPL_NOTIFY TPL_NOTIFY 2039cdd67daSNigel Croxon #define EFI_TPL_HIGH_LEVEL TPL_HIGH_LEVEL 204530d68baSNigel Croxon typedef 205530d68baSNigel Croxon EFI_TPL 206530d68baSNigel Croxon (EFIAPI *EFI_RAISE_TPL) ( 207530d68baSNigel Croxon IN EFI_TPL NewTpl 208530d68baSNigel Croxon ); 209530d68baSNigel Croxon 210530d68baSNigel Croxon typedef 211530d68baSNigel Croxon VOID 212530d68baSNigel Croxon (EFIAPI *EFI_RESTORE_TPL) ( 213530d68baSNigel Croxon IN EFI_TPL OldTpl 214530d68baSNigel Croxon ); 215530d68baSNigel Croxon 216530d68baSNigel Croxon 217530d68baSNigel Croxon // 218530d68baSNigel Croxon // EFI platform varibles 219530d68baSNigel Croxon // 220530d68baSNigel Croxon 221530d68baSNigel Croxon #define EFI_GLOBAL_VARIABLE \ 222530d68baSNigel Croxon { 0x8BE4DF61, 0x93CA, 0x11d2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C} } 223530d68baSNigel Croxon 224530d68baSNigel Croxon // Variable attributes 225530d68baSNigel Croxon #define EFI_VARIABLE_NON_VOLATILE 0x00000001 226530d68baSNigel Croxon #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002 227530d68baSNigel Croxon #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004 228530d68baSNigel Croxon #define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008 229530d68baSNigel Croxon #define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010 230530d68baSNigel Croxon #define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020 231530d68baSNigel Croxon #define EFI_VARIABLE_APPEND_WRITE 0x00000040 232530d68baSNigel Croxon 233530d68baSNigel Croxon // Variable size limitation 234530d68baSNigel Croxon #define EFI_MAXIMUM_VARIABLE_SIZE 1024 235530d68baSNigel Croxon 236530d68baSNigel Croxon typedef 237530d68baSNigel Croxon EFI_STATUS 238530d68baSNigel Croxon (EFIAPI *EFI_GET_VARIABLE) ( 239530d68baSNigel Croxon IN CHAR16 *VariableName, 240530d68baSNigel Croxon IN EFI_GUID *VendorGuid, 241530d68baSNigel Croxon OUT UINT32 *Attributes OPTIONAL, 242530d68baSNigel Croxon IN OUT UINTN *DataSize, 243530d68baSNigel Croxon OUT VOID *Data 244530d68baSNigel Croxon ); 245530d68baSNigel Croxon 246530d68baSNigel Croxon typedef 247530d68baSNigel Croxon EFI_STATUS 248530d68baSNigel Croxon (EFIAPI *EFI_GET_NEXT_VARIABLE_NAME) ( 249530d68baSNigel Croxon IN OUT UINTN *VariableNameSize, 250530d68baSNigel Croxon IN OUT CHAR16 *VariableName, 251530d68baSNigel Croxon IN OUT EFI_GUID *VendorGuid 252530d68baSNigel Croxon ); 253530d68baSNigel Croxon 254530d68baSNigel Croxon 255530d68baSNigel Croxon typedef 256530d68baSNigel Croxon EFI_STATUS 257530d68baSNigel Croxon (EFIAPI *EFI_SET_VARIABLE) ( 258530d68baSNigel Croxon IN CHAR16 *VariableName, 259530d68baSNigel Croxon IN EFI_GUID *VendorGuid, 260530d68baSNigel Croxon IN UINT32 Attributes, 261530d68baSNigel Croxon IN UINTN DataSize, 262530d68baSNigel Croxon IN VOID *Data 263530d68baSNigel Croxon ); 264530d68baSNigel Croxon 265530d68baSNigel Croxon 266530d68baSNigel Croxon // 267530d68baSNigel Croxon // EFI Time 268530d68baSNigel Croxon // 269530d68baSNigel Croxon 270530d68baSNigel Croxon typedef struct { 271530d68baSNigel Croxon UINT32 Resolution; // 1e-6 parts per million 272530d68baSNigel Croxon UINT32 Accuracy; // hertz 273530d68baSNigel Croxon BOOLEAN SetsToZero; // Set clears sub-second time 274530d68baSNigel Croxon } EFI_TIME_CAPABILITIES; 275530d68baSNigel Croxon 276530d68baSNigel Croxon 277530d68baSNigel Croxon typedef 278530d68baSNigel Croxon EFI_STATUS 279530d68baSNigel Croxon (EFIAPI *EFI_GET_TIME) ( 280530d68baSNigel Croxon OUT EFI_TIME *Time, 281530d68baSNigel Croxon OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL 282530d68baSNigel Croxon ); 283530d68baSNigel Croxon 284530d68baSNigel Croxon typedef 285530d68baSNigel Croxon EFI_STATUS 286530d68baSNigel Croxon (EFIAPI *EFI_SET_TIME) ( 287530d68baSNigel Croxon IN EFI_TIME *Time 288530d68baSNigel Croxon ); 289530d68baSNigel Croxon 290530d68baSNigel Croxon typedef 291530d68baSNigel Croxon EFI_STATUS 292530d68baSNigel Croxon (EFIAPI *EFI_GET_WAKEUP_TIME) ( 293530d68baSNigel Croxon OUT BOOLEAN *Enabled, 294530d68baSNigel Croxon OUT BOOLEAN *Pending, 295530d68baSNigel Croxon OUT EFI_TIME *Time 296530d68baSNigel Croxon ); 297530d68baSNigel Croxon 298530d68baSNigel Croxon typedef 299530d68baSNigel Croxon EFI_STATUS 300530d68baSNigel Croxon (EFIAPI *EFI_SET_WAKEUP_TIME) ( 301530d68baSNigel Croxon IN BOOLEAN Enable, 302530d68baSNigel Croxon IN EFI_TIME *Time OPTIONAL 303530d68baSNigel Croxon ); 304530d68baSNigel Croxon 305530d68baSNigel Croxon 306530d68baSNigel Croxon // 307530d68baSNigel Croxon // Image functions 308530d68baSNigel Croxon // 309530d68baSNigel Croxon 310530d68baSNigel Croxon 311530d68baSNigel Croxon // PE32+ Subsystem type for EFI images 312530d68baSNigel Croxon 313530d68baSNigel Croxon #if !defined(IMAGE_SUBSYSTEM_EFI_APPLICATION) 314530d68baSNigel Croxon #define IMAGE_SUBSYSTEM_EFI_APPLICATION 10 315530d68baSNigel Croxon #define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11 316530d68baSNigel Croxon #define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12 317530d68baSNigel Croxon #endif 318530d68baSNigel Croxon 319530d68baSNigel Croxon // PE32+ Machine type for EFI images 320530d68baSNigel Croxon 321530d68baSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_IA32) 322530d68baSNigel Croxon #define EFI_IMAGE_MACHINE_IA32 0x014c 323530d68baSNigel Croxon #endif 324530d68baSNigel Croxon 325530d68baSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_IA64) 326530d68baSNigel Croxon #define EFI_IMAGE_MACHINE_IA64 0x0200 327530d68baSNigel Croxon #endif 328530d68baSNigel Croxon 3299cdd67daSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_EBC) 3309cdd67daSNigel Croxon #define EFI_IMAGE_MACHINE_EBC 0x0EBC 3319cdd67daSNigel Croxon #endif 3329cdd67daSNigel Croxon 3339cdd67daSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_X64) 3349cdd67daSNigel Croxon #define EFI_IMAGE_MACHINE_X64 0x8664 3359cdd67daSNigel Croxon #endif 3369cdd67daSNigel Croxon 3379cdd67daSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_ARMTHUMB_MIXED) 3389cdd67daSNigel Croxon #define EFI_IMAGE_MACHINE_ARMTHUMB_MIXED 0x01C2 3399cdd67daSNigel Croxon #endif 3409cdd67daSNigel Croxon 3419cdd67daSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_AARCH64) 3429cdd67daSNigel Croxon #define EFI_IMAGE_MACHINE_AARCH64 0xAA64 3439cdd67daSNigel Croxon #endif 3449cdd67daSNigel Croxon 345*860b1c8cSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_RISCV32) 346*860b1c8cSNigel Croxon #define EFI_IMAGE_MACHINE_RISCV32 0x5032 347*860b1c8cSNigel Croxon #endif 348*860b1c8cSNigel Croxon 349*860b1c8cSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_RISCV64) 350*860b1c8cSNigel Croxon #define EFI_IMAGE_MACHINE_RISCV64 0x5064 351*860b1c8cSNigel Croxon #endif 352*860b1c8cSNigel Croxon 353*860b1c8cSNigel Croxon #if !defined(EFI_IMAGE_MACHINE_RISCV128) 354*860b1c8cSNigel Croxon #define EFI_IMAGE_MACHINE_RISCV128 0x5128 355*860b1c8cSNigel Croxon #endif 356*860b1c8cSNigel Croxon 357530d68baSNigel Croxon // Image Entry prototype 358530d68baSNigel Croxon 359530d68baSNigel Croxon typedef 360530d68baSNigel Croxon EFI_STATUS 361530d68baSNigel Croxon (EFIAPI *EFI_IMAGE_ENTRY_POINT) ( 362530d68baSNigel Croxon IN EFI_HANDLE ImageHandle, 363530d68baSNigel Croxon IN struct _EFI_SYSTEM_TABLE *SystemTable 364530d68baSNigel Croxon ); 365530d68baSNigel Croxon 366530d68baSNigel Croxon typedef 367530d68baSNigel Croxon EFI_STATUS 368530d68baSNigel Croxon (EFIAPI *EFI_IMAGE_LOAD) ( 369530d68baSNigel Croxon IN BOOLEAN BootPolicy, 370530d68baSNigel Croxon IN EFI_HANDLE ParentImageHandle, 371530d68baSNigel Croxon IN EFI_DEVICE_PATH *FilePath, 372530d68baSNigel Croxon IN VOID *SourceBuffer OPTIONAL, 373530d68baSNigel Croxon IN UINTN SourceSize, 374530d68baSNigel Croxon OUT EFI_HANDLE *ImageHandle 375530d68baSNigel Croxon ); 376530d68baSNigel Croxon 377530d68baSNigel Croxon typedef 378530d68baSNigel Croxon EFI_STATUS 379530d68baSNigel Croxon (EFIAPI *EFI_IMAGE_START) ( 380530d68baSNigel Croxon IN EFI_HANDLE ImageHandle, 381530d68baSNigel Croxon OUT UINTN *ExitDataSize, 382530d68baSNigel Croxon OUT CHAR16 **ExitData OPTIONAL 383530d68baSNigel Croxon ); 384530d68baSNigel Croxon 385530d68baSNigel Croxon typedef 386530d68baSNigel Croxon EFI_STATUS 387530d68baSNigel Croxon (EFIAPI *EFI_EXIT) ( 388530d68baSNigel Croxon IN EFI_HANDLE ImageHandle, 389530d68baSNigel Croxon IN EFI_STATUS ExitStatus, 390530d68baSNigel Croxon IN UINTN ExitDataSize, 391530d68baSNigel Croxon IN CHAR16 *ExitData OPTIONAL 392530d68baSNigel Croxon ); 393530d68baSNigel Croxon 394530d68baSNigel Croxon 395530d68baSNigel Croxon // Image handle 3963b31a5e3SNigel Croxon /*#define LOADED_IMAGE_PROTOCOL \ 397530d68baSNigel Croxon { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} } 398530d68baSNigel Croxon 399530d68baSNigel Croxon #define EFI_IMAGE_INFORMATION_REVISION 0x1000 400530d68baSNigel Croxon typedef struct { 401530d68baSNigel Croxon UINT32 Revision; 402530d68baSNigel Croxon EFI_HANDLE ParentHandle; 403530d68baSNigel Croxon struct _EFI_SYSTEM_TABLE *SystemTable; 404530d68baSNigel Croxon 405530d68baSNigel Croxon // Source location of image 406530d68baSNigel Croxon EFI_HANDLE DeviceHandle; 407530d68baSNigel Croxon EFI_DEVICE_PATH *FilePath; 408530d68baSNigel Croxon VOID *Reserved; 409530d68baSNigel Croxon 410530d68baSNigel Croxon // Images load options 411530d68baSNigel Croxon UINT32 LoadOptionsSize; 412530d68baSNigel Croxon VOID *LoadOptions; 413530d68baSNigel Croxon 414530d68baSNigel Croxon // Location of where image was loaded 415530d68baSNigel Croxon VOID *ImageBase; 416530d68baSNigel Croxon UINT64 ImageSize; 417530d68baSNigel Croxon EFI_MEMORY_TYPE ImageCodeType; 418530d68baSNigel Croxon EFI_MEMORY_TYPE ImageDataType; 419530d68baSNigel Croxon 420530d68baSNigel Croxon // If the driver image supports a dynamic unload request 421530d68baSNigel Croxon EFI_IMAGE_UNLOAD Unload; 422530d68baSNigel Croxon 4233b31a5e3SNigel Croxon } EFI_LOADED_IMAGE;*/ 424530d68baSNigel Croxon 425530d68baSNigel Croxon 426530d68baSNigel Croxon typedef 427530d68baSNigel Croxon EFI_STATUS 428530d68baSNigel Croxon (EFIAPI *EFI_EXIT_BOOT_SERVICES) ( 429530d68baSNigel Croxon IN EFI_HANDLE ImageHandle, 430530d68baSNigel Croxon IN UINTN MapKey 431530d68baSNigel Croxon ); 432530d68baSNigel Croxon 433530d68baSNigel Croxon // 434530d68baSNigel Croxon // Misc 435530d68baSNigel Croxon // 436530d68baSNigel Croxon 437530d68baSNigel Croxon 438530d68baSNigel Croxon typedef 439530d68baSNigel Croxon EFI_STATUS 440530d68baSNigel Croxon (EFIAPI *EFI_STALL) ( 441530d68baSNigel Croxon IN UINTN Microseconds 442530d68baSNigel Croxon ); 443530d68baSNigel Croxon 444530d68baSNigel Croxon typedef 445530d68baSNigel Croxon EFI_STATUS 446530d68baSNigel Croxon (EFIAPI *EFI_SET_WATCHDOG_TIMER) ( 447530d68baSNigel Croxon IN UINTN Timeout, 448530d68baSNigel Croxon IN UINT64 WatchdogCode, 449530d68baSNigel Croxon IN UINTN DataSize, 450530d68baSNigel Croxon IN CHAR16 *WatchdogData OPTIONAL 451530d68baSNigel Croxon ); 452530d68baSNigel Croxon 453530d68baSNigel Croxon typedef 454530d68baSNigel Croxon EFI_STATUS 455530d68baSNigel Croxon (EFIAPI *EFI_CONNECT_CONTROLLER) ( 456530d68baSNigel Croxon IN EFI_HANDLE ControllerHandle, 457530d68baSNigel Croxon IN EFI_HANDLE *DriverImageHandle OPTIONAL, 458530d68baSNigel Croxon IN EFI_DEVICE_PATH *RemainingDevicePath OPTIONAL, 459530d68baSNigel Croxon IN BOOLEAN Recursive 460530d68baSNigel Croxon ); 461530d68baSNigel Croxon 462530d68baSNigel Croxon typedef 463530d68baSNigel Croxon EFI_STATUS 464530d68baSNigel Croxon (EFIAPI *EFI_DISCONNECT_CONTROLLER) ( 465530d68baSNigel Croxon IN EFI_HANDLE ControllerHandle, 466530d68baSNigel Croxon IN EFI_HANDLE DriverImageHandle OPTIONAL, 467530d68baSNigel Croxon IN EFI_HANDLE ChildHandle OPTIONAL 468530d68baSNigel Croxon ); 469530d68baSNigel Croxon 470530d68baSNigel Croxon #define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 471530d68baSNigel Croxon #define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002 472530d68baSNigel Croxon #define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004 473530d68baSNigel Croxon #define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008 474530d68baSNigel Croxon #define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010 475530d68baSNigel Croxon #define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020 476530d68baSNigel Croxon 477530d68baSNigel Croxon typedef 478530d68baSNigel Croxon EFI_STATUS 479530d68baSNigel Croxon (EFIAPI *EFI_OPEN_PROTOCOL) ( 480530d68baSNigel Croxon IN EFI_HANDLE Handle, 481530d68baSNigel Croxon IN EFI_GUID *Protocol, 482530d68baSNigel Croxon OUT VOID **Interface OPTIONAL, 483530d68baSNigel Croxon IN EFI_HANDLE AgentHandle, 484530d68baSNigel Croxon IN EFI_HANDLE ControllerHandle, 485530d68baSNigel Croxon IN UINT32 Attributes 486530d68baSNigel Croxon ); 487530d68baSNigel Croxon 488530d68baSNigel Croxon typedef 489530d68baSNigel Croxon EFI_STATUS 490530d68baSNigel Croxon (EFIAPI *EFI_CLOSE_PROTOCOL) ( 491530d68baSNigel Croxon IN EFI_HANDLE Handle, 492530d68baSNigel Croxon IN EFI_GUID *Protocol, 493530d68baSNigel Croxon IN EFI_HANDLE AgentHandle, 494530d68baSNigel Croxon IN EFI_HANDLE ControllerHandle 495530d68baSNigel Croxon ); 496530d68baSNigel Croxon 497530d68baSNigel Croxon typedef struct { 498530d68baSNigel Croxon EFI_HANDLE AgentHandle; 499530d68baSNigel Croxon EFI_HANDLE ControllerHandle; 500530d68baSNigel Croxon UINT32 Attributes; 501530d68baSNigel Croxon UINT32 OpenCount; 502530d68baSNigel Croxon } EFI_OPEN_PROTOCOL_INFORMATION_ENTRY; 503530d68baSNigel Croxon 504530d68baSNigel Croxon typedef 505530d68baSNigel Croxon EFI_STATUS 506530d68baSNigel Croxon (EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION) ( 507530d68baSNigel Croxon IN EFI_HANDLE Handle, 508530d68baSNigel Croxon IN EFI_GUID *Protocol, 509530d68baSNigel Croxon OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer, 510530d68baSNigel Croxon OUT UINTN *EntryCount 511530d68baSNigel Croxon ); 512530d68baSNigel Croxon 513530d68baSNigel Croxon typedef 514530d68baSNigel Croxon EFI_STATUS 515530d68baSNigel Croxon (EFIAPI *EFI_PROTOCOLS_PER_HANDLE) ( 516530d68baSNigel Croxon IN EFI_HANDLE Handle, 517530d68baSNigel Croxon OUT EFI_GUID ***ProtocolBuffer, 518530d68baSNigel Croxon OUT UINTN *ProtocolBufferCount 519530d68baSNigel Croxon ); 520530d68baSNigel Croxon 521530d68baSNigel Croxon typedef enum { 522530d68baSNigel Croxon AllHandles, 523530d68baSNigel Croxon ByRegisterNotify, 524530d68baSNigel Croxon ByProtocol 525530d68baSNigel Croxon } EFI_LOCATE_SEARCH_TYPE; 526530d68baSNigel Croxon 527530d68baSNigel Croxon typedef 528530d68baSNigel Croxon EFI_STATUS 529530d68baSNigel Croxon (EFIAPI *EFI_LOCATE_HANDLE_BUFFER) ( 530530d68baSNigel Croxon IN EFI_LOCATE_SEARCH_TYPE SearchType, 531530d68baSNigel Croxon IN EFI_GUID *Protocol OPTIONAL, 532530d68baSNigel Croxon IN VOID *SearchKey OPTIONAL, 533530d68baSNigel Croxon IN OUT UINTN *NoHandles, 534530d68baSNigel Croxon OUT EFI_HANDLE **Buffer 535530d68baSNigel Croxon ); 536530d68baSNigel Croxon 537530d68baSNigel Croxon typedef 538530d68baSNigel Croxon EFI_STATUS 539530d68baSNigel Croxon (EFIAPI *EFI_LOCATE_PROTOCOL) ( 540530d68baSNigel Croxon IN EFI_GUID *Protocol, 541530d68baSNigel Croxon IN VOID *Registration OPTIONAL, 542530d68baSNigel Croxon OUT VOID **Interface 543530d68baSNigel Croxon ); 544530d68baSNigel Croxon 545530d68baSNigel Croxon typedef 546530d68baSNigel Croxon EFI_STATUS 547530d68baSNigel Croxon (EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES) ( 548530d68baSNigel Croxon IN OUT EFI_HANDLE *Handle, 549530d68baSNigel Croxon ... 550530d68baSNigel Croxon ); 551530d68baSNigel Croxon 552530d68baSNigel Croxon typedef 553530d68baSNigel Croxon EFI_STATUS 554530d68baSNigel Croxon (EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES) ( 555530d68baSNigel Croxon IN OUT EFI_HANDLE Handle, 556530d68baSNigel Croxon ... 557530d68baSNigel Croxon ); 558530d68baSNigel Croxon 559530d68baSNigel Croxon typedef 560530d68baSNigel Croxon EFI_STATUS 561530d68baSNigel Croxon (EFIAPI *EFI_CALCULATE_CRC32) ( 562530d68baSNigel Croxon IN VOID *Data, 563530d68baSNigel Croxon IN UINTN DataSize, 564530d68baSNigel Croxon OUT UINT32 *Crc32 565530d68baSNigel Croxon ); 566530d68baSNigel Croxon 567530d68baSNigel Croxon typedef 568530d68baSNigel Croxon VOID 569530d68baSNigel Croxon (EFIAPI *EFI_COPY_MEM) ( 570530d68baSNigel Croxon IN VOID *Destination, 571530d68baSNigel Croxon IN VOID *Source, 572530d68baSNigel Croxon IN UINTN Length 573530d68baSNigel Croxon ); 574530d68baSNigel Croxon 575530d68baSNigel Croxon typedef 576530d68baSNigel Croxon VOID 577530d68baSNigel Croxon (EFIAPI *EFI_SET_MEM) ( 578530d68baSNigel Croxon IN VOID *Buffer, 579530d68baSNigel Croxon IN UINTN Size, 580530d68baSNigel Croxon IN UINT8 Value 581530d68baSNigel Croxon ); 582530d68baSNigel Croxon 583530d68baSNigel Croxon 584530d68baSNigel Croxon typedef 585530d68baSNigel Croxon EFI_STATUS 586530d68baSNigel Croxon (EFIAPI *EFI_CREATE_EVENT_EX) ( 587530d68baSNigel Croxon IN UINT32 Type, 588530d68baSNigel Croxon IN EFI_TPL NotifyTpl, 589530d68baSNigel Croxon IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL, 590530d68baSNigel Croxon IN const VOID *NotifyContext OPTIONAL, 591238358c6Sleo IN const EFI_GUID *EventGroup OPTIONAL, 592530d68baSNigel Croxon OUT EFI_EVENT *Event 593530d68baSNigel Croxon ); 594530d68baSNigel Croxon 595530d68baSNigel Croxon typedef enum { 596530d68baSNigel Croxon EfiResetCold, 597530d68baSNigel Croxon EfiResetWarm, 598530d68baSNigel Croxon EfiResetShutdown 599530d68baSNigel Croxon } EFI_RESET_TYPE; 600530d68baSNigel Croxon 601530d68baSNigel Croxon typedef 602530d68baSNigel Croxon EFI_STATUS 603530d68baSNigel Croxon (EFIAPI *EFI_RESET_SYSTEM) ( 604530d68baSNigel Croxon IN EFI_RESET_TYPE ResetType, 605530d68baSNigel Croxon IN EFI_STATUS ResetStatus, 606530d68baSNigel Croxon IN UINTN DataSize, 607530d68baSNigel Croxon IN CHAR16 *ResetData OPTIONAL 608530d68baSNigel Croxon ); 609530d68baSNigel Croxon 610530d68baSNigel Croxon typedef 611530d68baSNigel Croxon EFI_STATUS 612530d68baSNigel Croxon (EFIAPI *EFI_GET_NEXT_MONOTONIC_COUNT) ( 613530d68baSNigel Croxon OUT UINT64 *Count 614530d68baSNigel Croxon ); 615530d68baSNigel Croxon 616530d68baSNigel Croxon typedef 617530d68baSNigel Croxon EFI_STATUS 618530d68baSNigel Croxon (EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT) ( 619530d68baSNigel Croxon OUT UINT32 *HighCount 620530d68baSNigel Croxon ); 621530d68baSNigel Croxon 622530d68baSNigel Croxon typedef struct { 623530d68baSNigel Croxon UINT64 Length; 624530d68baSNigel Croxon union { 625530d68baSNigel Croxon EFI_PHYSICAL_ADDRESS DataBlock; 626530d68baSNigel Croxon EFI_PHYSICAL_ADDRESS ContinuationPointer; 627530d68baSNigel Croxon } Union; 628530d68baSNigel Croxon } EFI_CAPSULE_BLOCK_DESCRIPTOR; 629530d68baSNigel Croxon 630530d68baSNigel Croxon typedef struct { 631530d68baSNigel Croxon EFI_GUID CapsuleGuid; 632530d68baSNigel Croxon UINT32 HeaderSize; 633530d68baSNigel Croxon UINT32 Flags; 634530d68baSNigel Croxon UINT32 CapsuleImageSize; 635530d68baSNigel Croxon } EFI_CAPSULE_HEADER; 636530d68baSNigel Croxon 637530d68baSNigel Croxon #define CAPSULE_FLAGS_PERSIST_ACROSS_RESET 0x00010000 638530d68baSNigel Croxon #define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000 639530d68baSNigel Croxon #define CAPSULE_FLAGS_INITIATE_RESET 0x00040000 640530d68baSNigel Croxon 641530d68baSNigel Croxon typedef 642530d68baSNigel Croxon EFI_STATUS 643530d68baSNigel Croxon (EFIAPI *EFI_UPDATE_CAPSULE) ( 644530d68baSNigel Croxon IN EFI_CAPSULE_HEADER **CapsuleHeaderArray, 645530d68baSNigel Croxon IN UINTN CapsuleCount, 646530d68baSNigel Croxon IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL 647530d68baSNigel Croxon ); 648530d68baSNigel Croxon 649530d68baSNigel Croxon typedef 650530d68baSNigel Croxon EFI_STATUS 651530d68baSNigel Croxon (EFIAPI *EFI_QUERY_CAPSULE_CAPABILITIES) ( 652530d68baSNigel Croxon IN EFI_CAPSULE_HEADER **CapsuleHeaderArray, 653530d68baSNigel Croxon IN UINTN CapsuleCount, 654530d68baSNigel Croxon OUT UINT64 *MaximumCapsuleSize, 655530d68baSNigel Croxon OUT EFI_RESET_TYPE *ResetType 656530d68baSNigel Croxon ); 657530d68baSNigel Croxon 658530d68baSNigel Croxon typedef 659530d68baSNigel Croxon EFI_STATUS 660530d68baSNigel Croxon (EFIAPI *EFI_QUERY_VARIABLE_INFO) ( 661530d68baSNigel Croxon IN UINT32 Attributes, 662530d68baSNigel Croxon OUT UINT64 *MaximumVariableStorageSize, 663530d68baSNigel Croxon OUT UINT64 *RemainingVariableStorageSize, 664530d68baSNigel Croxon OUT UINT64 *MaximumVariableSize 665530d68baSNigel Croxon ); 666530d68baSNigel Croxon 667530d68baSNigel Croxon // 668530d68baSNigel Croxon // Protocol handler functions 669530d68baSNigel Croxon // 670530d68baSNigel Croxon 671530d68baSNigel Croxon typedef enum { 672530d68baSNigel Croxon EFI_NATIVE_INTERFACE, 673530d68baSNigel Croxon EFI_PCODE_INTERFACE 674530d68baSNigel Croxon } EFI_INTERFACE_TYPE; 675530d68baSNigel Croxon 676530d68baSNigel Croxon typedef 677530d68baSNigel Croxon EFI_STATUS 678530d68baSNigel Croxon (EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE) ( 679530d68baSNigel Croxon IN OUT EFI_HANDLE *Handle, 680530d68baSNigel Croxon IN EFI_GUID *Protocol, 681530d68baSNigel Croxon IN EFI_INTERFACE_TYPE InterfaceType, 682530d68baSNigel Croxon IN VOID *Interface 683530d68baSNigel Croxon ); 684530d68baSNigel Croxon 685530d68baSNigel Croxon typedef 686530d68baSNigel Croxon EFI_STATUS 687530d68baSNigel Croxon (EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE) ( 688530d68baSNigel Croxon IN EFI_HANDLE Handle, 689530d68baSNigel Croxon IN EFI_GUID *Protocol, 690530d68baSNigel Croxon IN VOID *OldInterface, 691530d68baSNigel Croxon IN VOID *NewInterface 692530d68baSNigel Croxon ); 693530d68baSNigel Croxon 694530d68baSNigel Croxon typedef 695530d68baSNigel Croxon EFI_STATUS 696530d68baSNigel Croxon (EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE) ( 697530d68baSNigel Croxon IN EFI_HANDLE Handle, 698530d68baSNigel Croxon IN EFI_GUID *Protocol, 699530d68baSNigel Croxon IN VOID *Interface 700530d68baSNigel Croxon ); 701530d68baSNigel Croxon 702530d68baSNigel Croxon typedef 703530d68baSNigel Croxon EFI_STATUS 704530d68baSNigel Croxon (EFIAPI *EFI_HANDLE_PROTOCOL) ( 705530d68baSNigel Croxon IN EFI_HANDLE Handle, 706530d68baSNigel Croxon IN EFI_GUID *Protocol, 707530d68baSNigel Croxon OUT VOID **Interface 708530d68baSNigel Croxon ); 709530d68baSNigel Croxon 710530d68baSNigel Croxon typedef 711530d68baSNigel Croxon EFI_STATUS 712530d68baSNigel Croxon (EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY) ( 713530d68baSNigel Croxon IN EFI_GUID *Protocol, 714530d68baSNigel Croxon IN EFI_EVENT Event, 715530d68baSNigel Croxon OUT VOID **Registration 716530d68baSNigel Croxon ); 717530d68baSNigel Croxon 718530d68baSNigel Croxon typedef 719530d68baSNigel Croxon EFI_STATUS 720530d68baSNigel Croxon (EFIAPI *EFI_LOCATE_HANDLE) ( 721530d68baSNigel Croxon IN EFI_LOCATE_SEARCH_TYPE SearchType, 722530d68baSNigel Croxon IN EFI_GUID *Protocol OPTIONAL, 723530d68baSNigel Croxon IN VOID *SearchKey OPTIONAL, 724530d68baSNigel Croxon IN OUT UINTN *BufferSize, 725530d68baSNigel Croxon OUT EFI_HANDLE *Buffer 726530d68baSNigel Croxon ); 727530d68baSNigel Croxon 728530d68baSNigel Croxon typedef 729530d68baSNigel Croxon EFI_STATUS 730530d68baSNigel Croxon (EFIAPI *EFI_LOCATE_DEVICE_PATH) ( 731530d68baSNigel Croxon IN EFI_GUID *Protocol, 732530d68baSNigel Croxon IN OUT EFI_DEVICE_PATH **DevicePath, 733530d68baSNigel Croxon OUT EFI_HANDLE *Device 734530d68baSNigel Croxon ); 735530d68baSNigel Croxon 736530d68baSNigel Croxon typedef 737530d68baSNigel Croxon EFI_STATUS 738530d68baSNigel Croxon (EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE) ( 739530d68baSNigel Croxon IN EFI_GUID *Guid, 740530d68baSNigel Croxon IN VOID *Table 741530d68baSNigel Croxon ); 742530d68baSNigel Croxon 743530d68baSNigel Croxon typedef 744530d68baSNigel Croxon EFI_STATUS 745530d68baSNigel Croxon (EFIAPI *EFI_RESERVED_SERVICE) ( 746530d68baSNigel Croxon ); 747530d68baSNigel Croxon 748530d68baSNigel Croxon // 749530d68baSNigel Croxon // Standard EFI table header 750530d68baSNigel Croxon // 751530d68baSNigel Croxon 752530d68baSNigel Croxon typedef struct _EFI_TABLE_HEADER { 753530d68baSNigel Croxon UINT64 Signature; 754530d68baSNigel Croxon UINT32 Revision; 755530d68baSNigel Croxon UINT32 HeaderSize; 756530d68baSNigel Croxon UINT32 CRC32; 757530d68baSNigel Croxon UINT32 Reserved; 758530d68baSNigel Croxon } EFI_TABLE_HEADER; 759530d68baSNigel Croxon 760530d68baSNigel Croxon 761530d68baSNigel Croxon // 762530d68baSNigel Croxon // EFI Runtime Serivces Table 763530d68baSNigel Croxon // 764530d68baSNigel Croxon 765530d68baSNigel Croxon #define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552 766530d68baSNigel Croxon #define EFI_RUNTIME_SERVICES_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION) 767530d68baSNigel Croxon 768530d68baSNigel Croxon typedef struct { 769530d68baSNigel Croxon EFI_TABLE_HEADER Hdr; 770530d68baSNigel Croxon 771530d68baSNigel Croxon // 772530d68baSNigel Croxon // Time services 773530d68baSNigel Croxon // 774530d68baSNigel Croxon 775530d68baSNigel Croxon EFI_GET_TIME GetTime; 776530d68baSNigel Croxon EFI_SET_TIME SetTime; 777530d68baSNigel Croxon EFI_GET_WAKEUP_TIME GetWakeupTime; 778530d68baSNigel Croxon EFI_SET_WAKEUP_TIME SetWakeupTime; 779530d68baSNigel Croxon 780530d68baSNigel Croxon // 781530d68baSNigel Croxon // Virtual memory services 782530d68baSNigel Croxon // 783530d68baSNigel Croxon 784530d68baSNigel Croxon EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap; 785530d68baSNigel Croxon EFI_CONVERT_POINTER ConvertPointer; 786530d68baSNigel Croxon 787530d68baSNigel Croxon // 788530d68baSNigel Croxon // Variable serviers 789530d68baSNigel Croxon // 790530d68baSNigel Croxon 791530d68baSNigel Croxon EFI_GET_VARIABLE GetVariable; 792530d68baSNigel Croxon EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName; 793530d68baSNigel Croxon EFI_SET_VARIABLE SetVariable; 794530d68baSNigel Croxon 795530d68baSNigel Croxon // 796530d68baSNigel Croxon // Misc 797530d68baSNigel Croxon // 798530d68baSNigel Croxon 799530d68baSNigel Croxon EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount; 800530d68baSNigel Croxon EFI_RESET_SYSTEM ResetSystem; 801530d68baSNigel Croxon 802530d68baSNigel Croxon EFI_UPDATE_CAPSULE UpdateCapsule; 803530d68baSNigel Croxon EFI_QUERY_CAPSULE_CAPABILITIES QueryCapsuleCapabilities; 804530d68baSNigel Croxon EFI_QUERY_VARIABLE_INFO QueryVariableInfo; 805530d68baSNigel Croxon } EFI_RUNTIME_SERVICES; 806530d68baSNigel Croxon 807530d68baSNigel Croxon 808530d68baSNigel Croxon // 809530d68baSNigel Croxon // EFI Boot Services Table 810530d68baSNigel Croxon // 811530d68baSNigel Croxon 812530d68baSNigel Croxon #define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42 813530d68baSNigel Croxon #define EFI_BOOT_SERVICES_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION) 814530d68baSNigel Croxon 815530d68baSNigel Croxon typedef struct _EFI_BOOT_SERVICES { 816530d68baSNigel Croxon 817530d68baSNigel Croxon EFI_TABLE_HEADER Hdr; 818530d68baSNigel Croxon 819530d68baSNigel Croxon // 820530d68baSNigel Croxon // Task priority functions 821530d68baSNigel Croxon // 822530d68baSNigel Croxon 823530d68baSNigel Croxon EFI_RAISE_TPL RaiseTPL; 824530d68baSNigel Croxon EFI_RESTORE_TPL RestoreTPL; 825530d68baSNigel Croxon 826530d68baSNigel Croxon // 827530d68baSNigel Croxon // Memory functions 828530d68baSNigel Croxon // 829530d68baSNigel Croxon 830530d68baSNigel Croxon EFI_ALLOCATE_PAGES AllocatePages; 831530d68baSNigel Croxon EFI_FREE_PAGES FreePages; 832530d68baSNigel Croxon EFI_GET_MEMORY_MAP GetMemoryMap; 833530d68baSNigel Croxon EFI_ALLOCATE_POOL AllocatePool; 834530d68baSNigel Croxon EFI_FREE_POOL FreePool; 835530d68baSNigel Croxon 836530d68baSNigel Croxon // 837530d68baSNigel Croxon // Event & timer functions 838530d68baSNigel Croxon // 839530d68baSNigel Croxon 840530d68baSNigel Croxon EFI_CREATE_EVENT CreateEvent; 841530d68baSNigel Croxon EFI_SET_TIMER SetTimer; 842530d68baSNigel Croxon EFI_WAIT_FOR_EVENT WaitForEvent; 843530d68baSNigel Croxon EFI_SIGNAL_EVENT SignalEvent; 844530d68baSNigel Croxon EFI_CLOSE_EVENT CloseEvent; 845530d68baSNigel Croxon EFI_CHECK_EVENT CheckEvent; 846530d68baSNigel Croxon 847530d68baSNigel Croxon // 848530d68baSNigel Croxon // Protocol handler functions 849530d68baSNigel Croxon // 850530d68baSNigel Croxon 851530d68baSNigel Croxon EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface; 852530d68baSNigel Croxon EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface; 853530d68baSNigel Croxon EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface; 854530d68baSNigel Croxon EFI_HANDLE_PROTOCOL HandleProtocol; 855530d68baSNigel Croxon EFI_HANDLE_PROTOCOL PCHandleProtocol; 856530d68baSNigel Croxon EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify; 857530d68baSNigel Croxon EFI_LOCATE_HANDLE LocateHandle; 858530d68baSNigel Croxon EFI_LOCATE_DEVICE_PATH LocateDevicePath; 859530d68baSNigel Croxon EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable; 860530d68baSNigel Croxon 861530d68baSNigel Croxon // 862530d68baSNigel Croxon // Image functions 863530d68baSNigel Croxon // 864530d68baSNigel Croxon 865530d68baSNigel Croxon EFI_IMAGE_LOAD LoadImage; 866530d68baSNigel Croxon EFI_IMAGE_START StartImage; 867530d68baSNigel Croxon EFI_EXIT Exit; 868530d68baSNigel Croxon EFI_IMAGE_UNLOAD UnloadImage; 869530d68baSNigel Croxon EFI_EXIT_BOOT_SERVICES ExitBootServices; 870530d68baSNigel Croxon 871530d68baSNigel Croxon // 872530d68baSNigel Croxon // Misc functions 873530d68baSNigel Croxon // 874530d68baSNigel Croxon 875530d68baSNigel Croxon EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount; 876530d68baSNigel Croxon EFI_STALL Stall; 877530d68baSNigel Croxon EFI_SET_WATCHDOG_TIMER SetWatchdogTimer; 878530d68baSNigel Croxon 879530d68baSNigel Croxon // 880530d68baSNigel Croxon // DriverSupport Services 881530d68baSNigel Croxon // 882530d68baSNigel Croxon 883530d68baSNigel Croxon EFI_CONNECT_CONTROLLER ConnectController; 884530d68baSNigel Croxon EFI_DISCONNECT_CONTROLLER DisconnectController; 885530d68baSNigel Croxon 886530d68baSNigel Croxon // 887530d68baSNigel Croxon // Open and Close Protocol Services 888530d68baSNigel Croxon // 889530d68baSNigel Croxon EFI_OPEN_PROTOCOL OpenProtocol; 890530d68baSNigel Croxon EFI_CLOSE_PROTOCOL CloseProtocol; 891530d68baSNigel Croxon EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation; 892530d68baSNigel Croxon 893530d68baSNigel Croxon // 894530d68baSNigel Croxon // Library Services 895530d68baSNigel Croxon // 896530d68baSNigel Croxon EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle; 897530d68baSNigel Croxon EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer; 898530d68baSNigel Croxon EFI_LOCATE_PROTOCOL LocateProtocol; 899530d68baSNigel Croxon EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces; 900530d68baSNigel Croxon EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces; 901530d68baSNigel Croxon 902530d68baSNigel Croxon // 903530d68baSNigel Croxon // 32-bit CRC Services 904530d68baSNigel Croxon // 905530d68baSNigel Croxon EFI_CALCULATE_CRC32 CalculateCrc32; 906530d68baSNigel Croxon 907530d68baSNigel Croxon // 908530d68baSNigel Croxon // Misc Services 909530d68baSNigel Croxon // 910530d68baSNigel Croxon EFI_COPY_MEM CopyMem; 911530d68baSNigel Croxon EFI_SET_MEM SetMem; 912530d68baSNigel Croxon EFI_CREATE_EVENT_EX CreateEventEx; 913530d68baSNigel Croxon } EFI_BOOT_SERVICES; 914530d68baSNigel Croxon 915530d68baSNigel Croxon 916530d68baSNigel Croxon // 917530d68baSNigel Croxon // EFI Configuration Table and GUID definitions 918530d68baSNigel Croxon // 919530d68baSNigel Croxon 920530d68baSNigel Croxon #define MPS_TABLE_GUID \ 921530d68baSNigel Croxon { 0xeb9d2d2f, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } 922530d68baSNigel Croxon 923530d68baSNigel Croxon #define ACPI_TABLE_GUID \ 924530d68baSNigel Croxon { 0xeb9d2d30, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } 925530d68baSNigel Croxon 926530d68baSNigel Croxon #define ACPI_20_TABLE_GUID \ 927530d68baSNigel Croxon { 0x8868e871, 0xe4f1, 0x11d3, {0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} } 928530d68baSNigel Croxon 929530d68baSNigel Croxon #define SMBIOS_TABLE_GUID \ 930530d68baSNigel Croxon { 0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } 931530d68baSNigel Croxon 932ef81c051SNigel Croxon #define SMBIOS3_TABLE_GUID \ 933ef81c051SNigel Croxon { 0xf2fd1544, 0x9794, 0x4a2c, {0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94} } 934ef81c051SNigel Croxon 935530d68baSNigel Croxon #define SAL_SYSTEM_TABLE_GUID \ 936530d68baSNigel Croxon { 0xeb9d2d32, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } 937530d68baSNigel Croxon 938530d68baSNigel Croxon 939530d68baSNigel Croxon typedef struct _EFI_CONFIGURATION_TABLE { 940530d68baSNigel Croxon EFI_GUID VendorGuid; 941530d68baSNigel Croxon VOID *VendorTable; 942530d68baSNigel Croxon } EFI_CONFIGURATION_TABLE; 943530d68baSNigel Croxon 944530d68baSNigel Croxon 945530d68baSNigel Croxon // 946530d68baSNigel Croxon // EFI System Table 947530d68baSNigel Croxon // 948530d68baSNigel Croxon 949530d68baSNigel Croxon 950530d68baSNigel Croxon 951530d68baSNigel Croxon 952530d68baSNigel Croxon #define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249 953530d68baSNigel Croxon #define EFI_SYSTEM_TABLE_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION) 954530d68baSNigel Croxon 955530d68baSNigel Croxon typedef struct _EFI_SYSTEM_TABLE { 956530d68baSNigel Croxon EFI_TABLE_HEADER Hdr; 957530d68baSNigel Croxon 958530d68baSNigel Croxon CHAR16 *FirmwareVendor; 959530d68baSNigel Croxon UINT32 FirmwareRevision; 960530d68baSNigel Croxon 961530d68baSNigel Croxon EFI_HANDLE ConsoleInHandle; 962530d68baSNigel Croxon SIMPLE_INPUT_INTERFACE *ConIn; 963530d68baSNigel Croxon 964530d68baSNigel Croxon EFI_HANDLE ConsoleOutHandle; 965530d68baSNigel Croxon SIMPLE_TEXT_OUTPUT_INTERFACE *ConOut; 966530d68baSNigel Croxon 967530d68baSNigel Croxon EFI_HANDLE StandardErrorHandle; 968530d68baSNigel Croxon SIMPLE_TEXT_OUTPUT_INTERFACE *StdErr; 969530d68baSNigel Croxon 970530d68baSNigel Croxon EFI_RUNTIME_SERVICES *RuntimeServices; 971530d68baSNigel Croxon EFI_BOOT_SERVICES *BootServices; 972530d68baSNigel Croxon 973530d68baSNigel Croxon UINTN NumberOfTableEntries; 974530d68baSNigel Croxon EFI_CONFIGURATION_TABLE *ConfigurationTable; 975530d68baSNigel Croxon 976530d68baSNigel Croxon } EFI_SYSTEM_TABLE; 977530d68baSNigel Croxon 978530d68baSNigel Croxon #endif 979530d68baSNigel Croxon 980