summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/efi.h
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2019-12-24 18:10:17 +0300
committerIngo Molnar <mingo@kernel.org>2019-12-25 12:49:22 +0300
commitc3710de5065d63f8b16d160a118cc50ae09050b4 (patch)
tree023f9c6679ccc77a2ff56948b3319aaf0f3fbba2 /arch/x86/include/asm/efi.h
parentdc29da14ed94a005ed2a590ec86aa8a572fea4a9 (diff)
downloadlinux-c3710de5065d63f8b16d160a118cc50ae09050b4.tar.xz
efi/libstub/x86: Drop __efi_early() export and efi_config struct
The various pointers we stash in the efi_config struct which we retrieve using __efi_early() are simply copies of the ones in the EFI system table, which we have started accessing directly in the previous patch. So drop all the __efi_early() related plumbing, as well as all the assembly code dealing with efi_config, which allows us to move the PE/COFF entry point to C code as well. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Cc: Arvind Sankar <nivedita@alum.mit.edu> Cc: Borislav Petkov <bp@alien8.de> Cc: James Morse <james.morse@arm.com> Cc: Matt Fleming <matt@codeblueprint.co.uk> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-efi@vger.kernel.org Link: https://lkml.kernel.org/r/20191224151025.32482-18-ardb@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/include/asm/efi.h')
-rw-r--r--arch/x86/include/asm/efi.h38
1 files changed, 9 insertions, 29 deletions
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index 001905daa110..1817f350618e 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -200,32 +200,14 @@ static inline efi_status_t efi_thunk_set_virtual_address_map(
/* arch specific definitions used by the stub code */
-struct efi_config {
- u64 image_handle;
- u64 table;
- u64 runtime_services;
- u64 boot_services;
- u64 text_output;
- bool is64;
-} __packed;
-
-__pure const struct efi_config *__efi_early(void);
-
-static inline bool efi_is_64bit(void)
-{
- if (!IS_ENABLED(CONFIG_X86_64))
- return false;
-
- if (!IS_ENABLED(CONFIG_EFI_MIXED))
- return true;
-
- return __efi_early()->is64;
-}
+__pure bool efi_is_64bit(void);
static inline bool efi_is_native(void)
{
if (!IS_ENABLED(CONFIG_X86_64))
return true;
+ if (!IS_ENABLED(CONFIG_EFI_MIXED))
+ return true;
return efi_is_64bit();
}
@@ -252,18 +234,16 @@ static inline bool efi_is_native(void)
#define efi_call_early(f, ...) \
(efi_is_native() \
- ? ((efi_boot_services_t *)(unsigned long) \
- __efi_early()->boot_services)->f(__VA_ARGS__) \
- : efi64_thunk(((efi_boot_services_t *)(unsigned long) \
- __efi_early()->boot_services)->mixed_mode.f, \
+ ? efi_system_table()->boottime->f(__VA_ARGS__) \
+ : efi64_thunk(efi_table_attr(efi_boot_services, \
+ boottime, efi_system_table())->mixed_mode.f, \
__VA_ARGS__))
#define efi_call_runtime(f, ...) \
(efi_is_native() \
- ? ((efi_runtime_services_t *)(unsigned long) \
- __efi_early()->runtime_services)->f(__VA_ARGS__)\
- : efi64_thunk(((efi_runtime_services_t *)(unsigned long)\
- __efi_early()->runtime_services)->mixed_mode.f, \
+ ? efi_system_table()->runtime->f(__VA_ARGS__) \
+ : efi64_thunk(efi_table_attr(efi_runtime_services, \
+ runtime, efi_system_table())->mixed_mode.f, \
__VA_ARGS__))
extern bool efi_reboot_required(void);