aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/efi/libstub/efistub.h
diff options
context:
space:
mode:
authorArvind Sankar <nivedita@alum.mit.edu>2020-04-30 14:28:34 -0400
committerArd Biesheuvel <ardb@kernel.org>2020-05-01 09:40:02 +0200
commiteed4e0193ee7b00213791f7732bce0fc0c54f3b3 (patch)
treea2a34483e9df5bbb9e372bdd64b0d58ea681055e /drivers/firmware/efi/libstub/efistub.h
parentefi/x86: Use correct size for boot_params (diff)
downloadlinux-dev-eed4e0193ee7b00213791f7732bce0fc0c54f3b3.tar.xz
linux-dev-eed4e0193ee7b00213791f7732bce0fc0c54f3b3.zip
efi/libstub: Add a helper function to split 64-bit values
In several places 64-bit values need to be split up into two 32-bit fields, in order to be backward-compatible with the old 32-bit ABIs. Instead of open-coding this, add a helper function to set a 64-bit value as two 32-bit fields. Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu> Link: https://lore.kernel.org/r/20200430182843.2510180-3-nivedita@alum.mit.edu 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.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h
index 5ff63230a1f1..e8aa70ba08d5 100644
--- a/drivers/firmware/efi/libstub/efistub.h
+++ b/drivers/firmware/efi/libstub/efistub.h
@@ -87,6 +87,13 @@ extern const efi_system_table_t *efi_system_table;
((handle = efi_get_handle_at((array), i)) || true); \
i++)
+static inline
+void efi_set_u64_split(u64 data, u32 *lo, u32 *hi)
+{
+ *lo = lower_32_bits(data);
+ *hi = upper_32_bits(data);
+}
+
/*
* Allocation types for calls to boottime->allocate_pages.
*/