OSDN Git Service

efi/libstub/x86: Use const attribute for efi_is_64bit()
authorArd Biesheuvel <ardb@kernel.org>
Mon, 13 Jan 2020 17:22:33 +0000 (18:22 +0100)
committerIngo Molnar <mingo@kernel.org>
Mon, 20 Jan 2020 07:13:00 +0000 (08:13 +0100)
commit796eb8d26a57f917bf22d781666aeab491f5c4f1
tree680ccf6ddb5f9298be52bb13f399fa4415edfbbc
parenta786810cc864e31237a755b933e8872ba3e118bc
efi/libstub/x86: Use const attribute for efi_is_64bit()

Reshuffle the x86 stub code a bit so that we can tag the efi_is_64bit()
function with the 'const' attribute, which permits the compiler to
optimize away any redundant calls. Since we have two different entry
points for 32 and 64 bit firmware in the startup code, this also
simplifies the C code since we'll enter it with the efi_is64 variable
already set.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200113172245.27925-2-ardb@kernel.org
arch/x86/boot/compressed/eboot.c
arch/x86/boot/compressed/head_64.S
arch/x86/include/asm/efi.h