diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2020-04-23 13:44:50 +0200 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2020-04-23 20:15:06 +0200 |
commit | 22090f84bc3f8081e0ec180ccaedc85820085376 (patch) | |
tree | a36be4ff759c615c3bc87f5de92dcce4789f4764 /drivers/firmware/efi/libstub/efistub.h | |
parent | cf6b83664895a5c7e97710df282e220bd047f0f5 (diff) | |
download | lwn-22090f84bc3f8081e0ec180ccaedc85820085376.tar.gz lwn-22090f84bc3f8081e0ec180ccaedc85820085376.zip |
efi/libstub: unify EFI call wrappers for non-x86
We have wrappers around EFI calls so that x86 can define special
versions for mixed mode, while all other architectures can use the
same simple definition that just issues the call directly.
In preparation for the arrival of yet another architecture that doesn't
need anything special here (RISC-V), let's move the default definition
into a shared header.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/efistub.h')
-rw-r--r-- | drivers/firmware/efi/libstub/efistub.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h index 7517683b31e9..d9ad8582dbea 100644 --- a/drivers/firmware/efi/libstub/efistub.h +++ b/drivers/firmware/efi/libstub/efistub.h @@ -39,6 +39,22 @@ extern bool __pure novamap(void); extern __pure efi_system_table_t *efi_system_table(void); +#ifndef efi_bs_call +#define efi_bs_call(func, ...) efi_system_table()->boottime->func(__VA_ARGS__) +#endif +#ifndef efi_rt_call +#define efi_rt_call(func, ...) efi_system_table()->runtime->func(__VA_ARGS__) +#endif +#ifndef efi_is_native +#define efi_is_native() (true) +#endif +#ifndef efi_table_attr +#define efi_table_attr(inst, attr) (inst->attr) +#endif +#ifndef efi_call_proto +#define efi_call_proto(inst, func, ...) inst->func(inst, ##__VA_ARGS__) +#endif + #define pr_efi(msg) do { \ if (!is_quiet()) efi_printk("EFI stub: "msg); \ } while (0) |