summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2021-05-20 13:23:58 +0200
committerTom Rini <trini@konsulko.com>2021-05-24 14:21:30 -0400
commit15f537ccf96f891ee46c0d2d2b5d2021b0de2559 (patch)
treedecfebc156d58a0b8802701902c8eab35ca459ba /include
parent82836973115171d1d8ff5fa874b075672ac08f58 (diff)
downloadu-boot-15f537ccf96f891ee46c0d2d2b5d2021b0de2559.tar.gz
u-boot-15f537ccf96f891ee46c0d2d2b5d2021b0de2559.tar.xz
u-boot-15f537ccf96f891ee46c0d2d2b5d2021b0de2559.zip
efi_loader: add macro for const EFI runtime data
Add macro __efi_runtime_rodata, for const variables with similar purpose as those using __efi_runtime_data. Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'include')
-rw-r--r--include/efi_loader.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/efi_loader.h b/include/efi_loader.h
index cfd68e329c..522696d635 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -695,6 +695,22 @@ ssize_t efi_dp_check_length(const struct efi_device_path *dp,
#define __efi_runtime_data __section(".data.efi_runtime")
/**
+ * __efi_runtime_rodata - declares a read-only variable for EFI runtime section
+ *
+ * This macro indicates that a variable is read-only (const) and should go into
+ * the EFI runtime section, and thus still be available when the OS is running.
+ *
+ * Only use on variables also declared const.
+ *
+ * Example:
+ *
+ * ::
+ *
+ * static const __efi_runtime_rodata my_const_table[] = { 1, 2, 3 };
+ */
+#define __efi_runtime_rodata __section(".rodata.efi_runtime")
+
+/**
* __efi_runtime - declares a function for EFI runtime section
*
* This macro indicates that a function should go into the EFI runtime section,
@@ -911,6 +927,7 @@ efi_status_t efi_launch_capsules(void);
/* Without CONFIG_EFI_LOADER we don't have a runtime section, stub it out */
#define __efi_runtime_data
+#define __efi_runtime_rodata
#define __efi_runtime
static inline efi_status_t efi_add_runtime_mmio(void *mmio_ptr, u64 len)
{