aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/efi.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/efi.h')
-rw-r--r--arch/x86/include/asm/efi.h46
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
26extern unsigned long asmlinkage efi_call_phys(void *, ...); 28extern 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
62extern u64 efi_call0(void *fp); 62extern u64 efi_call0(void *fp);
63extern u64 efi_call1(void *fp, u64 arg1); 63extern u64 efi_call1(void *fp, u64 arg1);
64extern u64 efi_call2(void *fp, u64 arg1, u64 arg2); 64extern 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
121extern int add_efi_memmap; 121extern int add_efi_memmap;
122extern unsigned long x86_efi_facility;
123extern struct efi_scratch efi_scratch; 122extern struct efi_scratch efi_scratch;
124extern void efi_set_executable(efi_memory_desc_t *md, bool executable); 123extern void efi_set_executable(efi_memory_desc_t *md, bool executable);
125extern int efi_memblock_x86_reserve_range(void); 124extern int efi_memblock_x86_reserve_range(void);
@@ -130,8 +129,13 @@ extern void efi_memory_uc(u64 addr, unsigned long size);
130extern void __init efi_map_region(efi_memory_desc_t *md); 129extern void __init efi_map_region(efi_memory_desc_t *md);
131extern void __init efi_map_region_fixed(efi_memory_desc_t *md); 130extern void __init efi_map_region_fixed(efi_memory_desc_t *md);
132extern void efi_sync_low_kernel_mappings(void); 131extern void efi_sync_low_kernel_mappings(void);
133extern void efi_setup_page_tables(void); 132extern int efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages);
133extern void efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages);
134extern void __init old_map_region(efi_memory_desc_t *md); 134extern void __init old_map_region(efi_memory_desc_t *md);
135extern void __init runtime_code_page_mkexec(void);
136extern void __init efi_runtime_mkexec(void);
137extern void __init efi_dump_pagetable(void);
138extern void __init efi_apply_memmap_quirks(void);
135 139
136struct efi_setup_data { 140struct 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
157static 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
153extern struct console early_efi_console; 168extern struct console early_efi_console;
154extern void parse_efi_setup(u64 phys_addr, u32 data_len); 169extern void parse_efi_setup(u64 phys_addr, u32 data_len);
170
171#ifdef CONFIG_EFI_MIXED
172extern void efi_thunk_runtime_setup(void);
173extern 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
180static inline void efi_thunk_runtime_setup(void) {}
181static 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.