/* efi.h - declare EFI types and functions */ /* * VAS_EBOOT -- GRand Unified Bootloader * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * * VAS_EBOOT is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * VAS_EBOOT is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with VAS_EBOOT. If not, see . */ #ifndef VAS_EBOOT_EFI_API_HEADER #define VAS_EBOOT_EFI_API_HEADER 1 #include #include /* For consistency and safety, we name the EFI-defined types differently. All names are transformed into lower case, _t appended, and VasEBoot_efi_ prepended. */ /* Constants. */ #define VAS_EBOOT_EFI_EVT_TIMER 0x80000000 #define VAS_EBOOT_EFI_EVT_RUNTIME 0x40000000 #define VAS_EBOOT_EFI_EVT_RUNTIME_CONTEXT 0x20000000 #define VAS_EBOOT_EFI_EVT_NOTIFY_WAIT 0x00000100 #define VAS_EBOOT_EFI_EVT_NOTIFY_SIGNAL 0x00000200 #define VAS_EBOOT_EFI_EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201 #define VAS_EBOOT_EFI_EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202 #define VAS_EBOOT_EFI_TPL_APPLICATION 4 #define VAS_EBOOT_EFI_TPL_CALLBACK 8 #define VAS_EBOOT_EFI_TPL_NOTIFY 16 #define VAS_EBOOT_EFI_TPL_HIGH_LEVEL 31 #define VAS_EBOOT_EFI_MEMORY_UC 0x0000000000000001LL #define VAS_EBOOT_EFI_MEMORY_WC 0x0000000000000002LL #define VAS_EBOOT_EFI_MEMORY_WT 0x0000000000000004LL #define VAS_EBOOT_EFI_MEMORY_WB 0x0000000000000008LL #define VAS_EBOOT_EFI_MEMORY_UCE 0x0000000000000010LL #define VAS_EBOOT_EFI_MEMORY_WP 0x0000000000001000LL #define VAS_EBOOT_EFI_MEMORY_RP 0x0000000000002000LL #define VAS_EBOOT_EFI_MEMORY_XP 0x0000000000004000LL #define VAS_EBOOT_EFI_MEMORY_NV 0x0000000000008000LL #define VAS_EBOOT_EFI_MEMORY_MORE_RELIABLE 0x0000000000010000LL #define VAS_EBOOT_EFI_MEMORY_RO 0x0000000000020000LL #define VAS_EBOOT_EFI_MEMORY_RUNTIME 0x8000000000000000LL #define VAS_EBOOT_EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 #define VAS_EBOOT_EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002 #define VAS_EBOOT_EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004 #define VAS_EBOOT_EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008 #define VAS_EBOOT_EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010 #define VAS_EBOOT_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE 0x00000020 #define VAS_EBOOT_EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001ULL #define VAS_EBOOT_EFI_VARIABLE_NON_VOLATILE 0x0000000000000001 #define VAS_EBOOT_EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002 #define VAS_EBOOT_EFI_VARIABLE_RUNTIME_ACCESS 0x0000000000000004 #define VAS_EBOOT_EFI_TIME_ADJUST_DAYLIGHT 0x01 #define VAS_EBOOT_EFI_TIME_IN_DAYLIGHT 0x02 #define VAS_EBOOT_EFI_UNSPECIFIED_TIMEZONE 0x07FF #define VAS_EBOOT_EFI_OPTIONAL_PTR 0x00000001 #define VAS_EBOOT_EFI_LOADED_IMAGE_GUID \ { 0x5b1b31a1, 0x9562, 0x11d2, \ { 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } #define VAS_EBOOT_EFI_DISK_IO_GUID \ { 0xce345171, 0xba0b, 0x11d2, \ { 0x8e, 0x4f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } #define VAS_EBOOT_EFI_BLOCK_IO_GUID \ { 0x964e5b21, 0x6459, 0x11d2, \ { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } #define VAS_EBOOT_EFI_SERIAL_IO_GUID \ { 0xbb25cf6f, 0xf1d4, 0x11d2, \ { 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0xfd } \ } #define VAS_EBOOT_EFI_SIMPLE_NETWORK_GUID \ { 0xa19832b9, 0xac25, 0x11d3, \ { 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } #define VAS_EBOOT_EFI_PXE_GUID \ { 0x03c4e603, 0xac28, 0x11d3, \ { 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } #define VAS_EBOOT_EFI_DEVICE_PATH_GUID \ { 0x09576e91, 0x6d3f, 0x11d2, \ { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } #define VAS_EBOOT_EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \ { 0x387477c1, 0x69c7, 0x11d2, \ { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } #define VAS_EBOOT_EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \ { 0xdd9e7534, 0x7762, 0x4698, \ { 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa } \ } #define VAS_EBOOT_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \ { 0x387477c2, 0x69c7, 0x11d2, \ { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } #define VAS_EBOOT_EFI_SIMPLE_POINTER_PROTOCOL_GUID \ { 0x31878c87, 0xb75, 0x11d5, \ { 0x9a, 0x4f, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } #define VAS_EBOOT_EFI_ABSOLUTE_POINTER_PROTOCOL_GUID \ { 0x8D59D32B, 0xC655, 0x4AE9, \ { 0x9B, 0x15, 0xF2, 0x59, 0x04, 0x99, 0x2A, 0x43 } \ } #define VAS_EBOOT_EFI_DRIVER_BINDING_PROTOCOL_GUID \ { 0x18A031AB, 0xB443, 0x4D1A, \ { 0xA5, 0xC0, 0x0C, 0x09, 0x26, 0x1E, 0x9F, 0x71 } \ } #define VAS_EBOOT_EFI_LOADED_IMAGE_PROTOCOL_GUID \ { 0x5B1B31A1, 0x9562, 0x11d2, \ { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \ } #define VAS_EBOOT_EFI_LOAD_FILE_PROTOCOL_GUID \ { 0x56EC3091, 0x954C, 0x11d2, \ { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \ } #define VAS_EBOOT_EFI_LOAD_FILE2_PROTOCOL_GUID \ { 0x4006c0c1, 0xfcb3, 0x403e, \ { 0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d } \ } #define VAS_EBOOT_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ { 0x0964e5b22, 0x6459, 0x11d2, \ { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } #define VAS_EBOOT_EFI_TAPE_IO_PROTOCOL_GUID \ { 0x1e93e633, 0xd65a, 0x459e, \ { 0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } \ } #define VAS_EBOOT_EFI_UNICODE_COLLATION_PROTOCOL_GUID \ { 0x1d85cd7f, 0xf43d, 0x11d2, \ { 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } #define VAS_EBOOT_EFI_SCSI_IO_PROTOCOL_GUID \ { 0x932f47e6, 0x2362, 0x4002, \ { 0x80, 0x3e, 0x3c, 0xd5, 0x4b, 0x13, 0x8f, 0x85 } \ } #define VAS_EBOOT_EFI_USB2_HC_PROTOCOL_GUID \ { 0x3e745226, 0x9818, 0x45b6, \ { 0xa2, 0xac, 0xd7, 0xcd, 0x0e, 0x8b, 0xa2, 0xbc } \ } #define VAS_EBOOT_EFI_DEBUG_SUPPORT_PROTOCOL_GUID \ { 0x2755590C, 0x6F3C, 0x42FA, \ { 0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 } \ } #define VAS_EBOOT_EFI_DEBUGPORT_PROTOCOL_GUID \ { 0xEBA4E8D2, 0x3858, 0x41EC, \ { 0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \ } #define VAS_EBOOT_EFI_DECOMPRESS_PROTOCOL_GUID \ { 0xd8117cfe, 0x94a6, 0x11d4, \ { 0x9a, 0x3a, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } #define VAS_EBOOT_EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \ { 0x8b843e20, 0x8132, 0x4852, \ { 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } \ } #define VAS_EBOOT_EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \ { 0x379be4e, 0xd706, 0x437d, \ { 0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 } \ } #define VAS_EBOOT_EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID \ { 0x5c99a21, 0xc70f, 0x4ad2, \ { 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e } \ } #define VAS_EBOOT_EFI_ACPI_TABLE_PROTOCOL_GUID \ { 0xffe06bdd, 0x6107, 0x46a6, \ { 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c} \ } #define VAS_EBOOT_EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \ { 0x587e72d7, 0xcc50, 0x4f79, \ { 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f } \ } #define VAS_EBOOT_EFI_HII_DATABASE_PROTOCOL_GUID \ { 0xef9fc172, 0xa1b2, 0x4693, \ { 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42 } \ } #define VAS_EBOOT_EFI_HII_STRING_PROTOCOL_GUID \ { 0xfd96974, 0x23aa, 0x4cdc, \ { 0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a } \ } #define VAS_EBOOT_EFI_HII_IMAGE_PROTOCOL_GUID \ { 0x31a6406a, 0x6bdf, 0x4e46, \ { 0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20 } \ } #define VAS_EBOOT_EFI_HII_FONT_PROTOCOL_GUID \ { 0xe9ca4775, 0x8657, 0x47fc, \ { 0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x8, 0x43, 0x24 } \ } #define VAS_EBOOT_EFI_HII_CONFIGURATION_ACCESS_PROTOCOL_GUID \ { 0x330d4706, 0xf2a0, 0x4e4f, \ { 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } \ } #define VAS_EBOOT_EFI_COMPONENT_NAME2_PROTOCOL_GUID \ { 0x6a7a5cff, 0xe8d9, 0x4f70, \ { 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14} \ } #define VAS_EBOOT_EFI_USB_IO_PROTOCOL_GUID \ { 0x2B2F68D6, 0x0CD2, 0x44cf, \ { 0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75 } \ } #define VAS_EBOOT_EFI_TIANO_CUSTOM_DECOMPRESS_GUID \ { 0xa31280ad, 0x481e, 0x41b6, \ { 0x95, 0xe8, 0x12, 0x7f, 0x4c, 0x98, 0x47, 0x79 } \ } #define VAS_EBOOT_EFI_CRC32_GUIDED_SECTION_EXTRACTION_GUID \ { 0xfc1bcdb0, 0x7d31, 0x49aa, \ { 0x93, 0x6a, 0xa4, 0x60, 0x0d, 0x9d, 0xd0, 0x83 } \ } #define VAS_EBOOT_EFI_LZMA_CUSTOM_DECOMPRESS_GUID \ { 0xee4e5898, 0x3914, 0x4259, \ { 0x9d, 0x6e, 0xdc, 0x7b, 0xd7, 0x94, 0x03, 0xcf } \ } #define VAS_EBOOT_EFI_TSC_FREQUENCY_GUID \ { 0xdba6a7e3, 0xbb57, 0x4be7, \ { 0x8a, 0xf8, 0xd5, 0x78, 0xdb, 0x7e, 0x56, 0x87 } \ } #define VAS_EBOOT_EFI_SYSTEM_RESOURCE_TABLE_GUID \ { 0xb122a263, 0x3661, 0x4f68, \ { 0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80 } \ } #define VAS_EBOOT_EFI_DXE_SERVICES_TABLE_GUID \ { 0x05ad34ba, 0x6f02, 0x4214, \ { 0x95, 0x2e, 0x4d, 0xa0, 0x39, 0x8e, 0x2b, 0xb9 } \ } #define VAS_EBOOT_EFI_HOB_LIST_GUID \ { 0x7739f24c, 0x93d7, 0x11d4, \ { 0x9a, 0x3a, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } #define VAS_EBOOT_EFI_IMAGE_SECURITY_DATABASE_GUID \ { 0xd719b2cb, 0x3d3a, 0x4596, \ { 0xa3, 0xbc, 0xda, 0xd0, 0x0e, 0x67, 0x65, 0x6f } \ } #define VAS_EBOOT_EFI_MEMORY_TYPE_INFORMATION_GUID \ { 0x4c19049f, 0x4137, 0x4dd3, \ { 0x9c, 0x10, 0x8b, 0x97, 0xa8, 0x3f, 0xfd, 0xfa } \ } #define VAS_EBOOT_EFI_CONFORMANCE_PROFILES_TABLE_GUID \ { 0x36122546, 0xf7e7, 0x4c8f, \ { 0xbd, 0x9b, 0xeb, 0x85, 0x25, 0xb5, 0x0c, 0x0b } \ } #define VAS_EBOOT_EFI_DEBUG_IMAGE_INFO_TABLE_GUID \ { 0x49152e77, 0x1ada, 0x4764, \ { 0xb7, 0xa2, 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b } \ } #define VAS_EBOOT_EFI_MPS_TABLE_GUID \ { 0xeb9d2d2f, 0x2d88, 0x11d3, \ { 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } #define VAS_EBOOT_EFI_ACPI_TABLE_GUID \ { 0xeb9d2d30, 0x2d88, 0x11d3, \ { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } #define VAS_EBOOT_EFI_ACPI_20_TABLE_GUID \ { 0x8868e871, 0xe4f1, 0x11d3, \ { 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \ } #define VAS_EBOOT_EFI_SMBIOS_TABLE_GUID \ { 0xeb9d2d31, 0x2d88, 0x11d3, \ { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } #define VAS_EBOOT_EFI_SMBIOS3_TABLE_GUID \ { 0xf2fd1544, 0x9794, 0x4a2c, \ { 0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94 } \ } #define VAS_EBOOT_EFI_SAL_TABLE_GUID \ { 0xeb9d2d32, 0x2d88, 0x11d3, \ { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } #define VAS_EBOOT_EFI_HCDP_TABLE_GUID \ { 0xf951938d, 0x620b, 0x42ef, \ { 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 } \ } #define VAS_EBOOT_EFI_RT_PROPERTIES_TABLE_GUID \ { 0xeb66918a, 0x7eef, 0x402a, \ { 0x84, 0x2e, 0x93, 0x1d, 0x21, 0xc3, 0x8a, 0xe9 } \ } #define VAS_EBOOT_EFI_DEVICE_TREE_GUID \ { 0xb1b621d5, 0xf19c, 0x41a5, \ { 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } \ } #define VAS_EBOOT_EFI_VENDOR_APPLE_GUID \ { 0x2B0585EB, 0xD8B8, 0x49A9, \ { 0x8B, 0x8C, 0xE2, 0x1B, 0x01, 0xAE, 0xF2, 0xB7 } \ } #define VAS_EBOOT_EFI_SHIM_LOCK_GUID \ { 0x605dab50, 0xe046, 0x4300, \ { 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23 } \ } #define VAS_EBOOT_EFI_SHIM_IMAGE_LOADER_GUID \ { 0x1f492041, 0xfadb, 0x4e59, \ {0x9e, 0x57, 0x7c, 0xaf, 0xe7, 0x3a, 0x55, 0xab } \ } #define VAS_EBOOT_EFI_RNG_PROTOCOL_GUID \ { 0x3152bca5, 0xeade, 0x433d, \ { 0x86, 0x2e, 0xc0, 0x1c, 0xdc, 0x29, 0x1f, 0x44 } \ } #define LINUX_EFI_INITRD_MEDIA_GUID \ { 0x5568e427, 0x68fc, 0x4f3d, \ { 0xac, 0x74, 0xca, 0x55, 0x52, 0x31, 0xcc, 0x68 } \ } #define VAS_EBOOT_EFI_VENDOR_BOOT_LOADER_INTERFACE_GUID \ { 0x4a67b082, 0x0a4c, 0x41cf, \ {0xb6, 0xc7, 0x44, 0x0b, 0x29, 0xbb, 0x8c, 0x4f } \ } #define VAS_EBOOT_EFI_MEMORY_ATTRIBUTE_PROTOCOL_GUID \ { 0xf4560cf6, 0x40ec, 0x4b4a, \ { 0xa1, 0x92, 0xbf, 0x1d, 0x57, 0xd0, 0xb1, 0x89 } \ } #define VAS_EBOOT_EFI_MEMORY_ATTRIBUTES_TABLE_GUID \ { 0xdcfa911d, 0x26eb, 0x469f, \ { 0xa2, 0x20, 0x38, 0xb7, 0xdc, 0x46, 0x12, 0x20 } \ } #define VAS_EBOOT_EFI_TCG2_FINAL_EVENTS_TABLE_GUID \ { 0x1e2ed096, 0x30e2, 0x4254, \ { 0xbd, 0x89, 0x86, 0x3b, 0xbe, 0xf8, 0x23, 0x25 } \ } struct VasEBoot_efi_sal_system_table { VasEBoot_uint32_t signature; VasEBoot_uint32_t total_table_len; VasEBoot_uint16_t sal_rev; VasEBoot_uint16_t entry_count; VasEBoot_uint8_t checksum; VasEBoot_uint8_t reserved1[7]; VasEBoot_uint16_t sal_a_version; VasEBoot_uint16_t sal_b_version; VasEBoot_uint8_t oem_id[32]; VasEBoot_uint8_t product_id[32]; VasEBoot_uint8_t reserved2[8]; VasEBoot_uint8_t entries[0]; }; enum { VAS_EBOOT_EFI_SAL_SYSTEM_TABLE_TYPE_ENTRYPOINT_DESCRIPTOR = 0, VAS_EBOOT_EFI_SAL_SYSTEM_TABLE_TYPE_MEMORY_DESCRIPTOR = 1, VAS_EBOOT_EFI_SAL_SYSTEM_TABLE_TYPE_PLATFORM_FEATURES = 2, VAS_EBOOT_EFI_SAL_SYSTEM_TABLE_TYPE_TRANSLATION_REGISTER_DESCRIPTOR = 3, VAS_EBOOT_EFI_SAL_SYSTEM_TABLE_TYPE_PURGE_TRANSLATION_COHERENCE = 4, VAS_EBOOT_EFI_SAL_SYSTEM_TABLE_TYPE_AP_WAKEUP = 5 }; struct VasEBoot_efi_sal_system_table_entrypoint_descriptor { VasEBoot_uint8_t type; VasEBoot_uint8_t pad[7]; VasEBoot_uint64_t pal_proc_addr; VasEBoot_uint64_t sal_proc_addr; VasEBoot_uint64_t global_data_ptr; VasEBoot_uint64_t reserved[2]; }; struct VasEBoot_efi_sal_system_table_memory_descriptor { VasEBoot_uint8_t type; VasEBoot_uint8_t sal_used; VasEBoot_uint8_t attr; VasEBoot_uint8_t ar; VasEBoot_uint8_t attr_mask; VasEBoot_uint8_t mem_type; VasEBoot_uint8_t usage; VasEBoot_uint8_t unknown; VasEBoot_uint64_t addr; VasEBoot_uint64_t len; VasEBoot_uint64_t unknown2; }; struct VasEBoot_efi_sal_system_table_platform_features { VasEBoot_uint8_t type; VasEBoot_uint8_t flags; VasEBoot_uint8_t reserved[14]; }; struct VasEBoot_efi_sal_system_table_translation_register_descriptor { VasEBoot_uint8_t type; VasEBoot_uint8_t register_type; VasEBoot_uint8_t register_number; VasEBoot_uint8_t reserved[5]; VasEBoot_uint64_t addr; VasEBoot_uint64_t page_size; VasEBoot_uint64_t reserver; }; struct VasEBoot_efi_sal_system_table_purge_translation_coherence { VasEBoot_uint8_t type; VasEBoot_uint8_t reserved[3]; VasEBoot_uint32_t ndomains; VasEBoot_uint64_t coherence; }; struct VasEBoot_efi_sal_system_table_ap_wakeup { VasEBoot_uint8_t type; VasEBoot_uint8_t mechanism; VasEBoot_uint8_t reserved[6]; VasEBoot_uint64_t vector; }; enum { VAS_EBOOT_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_BUSLOCK = 1, VAS_EBOOT_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_IRQREDIRECT = 2, VAS_EBOOT_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_IPIREDIRECT = 4, VAS_EBOOT_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_ITCDRIFT = 8, }; typedef enum VasEBoot_efi_parity_type { VAS_EBOOT_EFI_SERIAL_DEFAULT_PARITY, VAS_EBOOT_EFI_SERIAL_NO_PARITY, VAS_EBOOT_EFI_SERIAL_EVEN_PARITY, VAS_EBOOT_EFI_SERIAL_ODD_PARITY } VasEBoot_efi_parity_type_t; typedef enum VasEBoot_efi_stop_bits { VAS_EBOOT_EFI_SERIAL_DEFAULT_STOP_BITS, VAS_EBOOT_EFI_SERIAL_1_STOP_BIT, VAS_EBOOT_EFI_SERIAL_1_5_STOP_BITS, VAS_EBOOT_EFI_SERIAL_2_STOP_BITS } VasEBoot_efi_stop_bits_t; /* Enumerations. */ enum VasEBoot_efi_timer_delay { VAS_EBOOT_EFI_TIMER_CANCEL, VAS_EBOOT_EFI_TIMER_PERIODIC, VAS_EBOOT_EFI_TIMER_RELATIVE }; typedef enum VasEBoot_efi_timer_delay VasEBoot_efi_timer_delay_t; enum VasEBoot_efi_allocate_type { VAS_EBOOT_EFI_ALLOCATE_ANY_PAGES, VAS_EBOOT_EFI_ALLOCATE_MAX_ADDRESS, VAS_EBOOT_EFI_ALLOCATE_ADDRESS, VAS_EBOOT_EFI_MAX_ALLOCATION_TYPE }; typedef enum VasEBoot_efi_allocate_type VasEBoot_efi_allocate_type_t; enum VasEBoot_efi_memory_type { VAS_EBOOT_EFI_RESERVED_MEMORY_TYPE, VAS_EBOOT_EFI_LOADER_CODE, VAS_EBOOT_EFI_LOADER_DATA, VAS_EBOOT_EFI_BOOT_SERVICES_CODE, VAS_EBOOT_EFI_BOOT_SERVICES_DATA, VAS_EBOOT_EFI_RUNTIME_SERVICES_CODE, VAS_EBOOT_EFI_RUNTIME_SERVICES_DATA, VAS_EBOOT_EFI_CONVENTIONAL_MEMORY, VAS_EBOOT_EFI_UNUSABLE_MEMORY, VAS_EBOOT_EFI_ACPI_RECLAIM_MEMORY, VAS_EBOOT_EFI_ACPI_MEMORY_NVS, VAS_EBOOT_EFI_MEMORY_MAPPED_IO, VAS_EBOOT_EFI_MEMORY_MAPPED_IO_PORT_SPACE, VAS_EBOOT_EFI_PAL_CODE, VAS_EBOOT_EFI_PERSISTENT_MEMORY, VAS_EBOOT_EFI_MAX_MEMORY_TYPE }; typedef enum VasEBoot_efi_memory_type VasEBoot_efi_memory_type_t; enum VasEBoot_efi_interface_type { VAS_EBOOT_EFI_NATIVE_INTERFACE }; typedef enum VasEBoot_efi_interface_type VasEBoot_efi_interface_type_t; enum VasEBoot_efi_locate_search_type { VAS_EBOOT_EFI_ALL_HANDLES, VAS_EBOOT_EFI_BY_REGISTER_NOTIFY, VAS_EBOOT_EFI_BY_PROTOCOL }; typedef enum VasEBoot_efi_locate_search_type VasEBoot_efi_locate_search_type_t; enum VasEBoot_efi_reset_type { VAS_EBOOT_EFI_RESET_COLD, VAS_EBOOT_EFI_RESET_WARM, VAS_EBOOT_EFI_RESET_SHUTDOWN }; typedef enum VasEBoot_efi_reset_type VasEBoot_efi_reset_type_t; /* Types. */ typedef char VasEBoot_efi_boolean_t; #if VAS_EBOOT_CPU_SIZEOF_VOID_P == 8 typedef VasEBoot_int64_t VasEBoot_efi_intn_t; typedef VasEBoot_uint64_t VasEBoot_efi_uintn_t; #define PRIxVAS_EBOOT_EFI_UINTN_T PRIxVAS_EBOOT_UINT64_T #define PRIuVAS_EBOOT_EFI_UINTN_T PRIuVAS_EBOOT_UINT64_T #else typedef VasEBoot_int32_t VasEBoot_efi_intn_t; typedef VasEBoot_uint32_t VasEBoot_efi_uintn_t; #define PRIxVAS_EBOOT_EFI_UINTN_T PRIxVAS_EBOOT_UINT32_T #define PRIuVAS_EBOOT_EFI_UINTN_T PRIuVAS_EBOOT_UINT32_T #endif typedef VasEBoot_int8_t VasEBoot_efi_int8_t; typedef VasEBoot_uint8_t VasEBoot_efi_uint8_t; typedef VasEBoot_int16_t VasEBoot_efi_int16_t; typedef VasEBoot_uint16_t VasEBoot_efi_uint16_t; typedef VasEBoot_int32_t VasEBoot_efi_int32_t; typedef VasEBoot_uint32_t VasEBoot_efi_uint32_t; #define PRIxVAS_EBOOT_EFI_UINT32_T PRIxVAS_EBOOT_UINT32_T #define PRIuVAS_EBOOT_EFI_UINT32_T PRIuVAS_EBOOT_UINT32_T typedef VasEBoot_int64_t VasEBoot_efi_int64_t; typedef VasEBoot_uint64_t VasEBoot_efi_uint64_t; typedef VasEBoot_uint8_t VasEBoot_efi_char8_t; typedef VasEBoot_uint16_t VasEBoot_efi_char16_t; typedef VasEBoot_efi_uintn_t VasEBoot_efi_status_t; /* * On x86, the EFI calling convention may deviate from the local one, so * callback functions exposed to the firmware must carry the follow attribute * annotation. (This includes protocols implemented by VAS_EBOOT that are installed * into the EFI protocol database.) */ #if defined(__i386__) #define __VasEBoot_efi_api __attribute__((regparm(0))) #elif defined(__x86_64__) #define __VasEBoot_efi_api __attribute__((ms_abi)) #else #define __VasEBoot_efi_api #endif #define VAS_EBOOT_EFI_ERROR_CODE(value) \ ((((VasEBoot_efi_status_t) 1) << (sizeof (VasEBoot_efi_status_t) * 8 - 1)) | (value)) #define VAS_EBOOT_EFI_WARNING_CODE(value) (value) #define VAS_EBOOT_EFI_SUCCESS 0 #define VAS_EBOOT_EFI_LOAD_ERROR VAS_EBOOT_EFI_ERROR_CODE (1) #define VAS_EBOOT_EFI_INVALID_PARAMETER VAS_EBOOT_EFI_ERROR_CODE (2) #define VAS_EBOOT_EFI_UNSUPPORTED VAS_EBOOT_EFI_ERROR_CODE (3) #define VAS_EBOOT_EFI_BAD_BUFFER_SIZE VAS_EBOOT_EFI_ERROR_CODE (4) #define VAS_EBOOT_EFI_BUFFER_TOO_SMALL VAS_EBOOT_EFI_ERROR_CODE (5) #define VAS_EBOOT_EFI_NOT_READY VAS_EBOOT_EFI_ERROR_CODE (6) #define VAS_EBOOT_EFI_DEVICE_ERROR VAS_EBOOT_EFI_ERROR_CODE (7) #define VAS_EBOOT_EFI_WRITE_PROTECTED VAS_EBOOT_EFI_ERROR_CODE (8) #define VAS_EBOOT_EFI_OUT_OF_RESOURCES VAS_EBOOT_EFI_ERROR_CODE (9) #define VAS_EBOOT_EFI_VOLUME_CORRUPTED VAS_EBOOT_EFI_ERROR_CODE (10) #define VAS_EBOOT_EFI_VOLUME_FULL VAS_EBOOT_EFI_ERROR_CODE (11) #define VAS_EBOOT_EFI_NO_MEDIA VAS_EBOOT_EFI_ERROR_CODE (12) #define VAS_EBOOT_EFI_MEDIA_CHANGED VAS_EBOOT_EFI_ERROR_CODE (13) #define VAS_EBOOT_EFI_NOT_FOUND VAS_EBOOT_EFI_ERROR_CODE (14) #define VAS_EBOOT_EFI_ACCESS_DENIED VAS_EBOOT_EFI_ERROR_CODE (15) #define VAS_EBOOT_EFI_NO_RESPONSE VAS_EBOOT_EFI_ERROR_CODE (16) #define VAS_EBOOT_EFI_NO_MAPPING VAS_EBOOT_EFI_ERROR_CODE (17) #define VAS_EBOOT_EFI_TIMEOUT VAS_EBOOT_EFI_ERROR_CODE (18) #define VAS_EBOOT_EFI_NOT_STARTED VAS_EBOOT_EFI_ERROR_CODE (19) #define VAS_EBOOT_EFI_ALREADY_STARTED VAS_EBOOT_EFI_ERROR_CODE (20) #define VAS_EBOOT_EFI_ABORTED VAS_EBOOT_EFI_ERROR_CODE (21) #define VAS_EBOOT_EFI_ICMP_ERROR VAS_EBOOT_EFI_ERROR_CODE (22) #define VAS_EBOOT_EFI_TFTP_ERROR VAS_EBOOT_EFI_ERROR_CODE (23) #define VAS_EBOOT_EFI_PROTOCOL_ERROR VAS_EBOOT_EFI_ERROR_CODE (24) #define VAS_EBOOT_EFI_INCOMPATIBLE_VERSION VAS_EBOOT_EFI_ERROR_CODE (25) #define VAS_EBOOT_EFI_SECURITY_VIOLATION VAS_EBOOT_EFI_ERROR_CODE (26) #define VAS_EBOOT_EFI_CRC_ERROR VAS_EBOOT_EFI_ERROR_CODE (27) #define VAS_EBOOT_EFI_WARN_UNKNOWN_GLYPH VAS_EBOOT_EFI_WARNING_CODE (1) #define VAS_EBOOT_EFI_WARN_DELETE_FAILURE VAS_EBOOT_EFI_WARNING_CODE (2) #define VAS_EBOOT_EFI_WARN_WRITE_FAILURE VAS_EBOOT_EFI_WARNING_CODE (3) #define VAS_EBOOT_EFI_WARN_BUFFER_TOO_SMALL VAS_EBOOT_EFI_WARNING_CODE (4) typedef void *VasEBoot_efi_handle_t; typedef void *VasEBoot_efi_event_t; typedef VasEBoot_efi_uint64_t VasEBoot_efi_lba_t; typedef VasEBoot_efi_uintn_t VasEBoot_efi_tpl_t; typedef VasEBoot_uint8_t VasEBoot_efi_mac_address_t[32]; typedef VasEBoot_uint8_t VasEBoot_efi_ipv4_address_t[4]; typedef VasEBoot_uint16_t VasEBoot_efi_ipv6_address_t[8]; typedef VasEBoot_uint8_t VasEBoot_efi_ip_address_t[8] __attribute__ ((aligned(4))); typedef VasEBoot_efi_uint64_t VasEBoot_efi_physical_address_t; typedef VasEBoot_efi_uint64_t VasEBoot_efi_virtual_address_t; /* XXX although the spec does not specify the padding, this actually must have the padding! */ struct VasEBoot_efi_memory_descriptor { VasEBoot_efi_uint32_t type; VasEBoot_efi_uint32_t padding; VasEBoot_efi_physical_address_t physical_start; VasEBoot_efi_virtual_address_t virtual_start; VasEBoot_efi_uint64_t num_pages; VasEBoot_efi_uint64_t attribute; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_memory_descriptor VasEBoot_efi_memory_descriptor_t; /* Device Path definitions. */ struct VasEBoot_efi_device_path { VasEBoot_efi_uint8_t type; VasEBoot_efi_uint8_t subtype; VasEBoot_efi_uint16_t length; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_device_path VasEBoot_efi_device_path_t; /* XXX EFI does not define EFI_DEVICE_PATH_PROTOCOL but uses it. It seems to be identical to EFI_DEVICE_PATH. */ typedef struct VasEBoot_efi_device_path VasEBoot_efi_device_path_protocol_t; #define VAS_EBOOT_EFI_DEVICE_PATH_TYPE(dp) ((dp)->type & 0x7f) #define VAS_EBOOT_EFI_DEVICE_PATH_SUBTYPE(dp) ((dp)->subtype) #define VAS_EBOOT_EFI_DEVICE_PATH_LENGTH(dp) ((dp)->length) #define VAS_EBOOT_EFI_DEVICE_PATH_VALID(dp) ((dp) != NULL && VAS_EBOOT_EFI_DEVICE_PATH_LENGTH (dp) >= 4) /* The End of Device Path nodes. */ #define VAS_EBOOT_EFI_END_DEVICE_PATH_TYPE (0xff & 0x7f) #define VAS_EBOOT_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff #define VAS_EBOOT_EFI_END_THIS_DEVICE_PATH_SUBTYPE 0x01 #define VAS_EBOOT_EFI_END_ENTIRE_DEVICE_PATH(dp) \ (!VAS_EBOOT_EFI_DEVICE_PATH_VALID (dp) || \ (VAS_EBOOT_EFI_DEVICE_PATH_TYPE (dp) == VAS_EBOOT_EFI_END_DEVICE_PATH_TYPE \ && (VAS_EBOOT_EFI_DEVICE_PATH_SUBTYPE (dp) \ == VAS_EBOOT_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE))) #define VAS_EBOOT_EFI_NEXT_DEVICE_PATH(dp) \ (VAS_EBOOT_EFI_DEVICE_PATH_VALID (dp) \ ? ((VasEBoot_efi_device_path_t *) \ ((char *) (dp) + VAS_EBOOT_EFI_DEVICE_PATH_LENGTH (dp))) \ : NULL) /* Hardware Device Path. */ #define VAS_EBOOT_EFI_HARDWARE_DEVICE_PATH_TYPE 1 #define VAS_EBOOT_EFI_PCI_DEVICE_PATH_SUBTYPE 1 struct VasEBoot_efi_pci_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint8_t function; VasEBoot_efi_uint8_t device; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_pci_device_path VasEBoot_efi_pci_device_path_t; #define VAS_EBOOT_EFI_PCCARD_DEVICE_PATH_SUBTYPE 2 struct VasEBoot_efi_pccard_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint8_t function; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_pccard_device_path VasEBoot_efi_pccard_device_path_t; #define VAS_EBOOT_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE 3 struct VasEBoot_efi_memory_mapped_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint32_t memory_type; VasEBoot_efi_physical_address_t start_address; VasEBoot_efi_physical_address_t end_address; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_memory_mapped_device_path VasEBoot_efi_memory_mapped_device_path_t; #define VAS_EBOOT_EFI_VENDOR_DEVICE_PATH_SUBTYPE 4 struct VasEBoot_efi_vendor_device_path { VasEBoot_efi_device_path_t header; VasEBoot_packed_guid_t vendor_guid; VasEBoot_efi_uint8_t vendor_defined_data[0]; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_vendor_device_path VasEBoot_efi_vendor_device_path_t; #define VAS_EBOOT_EFI_CONTROLLER_DEVICE_PATH_SUBTYPE 5 struct VasEBoot_efi_controller_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint32_t controller_number; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_controller_device_path VasEBoot_efi_controller_device_path_t; /* ACPI Device Path. */ #define VAS_EBOOT_EFI_ACPI_DEVICE_PATH_TYPE 2 #define VAS_EBOOT_EFI_ACPI_DEVICE_PATH_SUBTYPE 1 struct VasEBoot_efi_acpi_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint32_t hid; VasEBoot_efi_uint32_t uid; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_acpi_device_path VasEBoot_efi_acpi_device_path_t; #define VAS_EBOOT_EFI_EXPANDED_ACPI_DEVICE_PATH_SUBTYPE 2 struct VasEBoot_efi_expanded_acpi_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint32_t hid; VasEBoot_efi_uint32_t uid; VasEBoot_efi_uint32_t cid; char hidstr[0]; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_expanded_acpi_device_path VasEBoot_efi_expanded_acpi_device_path_t; #define VAS_EBOOT_EFI_EXPANDED_ACPI_HIDSTR(dp) \ (((VasEBoot_efi_expanded_acpi_device_path_t *) dp)->hidstr) #define VAS_EBOOT_EFI_EXPANDED_ACPI_UIDSTR(dp) \ (VAS_EBOOT_EFI_EXPANDED_ACPI_HIDSTR(dp) \ + VasEBoot_strlen (VAS_EBOOT_EFI_EXPANDED_ACPI_HIDSTR(dp)) + 1) #define VAS_EBOOT_EFI_EXPANDED_ACPI_CIDSTR(dp) \ (VAS_EBOOT_EFI_EXPANDED_ACPI_UIDSTR(dp) \ + VasEBoot_strlen (VAS_EBOOT_EFI_EXPANDED_ACPI_UIDSTR(dp)) + 1) /* Messaging Device Path. */ #define VAS_EBOOT_EFI_MESSAGING_DEVICE_PATH_TYPE 3 #define VAS_EBOOT_EFI_ATAPI_DEVICE_PATH_SUBTYPE 1 struct VasEBoot_efi_atapi_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint8_t primary_secondary; VasEBoot_efi_uint8_t slave_master; VasEBoot_efi_uint16_t lun; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_atapi_device_path VasEBoot_efi_atapi_device_path_t; #define VAS_EBOOT_EFI_SCSI_DEVICE_PATH_SUBTYPE 2 struct VasEBoot_efi_scsi_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint16_t pun; VasEBoot_efi_uint16_t lun; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_scsi_device_path VasEBoot_efi_scsi_device_path_t; #define VAS_EBOOT_EFI_FIBRE_CHANNEL_DEVICE_PATH_SUBTYPE 3 struct VasEBoot_efi_fibre_channel_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint32_t reserved; VasEBoot_efi_uint64_t wwn; VasEBoot_efi_uint64_t lun; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_fibre_channel_device_path VasEBoot_efi_fibre_channel_device_path_t; #define VAS_EBOOT_EFI_1394_DEVICE_PATH_SUBTYPE 4 struct VasEBoot_efi_1394_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint32_t reserved; VasEBoot_efi_uint64_t guid; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_1394_device_path VasEBoot_efi_1394_device_path_t; #define VAS_EBOOT_EFI_USB_DEVICE_PATH_SUBTYPE 5 struct VasEBoot_efi_usb_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint8_t parent_port_number; VasEBoot_efi_uint8_t usb_interface; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_usb_device_path VasEBoot_efi_usb_device_path_t; #define VAS_EBOOT_EFI_USB_CLASS_DEVICE_PATH_SUBTYPE 15 struct VasEBoot_efi_usb_class_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint16_t vendor_id; VasEBoot_efi_uint16_t product_id; VasEBoot_efi_uint8_t device_class; VasEBoot_efi_uint8_t device_subclass; VasEBoot_efi_uint8_t device_protocol; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_usb_class_device_path VasEBoot_efi_usb_class_device_path_t; #define VAS_EBOOT_EFI_I2O_DEVICE_PATH_SUBTYPE 6 struct VasEBoot_efi_i2o_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint32_t tid; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_i2o_device_path VasEBoot_efi_i2o_device_path_t; #define VAS_EBOOT_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE 11 struct VasEBoot_efi_mac_address_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_mac_address_t mac_address; VasEBoot_efi_uint8_t if_type; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_mac_address_device_path VasEBoot_efi_mac_address_device_path_t; #define VAS_EBOOT_EFI_IPV4_DEVICE_PATH_SUBTYPE 12 struct VasEBoot_efi_ipv4_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_ipv4_address_t local_ip_address; VasEBoot_efi_ipv4_address_t remote_ip_address; VasEBoot_efi_uint16_t local_port; VasEBoot_efi_uint16_t remote_port; VasEBoot_efi_uint16_t protocol; VasEBoot_efi_uint8_t static_ip_address; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_ipv4_device_path VasEBoot_efi_ipv4_device_path_t; #define VAS_EBOOT_EFI_IPV6_DEVICE_PATH_SUBTYPE 13 struct VasEBoot_efi_ipv6_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_ipv6_address_t local_ip_address; VasEBoot_efi_ipv6_address_t remote_ip_address; VasEBoot_efi_uint16_t local_port; VasEBoot_efi_uint16_t remote_port; VasEBoot_efi_uint16_t protocol; VasEBoot_efi_uint8_t static_ip_address; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_ipv6_device_path VasEBoot_efi_ipv6_device_path_t; #define VAS_EBOOT_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE 9 struct VasEBoot_efi_infiniband_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint32_t resource_flags; VasEBoot_efi_uint8_t port_gid[16]; VasEBoot_efi_uint64_t remote_id; VasEBoot_efi_uint64_t target_port_id; VasEBoot_efi_uint64_t device_id; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_infiniband_device_path VasEBoot_efi_infiniband_device_path_t; #define VAS_EBOOT_EFI_UART_DEVICE_PATH_SUBTYPE 14 struct VasEBoot_efi_uart_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint32_t reserved; VasEBoot_efi_uint64_t baud_rate; VasEBoot_efi_uint8_t data_bits; VasEBoot_efi_uint8_t parity; VasEBoot_efi_uint8_t stop_bits; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_uart_device_path VasEBoot_efi_uart_device_path_t; #define VAS_EBOOT_EFI_SATA_DEVICE_PATH_SUBTYPE 18 struct VasEBoot_efi_sata_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint16_t hba_port; VasEBoot_efi_uint16_t multiplier_port; VasEBoot_efi_uint16_t lun; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_sata_device_path VasEBoot_efi_sata_device_path_t; #define VAS_EBOOT_EFI_VLAN_DEVICE_PATH_SUBTYPE 20 struct VasEBoot_efi_vlan_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint16_t vlan_id; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_vlan_device_path VasEBoot_efi_vlan_device_path_t; #define VAS_EBOOT_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE 10 /* Media Device Path. */ #define VAS_EBOOT_EFI_MEDIA_DEVICE_PATH_TYPE 4 #define VAS_EBOOT_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE 1 struct VasEBoot_efi_hard_drive_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint32_t partition_number; VasEBoot_efi_lba_t partition_start; VasEBoot_efi_lba_t partition_size; VasEBoot_efi_uint8_t partition_signature[16]; VasEBoot_efi_uint8_t partmap_type; VasEBoot_efi_uint8_t signature_type; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_hard_drive_device_path VasEBoot_efi_hard_drive_device_path_t; #define VAS_EBOOT_EFI_CDROM_DEVICE_PATH_SUBTYPE 2 struct VasEBoot_efi_cdrom_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint32_t boot_entry; VasEBoot_efi_lba_t partition_start; VasEBoot_efi_lba_t partition_size; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_cdrom_device_path VasEBoot_efi_cdrom_device_path_t; #define VAS_EBOOT_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE 3 struct VasEBoot_efi_vendor_media_device_path { VasEBoot_efi_device_path_t header; VasEBoot_packed_guid_t vendor_guid; VasEBoot_efi_uint8_t vendor_defined_data[0]; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_vendor_media_device_path VasEBoot_efi_vendor_media_device_path_t; #define VAS_EBOOT_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE 4 struct VasEBoot_efi_file_path_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_char16_t path_name[0]; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_file_path_device_path VasEBoot_efi_file_path_device_path_t; #define VAS_EBOOT_EFI_PROTOCOL_DEVICE_PATH_SUBTYPE 5 struct VasEBoot_efi_protocol_device_path { VasEBoot_efi_device_path_t header; VasEBoot_packed_guid_t guid; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_protocol_device_path VasEBoot_efi_protocol_device_path_t; #define VAS_EBOOT_EFI_PIWG_DEVICE_PATH_SUBTYPE 6 struct VasEBoot_efi_piwg_device_path { VasEBoot_efi_device_path_t header; VasEBoot_packed_guid_t guid; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_piwg_device_path VasEBoot_efi_piwg_device_path_t; /* BIOS Boot Specification Device Path. */ #define VAS_EBOOT_EFI_BIOS_DEVICE_PATH_TYPE 5 #define VAS_EBOOT_EFI_BIOS_DEVICE_PATH_SUBTYPE 1 struct VasEBoot_efi_bios_device_path { VasEBoot_efi_device_path_t header; VasEBoot_efi_uint16_t device_type; VasEBoot_efi_uint16_t status_flags; char description[0]; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_bios_device_path VasEBoot_efi_bios_device_path_t; struct VasEBoot_efi_open_protocol_information_entry { VasEBoot_efi_handle_t agent_handle; VasEBoot_efi_handle_t controller_handle; VasEBoot_efi_uint32_t attributes; VasEBoot_efi_uint32_t open_count; }; typedef struct VasEBoot_efi_open_protocol_information_entry VasEBoot_efi_open_protocol_information_entry_t; struct VasEBoot_efi_time { VasEBoot_efi_uint16_t year; VasEBoot_efi_uint8_t month; VasEBoot_efi_uint8_t day; VasEBoot_efi_uint8_t hour; VasEBoot_efi_uint8_t minute; VasEBoot_efi_uint8_t second; VasEBoot_efi_uint8_t pad1; VasEBoot_efi_uint32_t nanosecond; VasEBoot_efi_int16_t time_zone; VasEBoot_efi_uint8_t daylight; VasEBoot_efi_uint8_t pad2; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_time VasEBoot_efi_time_t; struct VasEBoot_efi_time_capabilities { VasEBoot_efi_uint32_t resolution; VasEBoot_efi_uint32_t accuracy; VasEBoot_efi_boolean_t sets_to_zero; }; typedef struct VasEBoot_efi_time_capabilities VasEBoot_efi_time_capabilities_t; struct VasEBoot_efi_input_key { VasEBoot_efi_uint16_t scan_code; VasEBoot_efi_char16_t unicode_char; }; typedef struct VasEBoot_efi_input_key VasEBoot_efi_input_key_t; typedef VasEBoot_efi_uint8_t VasEBoot_efi_key_toggle_state_t; struct VasEBoot_efi_key_state { VasEBoot_efi_uint32_t key_shift_state; VasEBoot_efi_key_toggle_state_t key_toggle_state; }; typedef struct VasEBoot_efi_key_state VasEBoot_efi_key_state_t; #define VAS_EBOOT_EFI_SHIFT_STATE_VALID 0x80000000 #define VAS_EBOOT_EFI_RIGHT_SHIFT_PRESSED 0x00000001 #define VAS_EBOOT_EFI_LEFT_SHIFT_PRESSED 0x00000002 #define VAS_EBOOT_EFI_RIGHT_CONTROL_PRESSED 0x00000004 #define VAS_EBOOT_EFI_LEFT_CONTROL_PRESSED 0x00000008 #define VAS_EBOOT_EFI_RIGHT_ALT_PRESSED 0x00000010 #define VAS_EBOOT_EFI_LEFT_ALT_PRESSED 0x00000020 #define VAS_EBOOT_EFI_RIGHT_LOGO_PRESSED 0x00000040 #define VAS_EBOOT_EFI_LEFT_LOGO_PRESSED 0x00000080 #define VAS_EBOOT_EFI_MENU_KEY_PRESSED 0x00000100 #define VAS_EBOOT_EFI_SYS_REQ_PRESSED 0x00000200 #define VAS_EBOOT_EFI_TOGGLE_STATE_VALID 0x80 #define VAS_EBOOT_EFI_KEY_STATE_EXPOSED 0x40 #define VAS_EBOOT_EFI_SCROLL_LOCK_ACTIVE 0x01 #define VAS_EBOOT_EFI_NUM_LOCK_ACTIVE 0x02 #define VAS_EBOOT_EFI_CAPS_LOCK_ACTIVE 0x04 struct VasEBoot_efi_simple_text_output_mode { VasEBoot_efi_int32_t max_mode; VasEBoot_efi_int32_t mode; VasEBoot_efi_int32_t attribute; VasEBoot_efi_int32_t cursor_column; VasEBoot_efi_int32_t cursor_row; VasEBoot_efi_boolean_t cursor_visible; }; typedef struct VasEBoot_efi_simple_text_output_mode VasEBoot_efi_simple_text_output_mode_t; /* Tables. */ struct VasEBoot_efi_table_header { VasEBoot_efi_uint64_t signature; VasEBoot_efi_uint32_t revision; VasEBoot_efi_uint32_t header_size; VasEBoot_efi_uint32_t crc32; VasEBoot_efi_uint32_t reserved; }; typedef struct VasEBoot_efi_table_header VasEBoot_efi_table_header_t; struct VasEBoot_efi_boot_services { VasEBoot_efi_table_header_t hdr; VasEBoot_efi_tpl_t (__VasEBoot_efi_api *raise_tpl) (VasEBoot_efi_tpl_t new_tpl); void (__VasEBoot_efi_api *restore_tpl) (VasEBoot_efi_tpl_t old_tpl); VasEBoot_efi_status_t (__VasEBoot_efi_api *allocate_pages) (VasEBoot_efi_allocate_type_t type, VasEBoot_efi_memory_type_t memory_type, VasEBoot_efi_uintn_t pages, VasEBoot_efi_physical_address_t *memory); VasEBoot_efi_status_t (__VasEBoot_efi_api *free_pages) (VasEBoot_efi_physical_address_t memory, VasEBoot_efi_uintn_t pages); VasEBoot_efi_status_t (__VasEBoot_efi_api *get_memory_map) (VasEBoot_efi_uintn_t *memory_map_size, VasEBoot_efi_memory_descriptor_t *memory_map, VasEBoot_efi_uintn_t *map_key, VasEBoot_efi_uintn_t *descriptor_size, VasEBoot_efi_uint32_t *descriptor_version); VasEBoot_efi_status_t (__VasEBoot_efi_api *allocate_pool) (VasEBoot_efi_memory_type_t pool_type, VasEBoot_efi_uintn_t size, void **buffer); VasEBoot_efi_status_t (__VasEBoot_efi_api *free_pool) (void *buffer); VasEBoot_efi_status_t (__VasEBoot_efi_api *create_event) (VasEBoot_efi_uint32_t type, VasEBoot_efi_tpl_t notify_tpl, void (__VasEBoot_efi_api *notify_function) (VasEBoot_efi_event_t, void *context), void *notify_context, VasEBoot_efi_event_t *event); VasEBoot_efi_status_t (__VasEBoot_efi_api *set_timer) (VasEBoot_efi_event_t event, VasEBoot_efi_timer_delay_t type, VasEBoot_efi_uint64_t trigger_time); VasEBoot_efi_status_t (__VasEBoot_efi_api *wait_for_event) (VasEBoot_efi_uintn_t num_events, VasEBoot_efi_event_t *event, VasEBoot_efi_uintn_t *index); VasEBoot_efi_status_t (__VasEBoot_efi_api *signal_event) (VasEBoot_efi_event_t event); VasEBoot_efi_status_t (__VasEBoot_efi_api *close_event) (VasEBoot_efi_event_t event); VasEBoot_efi_status_t (__VasEBoot_efi_api *check_event) (VasEBoot_efi_event_t event); VasEBoot_efi_status_t (__VasEBoot_efi_api *install_protocol_interface) (VasEBoot_efi_handle_t *handle, VasEBoot_guid_t *protocol, VasEBoot_efi_interface_type_t protocol_interface_type, void *protocol_interface); VasEBoot_efi_status_t (__VasEBoot_efi_api *reinstall_protocol_interface) (VasEBoot_efi_handle_t handle, VasEBoot_guid_t *protocol, void *old_interface, void *new_interface); VasEBoot_efi_status_t (__VasEBoot_efi_api *uninstall_protocol_interface) (VasEBoot_efi_handle_t handle, VasEBoot_guid_t *protocol, void *protocol_interface); VasEBoot_efi_status_t (__VasEBoot_efi_api *handle_protocol) (VasEBoot_efi_handle_t handle, VasEBoot_guid_t *protocol, void **protocol_interface); void *reserved; VasEBoot_efi_status_t (__VasEBoot_efi_api *register_protocol_notify) (VasEBoot_guid_t *protocol, VasEBoot_efi_event_t event, void **registration); VasEBoot_efi_status_t (__VasEBoot_efi_api *locate_handle) (VasEBoot_efi_locate_search_type_t search_type, VasEBoot_guid_t *protocol, void *search_key, VasEBoot_efi_uintn_t *buffer_size, VasEBoot_efi_handle_t *buffer); VasEBoot_efi_status_t (__VasEBoot_efi_api *locate_device_path) (VasEBoot_guid_t *protocol, VasEBoot_efi_device_path_t **device_path, VasEBoot_efi_handle_t *device); VasEBoot_efi_status_t (__VasEBoot_efi_api *install_configuration_table) (VasEBoot_guid_t *guid, void *table); VasEBoot_efi_status_t (__VasEBoot_efi_api *load_image) (VasEBoot_efi_boolean_t boot_policy, VasEBoot_efi_handle_t parent_image_handle, VasEBoot_efi_device_path_t *file_path, void *source_buffer, VasEBoot_efi_uintn_t source_size, VasEBoot_efi_handle_t *image_handle); VasEBoot_efi_status_t (__VasEBoot_efi_api *start_image) (VasEBoot_efi_handle_t image_handle, VasEBoot_efi_uintn_t *exit_data_size, VasEBoot_efi_char16_t **exit_data); VasEBoot_efi_status_t (__VasEBoot_efi_api *exit) (VasEBoot_efi_handle_t image_handle, VasEBoot_efi_status_t exit_status, VasEBoot_efi_uintn_t exit_data_size, VasEBoot_efi_char16_t *exit_data); VasEBoot_efi_status_t (__VasEBoot_efi_api *unload_image) (VasEBoot_efi_handle_t image_handle); VasEBoot_efi_status_t (__VasEBoot_efi_api *exit_boot_services) (VasEBoot_efi_handle_t image_handle, VasEBoot_efi_uintn_t map_key); VasEBoot_efi_status_t (__VasEBoot_efi_api *get_next_monotonic_count) (VasEBoot_efi_uint64_t *count); VasEBoot_efi_status_t (__VasEBoot_efi_api *stall) (VasEBoot_efi_uintn_t microseconds); VasEBoot_efi_status_t (__VasEBoot_efi_api *set_watchdog_timer) (VasEBoot_efi_uintn_t timeout, VasEBoot_efi_uint64_t watchdog_code, VasEBoot_efi_uintn_t data_size, VasEBoot_efi_char16_t *watchdog_data); VasEBoot_efi_status_t (__VasEBoot_efi_api *connect_controller) (VasEBoot_efi_handle_t controller_handle, VasEBoot_efi_handle_t *driver_image_handle, VasEBoot_efi_device_path_protocol_t *remaining_device_path, VasEBoot_efi_boolean_t recursive); VasEBoot_efi_status_t (__VasEBoot_efi_api *disconnect_controller) (VasEBoot_efi_handle_t controller_handle, VasEBoot_efi_handle_t driver_image_handle, VasEBoot_efi_handle_t child_handle); VasEBoot_efi_status_t (__VasEBoot_efi_api *open_protocol) (VasEBoot_efi_handle_t handle, VasEBoot_guid_t *protocol, void **protocol_interface, VasEBoot_efi_handle_t agent_handle, VasEBoot_efi_handle_t controller_handle, VasEBoot_efi_uint32_t attributes); VasEBoot_efi_status_t (__VasEBoot_efi_api *close_protocol) (VasEBoot_efi_handle_t handle, VasEBoot_guid_t *protocol, VasEBoot_efi_handle_t agent_handle, VasEBoot_efi_handle_t controller_handle); VasEBoot_efi_status_t (__VasEBoot_efi_api *open_protocol_information) (VasEBoot_efi_handle_t handle, VasEBoot_guid_t *protocol, VasEBoot_efi_open_protocol_information_entry_t **entry_buffer, VasEBoot_efi_uintn_t *entry_count); VasEBoot_efi_status_t (__VasEBoot_efi_api *protocols_per_handle) (VasEBoot_efi_handle_t handle, VasEBoot_packed_guid_t ***protocol_buffer, VasEBoot_efi_uintn_t *protocol_buffer_count); VasEBoot_efi_status_t (__VasEBoot_efi_api *locate_handle_buffer) (VasEBoot_efi_locate_search_type_t search_type, VasEBoot_guid_t *protocol, void *search_key, VasEBoot_efi_uintn_t *no_handles, VasEBoot_efi_handle_t **buffer); VasEBoot_efi_status_t (__VasEBoot_efi_api *locate_protocol) (VasEBoot_guid_t *protocol, void *registration, void **protocol_interface); VasEBoot_efi_status_t (__VasEBoot_efi_api *install_multiple_protocol_interfaces) (VasEBoot_efi_handle_t *handle, ...); VasEBoot_efi_status_t (__VasEBoot_efi_api *uninstall_multiple_protocol_interfaces) (VasEBoot_efi_handle_t handle, ...); VasEBoot_efi_status_t (__VasEBoot_efi_api *calculate_crc32) (void *data, VasEBoot_efi_uintn_t data_size, VasEBoot_efi_uint32_t *crc32); void (__VasEBoot_efi_api *copy_mem) (void *destination, void *source, VasEBoot_efi_uintn_t length); void (__VasEBoot_efi_api *set_mem) (void *buffer, VasEBoot_efi_uintn_t size, VasEBoot_efi_uint8_t value); }; typedef struct VasEBoot_efi_boot_services VasEBoot_efi_boot_services_t; struct VasEBoot_efi_runtime_services { VasEBoot_efi_table_header_t hdr; VasEBoot_efi_status_t (__VasEBoot_efi_api *get_time) (VasEBoot_efi_time_t *time, VasEBoot_efi_time_capabilities_t *capabilities); VasEBoot_efi_status_t (__VasEBoot_efi_api *set_time) (VasEBoot_efi_time_t *time); VasEBoot_efi_status_t (__VasEBoot_efi_api *get_wakeup_time) (VasEBoot_efi_boolean_t *enabled, VasEBoot_efi_boolean_t *pending, VasEBoot_efi_time_t *time); VasEBoot_efi_status_t (__VasEBoot_efi_api *set_wakeup_time) (VasEBoot_efi_boolean_t enabled, VasEBoot_efi_time_t *time); VasEBoot_efi_status_t (__VasEBoot_efi_api *set_virtual_address_map) (VasEBoot_efi_uintn_t memory_map_size, VasEBoot_efi_uintn_t descriptor_size, VasEBoot_efi_uint32_t descriptor_version, VasEBoot_efi_memory_descriptor_t *virtual_map); VasEBoot_efi_status_t (__VasEBoot_efi_api *convert_pointer) (VasEBoot_efi_uintn_t debug_disposition, void **address); #define VAS_EBOOT_EFI_GLOBAL_VARIABLE_GUID \ { 0x8BE4DF61, 0x93CA, 0x11d2, { 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }} VasEBoot_efi_status_t (__VasEBoot_efi_api *get_variable) (VasEBoot_efi_char16_t *variable_name, const VasEBoot_guid_t *vendor_guid, VasEBoot_efi_uint32_t *attributes, VasEBoot_efi_uintn_t *data_size, void *data); VasEBoot_efi_status_t (__VasEBoot_efi_api *get_next_variable_name) (VasEBoot_efi_uintn_t *variable_name_size, VasEBoot_efi_char16_t *variable_name, VasEBoot_guid_t *vendor_guid); VasEBoot_efi_status_t (__VasEBoot_efi_api *set_variable) (VasEBoot_efi_char16_t *variable_name, const VasEBoot_guid_t *vendor_guid, VasEBoot_efi_uint32_t attributes, VasEBoot_efi_uintn_t data_size, void *data); VasEBoot_efi_status_t (__VasEBoot_efi_api *get_next_high_monotonic_count) (VasEBoot_efi_uint32_t *high_count); void (__VasEBoot_efi_api *reset_system) (VasEBoot_efi_reset_type_t reset_type, VasEBoot_efi_status_t reset_status, VasEBoot_efi_uintn_t data_size, VasEBoot_efi_char16_t *reset_data); }; typedef struct VasEBoot_efi_runtime_services VasEBoot_efi_runtime_services_t; struct VasEBoot_efi_configuration_table { VasEBoot_packed_guid_t vendor_guid; void *vendor_table; } VAS_EBOOT_PACKED; typedef struct VasEBoot_efi_configuration_table VasEBoot_efi_configuration_table_t; #define VAS_EBOOT_EFIEMU_SYSTEM_TABLE_SIGNATURE 0x5453595320494249LL #define VAS_EBOOT_EFIEMU_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552LL struct VasEBoot_efi_serial_io_interface { VasEBoot_efi_uint32_t revision; void (*reset) (void); VasEBoot_efi_status_t (__VasEBoot_efi_api *set_attributes) (struct VasEBoot_efi_serial_io_interface *this, VasEBoot_efi_uint64_t speed, VasEBoot_efi_uint32_t fifo_depth, VasEBoot_efi_uint32_t timeout, VasEBoot_efi_parity_type_t parity, VasEBoot_uint8_t word_len, VasEBoot_efi_stop_bits_t stop_bits); VasEBoot_efi_status_t (__VasEBoot_efi_api *set_control_bits) (struct VasEBoot_efi_serial_io_interface *this, VasEBoot_efi_uint32_t flags); void (__VasEBoot_efi_api *get_control_bits) (void); VasEBoot_efi_status_t (__VasEBoot_efi_api *write) (struct VasEBoot_efi_serial_io_interface *this, VasEBoot_efi_uintn_t *buf_size, void *buffer); VasEBoot_efi_status_t (__VasEBoot_efi_api *read) (struct VasEBoot_efi_serial_io_interface *this, VasEBoot_efi_uintn_t *buf_size, void *buffer); }; struct VasEBoot_efi_simple_input_interface { VasEBoot_efi_status_t (__VasEBoot_efi_api *reset) (struct VasEBoot_efi_simple_input_interface *this, VasEBoot_efi_boolean_t extended_verification); VasEBoot_efi_status_t (__VasEBoot_efi_api *read_key_stroke) (struct VasEBoot_efi_simple_input_interface *this, VasEBoot_efi_input_key_t *key); VasEBoot_efi_event_t wait_for_key; }; typedef struct VasEBoot_efi_simple_input_interface VasEBoot_efi_simple_input_interface_t; struct VasEBoot_efi_key_data { VasEBoot_efi_input_key_t key; VasEBoot_efi_key_state_t key_state; }; typedef struct VasEBoot_efi_key_data VasEBoot_efi_key_data_t; typedef VasEBoot_efi_status_t (__VasEBoot_efi_api *VasEBoot_efi_key_notify_function_t) ( VasEBoot_efi_key_data_t *key_data ); struct VasEBoot_efi_simple_text_input_ex_interface { VasEBoot_efi_status_t (__VasEBoot_efi_api *reset) (struct VasEBoot_efi_simple_text_input_ex_interface *this, VasEBoot_efi_boolean_t extended_verification); VasEBoot_efi_status_t (__VasEBoot_efi_api *read_key_stroke) (struct VasEBoot_efi_simple_text_input_ex_interface *this, VasEBoot_efi_key_data_t *key_data); VasEBoot_efi_event_t wait_for_key; VasEBoot_efi_status_t (__VasEBoot_efi_api *set_state) (struct VasEBoot_efi_simple_text_input_ex_interface *this, VasEBoot_efi_key_toggle_state_t *key_toggle_state); VasEBoot_efi_status_t (__VasEBoot_efi_api *register_key_notify) (struct VasEBoot_efi_simple_text_input_ex_interface *this, VasEBoot_efi_key_data_t *key_data, VasEBoot_efi_key_notify_function_t key_notification_function, void **notify_handle); VasEBoot_efi_status_t (__VasEBoot_efi_api *unregister_key_notify) (struct VasEBoot_efi_simple_text_input_ex_interface *this, void *notification_handle); }; typedef struct VasEBoot_efi_simple_text_input_ex_interface VasEBoot_efi_simple_text_input_ex_interface_t; struct VasEBoot_efi_simple_text_output_interface { VasEBoot_efi_status_t (__VasEBoot_efi_api *reset) (struct VasEBoot_efi_simple_text_output_interface *this, VasEBoot_efi_boolean_t extended_verification); VasEBoot_efi_status_t (__VasEBoot_efi_api *output_string) (struct VasEBoot_efi_simple_text_output_interface *this, VasEBoot_efi_char16_t *string); VasEBoot_efi_status_t (__VasEBoot_efi_api *test_string) (struct VasEBoot_efi_simple_text_output_interface *this, VasEBoot_efi_char16_t *string); VasEBoot_efi_status_t (__VasEBoot_efi_api *query_mode) (struct VasEBoot_efi_simple_text_output_interface *this, VasEBoot_efi_uintn_t mode_number, VasEBoot_efi_uintn_t *columns, VasEBoot_efi_uintn_t *rows); VasEBoot_efi_status_t (__VasEBoot_efi_api *set_mode) (struct VasEBoot_efi_simple_text_output_interface *this, VasEBoot_efi_uintn_t mode_number); VasEBoot_efi_status_t (__VasEBoot_efi_api *set_attributes) (struct VasEBoot_efi_simple_text_output_interface *this, VasEBoot_efi_uintn_t attribute); VasEBoot_efi_status_t (__VasEBoot_efi_api *clear_screen) (struct VasEBoot_efi_simple_text_output_interface *this); VasEBoot_efi_status_t (__VasEBoot_efi_api *set_cursor_position) (struct VasEBoot_efi_simple_text_output_interface *this, VasEBoot_efi_uintn_t column, VasEBoot_efi_uintn_t row); VasEBoot_efi_status_t (__VasEBoot_efi_api *enable_cursor) (struct VasEBoot_efi_simple_text_output_interface *this, VasEBoot_efi_boolean_t visible); VasEBoot_efi_simple_text_output_mode_t *mode; }; typedef struct VasEBoot_efi_simple_text_output_interface VasEBoot_efi_simple_text_output_interface_t; typedef VasEBoot_uint8_t VasEBoot_efi_pxe_packet_t[1472]; typedef struct VasEBoot_efi_pxe_mode { VasEBoot_uint8_t unused[52]; VasEBoot_efi_pxe_packet_t dhcp_discover; VasEBoot_efi_pxe_packet_t dhcp_ack; VasEBoot_efi_pxe_packet_t proxy_offer; VasEBoot_efi_pxe_packet_t pxe_discover; VasEBoot_efi_pxe_packet_t pxe_reply; } VasEBoot_efi_pxe_mode_t; typedef struct VasEBoot_efi_pxe { VasEBoot_uint64_t rev; void *start; void *stop; void *dhcp; void *discover; void *mftp; void *udpwrite; void *udpread; void *setipfilter; void *arp; void *setparams; void *setstationip; void *setpackets; struct VasEBoot_efi_pxe_mode *mode; } VasEBoot_efi_pxe_t; #define VAS_EBOOT_EFI_BLACK 0x00 #define VAS_EBOOT_EFI_BLUE 0x01 #define VAS_EBOOT_EFI_GREEN 0x02 #define VAS_EBOOT_EFI_CYAN 0x03 #define VAS_EBOOT_EFI_RED 0x04 #define VAS_EBOOT_EFI_MAGENTA 0x05 #define VAS_EBOOT_EFI_BROWN 0x06 #define VAS_EBOOT_EFI_LIGHTGRAY 0x07 #define VAS_EBOOT_EFI_BRIGHT 0x08 #define VAS_EBOOT_EFI_DARKGRAY 0x08 #define VAS_EBOOT_EFI_LIGHTBLUE 0x09 #define VAS_EBOOT_EFI_LIGHTGREEN 0x0A #define VAS_EBOOT_EFI_LIGHTCYAN 0x0B #define VAS_EBOOT_EFI_LIGHTRED 0x0C #define VAS_EBOOT_EFI_LIGHTMAGENTA 0x0D #define VAS_EBOOT_EFI_YELLOW 0x0E #define VAS_EBOOT_EFI_WHITE 0x0F #define VAS_EBOOT_EFI_BACKGROUND_BLACK 0x00 #define VAS_EBOOT_EFI_BACKGROUND_BLUE 0x10 #define VAS_EBOOT_EFI_BACKGROUND_GREEN 0x20 #define VAS_EBOOT_EFI_BACKGROUND_CYAN 0x30 #define VAS_EBOOT_EFI_BACKGROUND_RED 0x40 #define VAS_EBOOT_EFI_BACKGROUND_MAGENTA 0x50 #define VAS_EBOOT_EFI_BACKGROUND_BROWN 0x60 #define VAS_EBOOT_EFI_BACKGROUND_LIGHTGRAY 0x70 #define VAS_EBOOT_EFI_TEXT_ATTR(fg, bg) ((fg) | ((bg))) struct VasEBoot_efi_system_table { VasEBoot_efi_table_header_t hdr; VasEBoot_efi_char16_t *firmware_vendor; VasEBoot_efi_uint32_t firmware_revision; VasEBoot_efi_handle_t console_in_handler; VasEBoot_efi_simple_input_interface_t *con_in; VasEBoot_efi_handle_t console_out_handler; VasEBoot_efi_simple_text_output_interface_t *con_out; VasEBoot_efi_handle_t standard_error_handle; VasEBoot_efi_simple_text_output_interface_t *std_err; VasEBoot_efi_runtime_services_t *runtime_services; VasEBoot_efi_boot_services_t *boot_services; VasEBoot_efi_uintn_t num_table_entries; VasEBoot_efi_configuration_table_t *configuration_table; }; typedef struct VasEBoot_efi_system_table VasEBoot_efi_system_table_t; struct VasEBoot_efi_loaded_image { VasEBoot_efi_uint32_t revision; VasEBoot_efi_handle_t parent_handle; VasEBoot_efi_system_table_t *system_table; VasEBoot_efi_handle_t device_handle; VasEBoot_efi_device_path_t *file_path; void *reserved; VasEBoot_efi_uint32_t load_options_size; void *load_options; void *image_base; VasEBoot_efi_uint64_t image_size; VasEBoot_efi_memory_type_t image_code_type; VasEBoot_efi_memory_type_t image_data_type; VasEBoot_efi_status_t (__VasEBoot_efi_api *unload) (VasEBoot_efi_handle_t image_handle); }; typedef struct VasEBoot_efi_loaded_image VasEBoot_efi_loaded_image_t; struct VasEBoot_efi_disk_io { VasEBoot_efi_uint64_t revision; VasEBoot_efi_status_t (__VasEBoot_efi_api *read) (struct VasEBoot_efi_disk_io *this, VasEBoot_efi_uint32_t media_id, VasEBoot_efi_uint64_t offset, VasEBoot_efi_uintn_t buffer_size, void *buffer); VasEBoot_efi_status_t (__VasEBoot_efi_api *write) (struct VasEBoot_efi_disk_io *this, VasEBoot_efi_uint32_t media_id, VasEBoot_efi_uint64_t offset, VasEBoot_efi_uintn_t buffer_size, void *buffer); }; typedef struct VasEBoot_efi_disk_io VasEBoot_efi_disk_io_t; struct VasEBoot_efi_block_io_media { VasEBoot_efi_uint32_t media_id; VasEBoot_efi_boolean_t removable_media; VasEBoot_efi_boolean_t media_present; VasEBoot_efi_boolean_t logical_partition; VasEBoot_efi_boolean_t read_only; VasEBoot_efi_boolean_t write_caching; VasEBoot_efi_uint8_t pad[3]; VasEBoot_efi_uint32_t block_size; VasEBoot_efi_uint32_t io_align; VasEBoot_efi_uint8_t pad2[4]; VasEBoot_efi_lba_t last_block; }; typedef struct VasEBoot_efi_block_io_media VasEBoot_efi_block_io_media_t; typedef VasEBoot_uint8_t VasEBoot_efi_mac_t[32]; struct VasEBoot_efi_simple_network_mode { VasEBoot_uint32_t state; VasEBoot_uint32_t hwaddr_size; VasEBoot_uint32_t media_header_size; VasEBoot_uint32_t max_packet_size; VasEBoot_uint32_t nvram_size; VasEBoot_uint32_t nvram_access_size; VasEBoot_uint32_t receive_filter_mask; VasEBoot_uint32_t receive_filter_setting; VasEBoot_uint32_t max_mcast_filter_count; VasEBoot_uint32_t mcast_filter_count; VasEBoot_efi_mac_t mcast_filter[16]; VasEBoot_efi_mac_t current_address; VasEBoot_efi_mac_t broadcast_address; VasEBoot_efi_mac_t permanent_address; VasEBoot_uint8_t if_type; VasEBoot_uint8_t mac_changeable; VasEBoot_uint8_t multitx_supported; VasEBoot_uint8_t media_present_supported; VasEBoot_uint8_t media_present; }; enum { VAS_EBOOT_EFI_NETWORK_STOPPED, VAS_EBOOT_EFI_NETWORK_STARTED, VAS_EBOOT_EFI_NETWORK_INITIALIZED, }; enum { VAS_EBOOT_EFI_SIMPLE_NETWORK_RECEIVE_UNICAST = 0x01, VAS_EBOOT_EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST = 0x02, VAS_EBOOT_EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST = 0x04, VAS_EBOOT_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS = 0x08, VAS_EBOOT_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST = 0x10, }; struct VasEBoot_efi_simple_network { VasEBoot_uint64_t revision; VasEBoot_efi_status_t (__VasEBoot_efi_api *start) (struct VasEBoot_efi_simple_network *this); VasEBoot_efi_status_t (__VasEBoot_efi_api *stop) (struct VasEBoot_efi_simple_network *this); VasEBoot_efi_status_t (__VasEBoot_efi_api *initialize) (struct VasEBoot_efi_simple_network *this, VasEBoot_efi_uintn_t extra_rx, VasEBoot_efi_uintn_t extra_tx); void (__VasEBoot_efi_api *reset) (void); VasEBoot_efi_status_t (__VasEBoot_efi_api *shutdown) (struct VasEBoot_efi_simple_network *this); VasEBoot_efi_status_t (__VasEBoot_efi_api *receive_filters) (struct VasEBoot_efi_simple_network *this, VasEBoot_uint32_t enable, VasEBoot_uint32_t disable, VasEBoot_efi_boolean_t reset_mcast_filter, VasEBoot_efi_uintn_t mcast_filter_count, VasEBoot_efi_mac_address_t *mcast_filter); void (__VasEBoot_efi_api *station_address) (void); void (__VasEBoot_efi_api *statistics) (void); void (__VasEBoot_efi_api *mcastiptomac) (void); void (__VasEBoot_efi_api *nvdata) (void); VasEBoot_efi_status_t (__VasEBoot_efi_api *get_status) (struct VasEBoot_efi_simple_network *this, VasEBoot_uint32_t *int_status, void **txbuf); VasEBoot_efi_status_t (__VasEBoot_efi_api *transmit) (struct VasEBoot_efi_simple_network *this, VasEBoot_efi_uintn_t header_size, VasEBoot_efi_uintn_t buffer_size, void *buffer, VasEBoot_efi_mac_t *src_addr, VasEBoot_efi_mac_t *dest_addr, VasEBoot_efi_uint16_t *protocol); VasEBoot_efi_status_t (__VasEBoot_efi_api *receive) (struct VasEBoot_efi_simple_network *this, VasEBoot_efi_uintn_t *header_size, VasEBoot_efi_uintn_t *buffer_size, void *buffer, VasEBoot_efi_mac_t *src_addr, VasEBoot_efi_mac_t *dest_addr, VasEBoot_uint16_t *protocol); void (__VasEBoot_efi_api *waitforpacket) (void); struct VasEBoot_efi_simple_network_mode *mode; }; typedef struct VasEBoot_efi_simple_network VasEBoot_efi_simple_network_t; struct VasEBoot_efi_block_io { VasEBoot_efi_uint64_t revision; VasEBoot_efi_block_io_media_t *media; VasEBoot_efi_status_t (__VasEBoot_efi_api *reset) (struct VasEBoot_efi_block_io *this, VasEBoot_efi_boolean_t extended_verification); VasEBoot_efi_status_t (__VasEBoot_efi_api *read_blocks) (struct VasEBoot_efi_block_io *this, VasEBoot_efi_uint32_t media_id, VasEBoot_efi_lba_t lba, VasEBoot_efi_uintn_t buffer_size, void *buffer); VasEBoot_efi_status_t (__VasEBoot_efi_api *write_blocks) (struct VasEBoot_efi_block_io *this, VasEBoot_efi_uint32_t media_id, VasEBoot_efi_lba_t lba, VasEBoot_efi_uintn_t buffer_size, void *buffer); VasEBoot_efi_status_t (__VasEBoot_efi_api *flush_blocks) (struct VasEBoot_efi_block_io *this); }; typedef struct VasEBoot_efi_block_io VasEBoot_efi_block_io_t; struct VasEBoot_efi_shim_lock_protocol { /* * verify() function (surprisingly) does not use specific EFI calling convention. * So, it does not need to be tagged with __VasEBoot_efi_api attribute. */ VasEBoot_efi_status_t (*verify) (void *buffer, VasEBoot_uint32_t size); }; typedef struct VasEBoot_efi_shim_lock_protocol VasEBoot_efi_shim_lock_protocol_t; typedef VasEBoot_guid_t VasEBoot_efi_rng_algorithm_t; struct VasEBoot_efi_rng_protocol { VasEBoot_efi_status_t (__VasEBoot_efi_api *get_info) (struct VasEBoot_efi_rng_protocol *this, VasEBoot_efi_uintn_t *rng_algorithm_list_size, VasEBoot_efi_rng_algorithm_t *rng_algorithm_list); VasEBoot_efi_status_t (__VasEBoot_efi_api *get_rng) (struct VasEBoot_efi_rng_protocol *this, VasEBoot_efi_rng_algorithm_t *rng_algorithm, VasEBoot_efi_uintn_t rng_value_length, VasEBoot_efi_uint8_t *rng_value); }; typedef struct VasEBoot_efi_rng_protocol VasEBoot_efi_rng_protocol_t; struct VasEBoot_efi_load_file2 { VasEBoot_efi_status_t (__VasEBoot_efi_api *load_file)(struct VasEBoot_efi_load_file2 *this, VasEBoot_efi_device_path_t *file_path, VasEBoot_efi_boolean_t boot_policy, VasEBoot_efi_uintn_t *buffer_size, void *buffer); }; typedef struct VasEBoot_efi_load_file2 VasEBoot_efi_load_file2_t; struct initrd_media_device_path { VasEBoot_efi_vendor_media_device_path_t vendor; VasEBoot_efi_device_path_t end; } VAS_EBOOT_PACKED; typedef struct initrd_media_device_path initrd_media_device_path_t; struct VasEBoot_efi_memory_attribute_protocol { VasEBoot_efi_status_t (__VasEBoot_efi_api *get_memory_attributes) ( struct VasEBoot_efi_memory_attribute_protocol *this, VasEBoot_efi_physical_address_t base_address, VasEBoot_efi_uint64_t length, VasEBoot_efi_uint64_t *attributes); VasEBoot_efi_status_t (__VasEBoot_efi_api *set_memory_attributes) ( struct VasEBoot_efi_memory_attribute_protocol *this, VasEBoot_efi_physical_address_t base_address, VasEBoot_efi_uint64_t length, VasEBoot_efi_uint64_t attributes); VasEBoot_efi_status_t (__VasEBoot_efi_api *clear_memory_attributes) ( struct VasEBoot_efi_memory_attribute_protocol *this, VasEBoot_efi_physical_address_t base_address, VasEBoot_efi_uint64_t length, VasEBoot_efi_uint64_t attributes); }; typedef struct VasEBoot_efi_memory_attribute_protocol VasEBoot_efi_memory_attribute_protocol_t; #endif /* ! VAS_EBOOT_EFI_API_HEADER */