1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef BOOT_COMPRESSED_EFI_H
3 #define BOOT_COMPRESSED_EFI_H
5 #if defined(_LINUX_EFI_H) || defined(_ASM_X86_EFI_H)
6 #error Please do not include kernel proper namespace headers
9 typedef guid_t efi_guid_t __aligned(__alignof__(u32));
11 #define EFI_GUID(a, b, c, d...) (efi_guid_t){ { \
12 (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
13 (b) & 0xff, ((b) >> 8) & 0xff, \
14 (c) & 0xff, ((c) >> 8) & 0xff, d } }
16 #define ACPI_TABLE_GUID EFI_GUID(0xeb9d2d30, 0x2d88, 0x11d3, 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d)
17 #define ACPI_20_TABLE_GUID EFI_GUID(0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81)
18 #define EFI_CC_BLOB_GUID EFI_GUID(0x067b1f5f, 0xcf26, 0x44c5, 0x85, 0x54, 0x93, 0xd7, 0x77, 0x91, 0x2d, 0x42)
20 #define EFI32_LOADER_SIGNATURE "EL32"
21 #define EFI64_LOADER_SIGNATURE "EL64"
24 * Generic EFI table header
34 #define EFI_CONVENTIONAL_MEMORY 7
36 #define EFI_MEMORY_MORE_RELIABLE \
37 ((u64)0x0000000000010000ULL) /* higher reliability */
38 #define EFI_MEMORY_SP ((u64)0x0000000000040000ULL) /* soft reserved */
40 #define EFI_PAGE_SHIFT 12
51 #define efi_early_memdesc_ptr(map, desc_size, n) \
52 (efi_memory_desc_t *)((void *)(map) + ((n) * (desc_size)))
57 } efi_config_table_64_t;
62 } efi_config_table_32_t;
66 u64 fw_vendor; /* physical addr of CHAR16 vendor string */
80 } efi_system_table_64_t;
84 u32 fw_vendor; /* physical addr of CHAR16 vendor string */
96 } efi_system_table_32_t;
98 /* kexec external ABI */
99 struct efi_setup_data {
107 static inline int efi_guidcmp (efi_guid_t left, efi_guid_t right)
109 return memcmp(&left, &right, sizeof (efi_guid_t));
113 bool __pure __efi_soft_reserve_enabled(void);
115 static inline bool __pure efi_soft_reserve_enabled(void)
117 return IS_ENABLED(CONFIG_EFI_SOFT_RESERVE)
118 && __efi_soft_reserve_enabled();
121 static inline bool efi_soft_reserve_enabled(void)
125 #endif /* CONFIG_EFI */
126 #endif /* BOOT_COMPRESSED_EFI_H */