[PATCH v4 4/7] efi_loader: Add a version of efi_binary_run() with more parameters
Heinrich Schuchardt
xypron.glpk at gmx.de
Fri Jan 17 20:55:26 CET 2025
On 1/9/25 16:02, Simon Glass wrote:
> This uses a few global variables at present. With the bootflow we have
> the required parameters, so add a function which accepts these. Update
> the existing function to call the new one with the globals.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> Reviewed-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
> ---
>
> (no changes since v3)
>
> Changes in v3:
> - Rename efi_binary_run_() to _efi_binary_run()
>
> lib/efi_loader/efi_bootbin.c | 29 +++++++++++++++++++++++++----
> 1 file changed, 25 insertions(+), 4 deletions(-)
>
> diff --git a/lib/efi_loader/efi_bootbin.c b/lib/efi_loader/efi_bootbin.c
> index e3ac27b03fa..6cbc5fa050c 100644
> --- a/lib/efi_loader/efi_bootbin.c
> +++ b/lib/efi_loader/efi_bootbin.c
> @@ -228,18 +228,22 @@ out:
> }
>
> /**
> - * efi_binary_run() - run loaded UEFI image
> + * efi_binary_run_() - run loaded UEFI image
> *
> * @image_ptr: memory address of the UEFI image
> * @size: size of the UEFI image
> * @fdt: device-tree
> + * @device: EFI device-path
> + * @image: EFI image-path
> *
> * Execute an EFI binary image loaded at @image.
> * @size may be zero if the binary is loaded with U-Boot load command.
> *
> * Return: status code
> */
> -efi_status_t efi_binary_run(void *image_ptr, size_t size, void *fdt)
> +efi_status_t _efi_binary_run(void *image_ptr, size_t size, void *fdt,
Using functions which differ just be an underscore are confusing.
efi_binary_run_dp() might better express that here device_paths are needed.
Best regards
Heinrich
> + struct efi_device_path *device,
> + struct efi_device_path *image)
> {
> efi_status_t ret;
>
> @@ -255,6 +259,23 @@ efi_status_t efi_binary_run(void *image_ptr, size_t size, void *fdt)
> if (ret != EFI_SUCCESS)
> return ret;
>
> - return efi_run_image(image_ptr, size, bootefi_device_path,
> - bootefi_image_path);
> + return efi_run_image(image_ptr, size, device, image);
> +}
> +
> +/**
> + * efi_binary_run() - run loaded UEFI image
> + *
> + * @image: memory address of the UEFI image
> + * @size: size of the UEFI image
> + * @fdt: device-tree
> + *
> + * Execute an EFI binary image loaded at @image.
> + * @size may be zero if the binary is loaded with U-Boot load command.
> + *
> + * Return: status code
> + */
> +efi_status_t efi_binary_run(void *image, size_t size, void *fdt)
> +{
> + return _efi_binary_run(image, size, fdt, bootefi_device_path,
> + bootefi_image_path);
> }
More information about the U-Boot
mailing list