diff options
Diffstat (limited to 'arch/x86/include/asm/efi.h')
-rw-r--r-- | arch/x86/include/asm/efi.h | 46 |
1 files changed, 41 insertions, 5 deletions
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 3b978c472d08..0869434eaf72 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h | |||
@@ -19,9 +19,11 @@ | |||
19 | */ | 19 | */ |
20 | #define EFI_OLD_MEMMAP EFI_ARCH_1 | 20 | #define EFI_OLD_MEMMAP EFI_ARCH_1 |
21 | 21 | ||
22 | #define EFI32_LOADER_SIGNATURE "EL32" | ||
23 | #define EFI64_LOADER_SIGNATURE "EL64" | ||
24 | |||
22 | #ifdef CONFIG_X86_32 | 25 | #ifdef CONFIG_X86_32 |
23 | 26 | ||
24 | #define EFI_LOADER_SIGNATURE "EL32" | ||
25 | 27 | ||
26 | extern unsigned long asmlinkage efi_call_phys(void *, ...); | 28 | extern unsigned long asmlinkage efi_call_phys(void *, ...); |
27 | 29 | ||
@@ -57,8 +59,6 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...); | |||
57 | 59 | ||
58 | #else /* !CONFIG_X86_32 */ | 60 | #else /* !CONFIG_X86_32 */ |
59 | 61 | ||
60 | #define EFI_LOADER_SIGNATURE "EL64" | ||
61 | |||
62 | extern u64 efi_call0(void *fp); | 62 | extern u64 efi_call0(void *fp); |
63 | extern u64 efi_call1(void *fp, u64 arg1); | 63 | extern u64 efi_call1(void *fp, u64 arg1); |
64 | extern u64 efi_call2(void *fp, u64 arg1, u64 arg2); | 64 | extern u64 efi_call2(void *fp, u64 arg1, u64 arg2); |
@@ -119,7 +119,6 @@ extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size, | |||
119 | #endif /* CONFIG_X86_32 */ | 119 | #endif /* CONFIG_X86_32 */ |
120 | 120 | ||
121 | extern int add_efi_memmap; | 121 | extern int add_efi_memmap; |
122 | extern unsigned long x86_efi_facility; | ||
123 | extern struct efi_scratch efi_scratch; | 122 | extern struct efi_scratch efi_scratch; |
124 | extern void efi_set_executable(efi_memory_desc_t *md, bool executable); | 123 | extern void efi_set_executable(efi_memory_desc_t *md, bool executable); |
125 | extern int efi_memblock_x86_reserve_range(void); | 124 | extern int efi_memblock_x86_reserve_range(void); |
@@ -130,8 +129,13 @@ extern void efi_memory_uc(u64 addr, unsigned long size); | |||
130 | extern void __init efi_map_region(efi_memory_desc_t *md); | 129 | extern void __init efi_map_region(efi_memory_desc_t *md); |
131 | extern void __init efi_map_region_fixed(efi_memory_desc_t *md); | 130 | extern void __init efi_map_region_fixed(efi_memory_desc_t *md); |
132 | extern void efi_sync_low_kernel_mappings(void); | 131 | extern void efi_sync_low_kernel_mappings(void); |
133 | extern void efi_setup_page_tables(void); | 132 | extern int efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages); |
133 | extern void efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages); | ||
134 | extern void __init old_map_region(efi_memory_desc_t *md); | 134 | extern void __init old_map_region(efi_memory_desc_t *md); |
135 | extern void __init runtime_code_page_mkexec(void); | ||
136 | extern void __init efi_runtime_mkexec(void); | ||
137 | extern void __init efi_dump_pagetable(void); | ||
138 | extern void __init efi_apply_memmap_quirks(void); | ||
135 | 139 | ||
136 | struct efi_setup_data { | 140 | struct efi_setup_data { |
137 | u64 fw_vendor; | 141 | u64 fw_vendor; |
@@ -150,8 +154,40 @@ static inline bool efi_is_native(void) | |||
150 | return IS_ENABLED(CONFIG_X86_64) == efi_enabled(EFI_64BIT); | 154 | return IS_ENABLED(CONFIG_X86_64) == efi_enabled(EFI_64BIT); |
151 | } | 155 | } |
152 | 156 | ||
157 | static inline bool efi_runtime_supported(void) | ||
158 | { | ||
159 | if (efi_is_native()) | ||
160 | return true; | ||
161 | |||
162 | if (IS_ENABLED(CONFIG_EFI_MIXED) && !efi_enabled(EFI_OLD_MEMMAP)) | ||
163 | return true; | ||
164 | |||
165 | return false; | ||
166 | } | ||
167 | |||
153 | extern struct console early_efi_console; | 168 | extern struct console early_efi_console; |
154 | extern void parse_efi_setup(u64 phys_addr, u32 data_len); | 169 | extern void parse_efi_setup(u64 phys_addr, u32 data_len); |
170 | |||
171 | #ifdef CONFIG_EFI_MIXED | ||
172 | extern void efi_thunk_runtime_setup(void); | ||
173 | extern efi_status_t efi_thunk_set_virtual_address_map( | ||
174 | void *phys_set_virtual_address_map, | ||
175 | unsigned long memory_map_size, | ||
176 | unsigned long descriptor_size, | ||
177 | u32 descriptor_version, | ||
178 | efi_memory_desc_t *virtual_map); | ||
179 | #else | ||
180 | static inline void efi_thunk_runtime_setup(void) {} | ||
181 | static inline efi_status_t efi_thunk_set_virtual_address_map( | ||
182 | void *phys_set_virtual_address_map, | ||
183 | unsigned long memory_map_size, | ||
184 | unsigned long descriptor_size, | ||
185 | u32 descriptor_version, | ||
186 | efi_memory_desc_t *virtual_map) | ||
187 | { | ||
188 | return EFI_SUCCESS; | ||
189 | } | ||
190 | #endif /* CONFIG_EFI_MIXED */ | ||
155 | #else | 191 | #else |
156 | /* | 192 | /* |
157 | * IF EFI is not configured, have the EFI calls return -ENOSYS. | 193 | * IF EFI is not configured, have the EFI calls return -ENOSYS. |