diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2020-04-16 18:38:06 +0200 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2020-04-24 14:52:16 +0200 |
commit | ccc27ae77494252965aedca68588e7457829cfad (patch) | |
tree | e289300246a3b635e85a0f81aae340d1c6ca6fc2 /drivers/firmware/efi/libstub/efistub.h | |
parent | 544393707f3ca4f185ea1e41cc3206d1526c99cf (diff) | |
download | lwn-ccc27ae77494252965aedca68588e7457829cfad.tar.gz lwn-ccc27ae77494252965aedca68588e7457829cfad.zip |
efi/libstub: Drop __pure getter for efi_system_table
The practice of using __pure getter functions to access global
variables in the EFI stub dates back to the time when we had to
carefully prevent GOT entries from being emitted, because we
could not rely on the toolchain to do this for us.
Today, we use the hidden visibility pragma for all EFI stub source
files, which now all live in the same subdirectory, and we apply a
sanity check on the objects, so we can get rid of these getter
functions and simply refer to global data objects directly.
Start with efi_system_table(), and convert it into a global variable.
While at it, make it a pointer-to-const, because we can.
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 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h index 9a87fff1d4ba..c1481c5abea4 100644 --- a/drivers/firmware/efi/libstub/efistub.h +++ b/drivers/firmware/efi/libstub/efistub.h @@ -31,13 +31,13 @@ extern bool __pure noinitrd(void); extern bool __pure is_quiet(void); extern bool __pure novamap(void); -extern __pure efi_system_table_t *efi_system_table(void); +extern const efi_system_table_t *efi_system_table; #ifndef efi_bs_call -#define efi_bs_call(func, ...) efi_system_table()->boottime->func(__VA_ARGS__) +#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__) +#define efi_rt_call(func, ...) efi_system_table->runtime->func(__VA_ARGS__) #endif #ifndef efi_is_native #define efi_is_native() (true) |