[PATCH u-boot v1.1 14.1/39] efi_loader: add macro for const EFI runtime data

Heinrich Schuchardt xypron.glpk at gmx.de
Mon Mar 8 08:36:02 CET 2021


On 3/8/21 8:01 AM, Marek Behún wrote:
> 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 at nic.cz>
> ---
>   include/efi_loader.h | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/include/efi_loader.h b/include/efi_loader.h
> index a8281b3c95..b1e5d2e13e 100644
> --- a/include/efi_loader.h
> +++ b/include/efi_loader.h
> @@ -671,6 +671,7 @@ ssize_t efi_dp_check_length(const struct efi_device_path *dp,
>    * section and thus still be available when the OS is running
>    */
>   #define __efi_runtime_data __section(".data.efi_runtime")
> +#define __efi_runtime_rodata __section(".rodata.efi_runtime")

Please, add a Sphinx style comment describing what the attribute is to
be used for.

It is unclear for me if the relevant property of crc_table[] is the
const attribute or if it is that the array is initialized.

Can you please, check this by LTO compiling without initializing
crc_table[] and in a separate run without const so that we gain a clear
understanding.

Best regards

Heinrich

>   #define __efi_runtime __section(".text.efi_runtime")
>
>   /* Indicate supported runtime services */
> @@ -870,6 +871,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)
>   {
>



More information about the U-Boot mailing list