efi: libstub: Permit mixed mode return types other than efi_status_t
authorArd Biesheuvel <ardb@kernel.org>
Mon, 26 Sep 2022 19:14:23 +0000 (21:14 +0200)
committerArd Biesheuvel <ardb@kernel.org>
Fri, 18 Nov 2022 08:14:08 +0000 (09:14 +0100)
commita61962d8e7d3f11f68cbaebd477fbd8e1f7b9f6d
tree5d7ba2dd59bde17a475e7688f5969f472b9f316f
parent70912985545adc81716164271401c9ffb0acdd0f
efi: libstub: Permit mixed mode return types other than efi_status_t

Rework the EFI stub macro wrappers around protocol method calls and
other indirect calls in order to allow return types other than
efi_status_t. This means the widening should be conditional on whether
or not the return type is efi_status_t, and should be omitted otherwise.

Also, switch to _Generic() to implement the type based compile time
conditionals, which is more concise, and distinguishes between
efi_status_t and u64 properly.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
arch/x86/boot/compressed/efi_thunk_64.S
arch/x86/include/asm/efi.h
drivers/firmware/efi/libstub/efistub.h