diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2023-07-02 15:15:18 +0200 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2023-08-21 17:59:54 +0200 |
commit | c7c7bce093c883739d6735d68604055131acfbea (patch) | |
tree | c093b755ec57bedb8eb63f48fddb3461a1f71bf4 /include/linux/efi.h | |
parent | d8ea2ffd017d0608635c0ec7bc9ba39edbbd2482 (diff) |
efi/runtime-wrappers: Use type safe encapsulation of call arguments
The current code that marshalls the EFI runtime call arguments to hand
them off to a async helper does so in a type unsafe and slightly messy
manner - everything is cast to void* except for some integral types that
are passed by reference and dereferenced on the receiver end.
Let's clean this up a bit, and record the arguments of each runtime
service invocation exactly as they are issued, in a manner that permits
the compiler to check the types of the arguments at both ends.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'include/linux/efi.h')
-rw-r--r-- | include/linux/efi.h | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h index e9004358f7bd..9d09dba116ce 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -1264,23 +1264,21 @@ enum efi_rts_ids { EFI_QUERY_CAPSULE_CAPS, }; +union efi_rts_args; + /* * efi_runtime_work: Details of EFI Runtime Service work - * @arg<1-5>: EFI Runtime Service function arguments + * @args: Pointer to union describing the arguments * @status: Status of executing EFI Runtime Service * @efi_rts_id: EFI Runtime Service function identifier * @efi_rts_comp: Struct used for handling completions */ struct efi_runtime_work { - void *arg1; - void *arg2; - void *arg3; - void *arg4; - void *arg5; - efi_status_t status; - struct work_struct work; - enum efi_rts_ids efi_rts_id; - struct completion efi_rts_comp; + union efi_rts_args *args; + efi_status_t status; + struct work_struct work; + enum efi_rts_ids efi_rts_id; + struct completion efi_rts_comp; }; extern struct efi_runtime_work efi_rts_work; |