diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2023-07-02 18:40:39 +0200 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2023-08-22 10:39:26 +0200 |
commit | e38abdab441c0dcfb8f28dd0daf1dfa44b494492 (patch) | |
tree | 215b5fec7165e513387158b103b701ea4d98680b /drivers | |
parent | efi/runtime-wrapper: Move workqueue manipulation out of line (diff) | |
download | linux-e38abdab441c0dcfb8f28dd0daf1dfa44b494492.tar.xz linux-e38abdab441c0dcfb8f28dd0daf1dfa44b494492.zip |
efi/runtime-wrappers: Remove duplicated macro for service returning void
__efi_call_virt() exists as an alternative for efi_call_virt() for the
sole reason that ResetSystem() returns void, and so we cannot use a call
to it in the RHS of an assignment.
Given that there is only a single user, let's drop the macro, and expand
it into the caller. That way, the remaining macro can be tightened
somewhat in terms of type safety too.
Note that the use of typeof() on the runtime service invocation does not
result in an actual call being made, but it does require a few pointer
types to be fixed up and converted into the proper function pointer
prototypes.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/prmt.c | 2 | ||||
-rw-r--r-- | drivers/firmware/efi/runtime-wrappers.c | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c index 3d4c4620f9f9..71b9adaaf33b 100644 --- a/drivers/acpi/prmt.c +++ b/drivers/acpi/prmt.c @@ -53,7 +53,7 @@ static LIST_HEAD(prm_module_list); struct prm_handler_info { guid_t guid; - void *handler_addr; + efi_status_t (__efiapi *handler_addr)(u64, void *); u64 static_data_buffer_addr; u64 acpi_param_buffer_addr; diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c index ee5c9a3e5060..c5e0c73cc000 100644 --- a/drivers/firmware/efi/runtime-wrappers.c +++ b/drivers/firmware/efi/runtime-wrappers.c @@ -41,8 +41,6 @@ */ #define efi_call_virt(f, args...) \ efi_call_virt_pointer(efi.runtime, f, args) -#define __efi_call_virt(f, args...) \ - __efi_call_virt_pointer(efi.runtime, f, args) union efi_rts_args { struct { @@ -491,8 +489,13 @@ static void virt_efi_reset_system(int reset_type, "could not get exclusive access to the firmware\n"); return; } + + arch_efi_call_virt_setup(); efi_rts_work.efi_rts_id = EFI_RESET_SYSTEM; - __efi_call_virt(reset_system, reset_type, status, data_size, data); + arch_efi_call_virt(efi.runtime, reset_system, reset_type, status, + data_size, data); + arch_efi_call_virt_teardown(); + up(&efi_runtime_lock); } |