efi/libstub: Rename efi_call_early/_runtime macros to be more intuitive
The macros efi_call_early and efi_call_runtime are used to call EFI boot services and runtime services, respectively. However, the naming is confusing, given that the early vs runtime distinction may suggest that these are used for calling the same set of services either early or late (== at runtime), while in reality, the sets of services they can be used with are completely disjoint, and efi_call_runtime is also only usable in 'early' code. So do a global sweep to replace all occurrences with efi_bs_call or efi_rt_call, respectively, where BS and RT match the idiom used by the UEFI spec to refer to boot time or runtime services. While at it, use 'func' as the macro parameter name for the function pointers, which is less likely to collide and cause weird build errors. 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-24-ardb@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:

committed by
Ingo Molnar

parent
99ea8b1db2
commit
966291f634
@@ -227,17 +227,17 @@ static inline bool efi_is_native(void)
|
||||
? inst->func(inst, ##__VA_ARGS__) \
|
||||
: efi64_thunk(inst->mixed_mode.func, inst, ##__VA_ARGS__))
|
||||
|
||||
#define efi_call_early(f, ...) \
|
||||
#define efi_bs_call(func, ...) \
|
||||
(efi_is_native() \
|
||||
? efi_system_table()->boottime->f(__VA_ARGS__) \
|
||||
? efi_system_table()->boottime->func(__VA_ARGS__) \
|
||||
: efi64_thunk(efi_table_attr(efi_system_table(), \
|
||||
boottime)->mixed_mode.f, __VA_ARGS__))
|
||||
boottime)->mixed_mode.func, __VA_ARGS__))
|
||||
|
||||
#define efi_call_runtime(f, ...) \
|
||||
#define efi_rt_call(func, ...) \
|
||||
(efi_is_native() \
|
||||
? efi_system_table()->runtime->f(__VA_ARGS__) \
|
||||
? efi_system_table()->runtime->func(__VA_ARGS__) \
|
||||
: efi64_thunk(efi_table_attr(efi_system_table(), \
|
||||
runtime)->mixed_mode.f, __VA_ARGS__))
|
||||
runtime)->mixed_mode.func, __VA_ARGS__))
|
||||
|
||||
extern bool efi_reboot_required(void);
|
||||
extern bool efi_is_table_address(unsigned long phys_addr);
|
||||
|
Reference in New Issue
Block a user