From b9f42821af4dfc0988c39cb4d0ae28118da2c312 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 23 Jan 2025 15:07:21 -0700 Subject: [PATCH] efi_loader: Add a version of efi_binary_run() with more parameters 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 Reviewed-by: Ilias Apalodimas --- 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 71591dd54b9..789da8bcda0 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_dp() - run loaded UEFI image * * @image: memory address of the UEFI image * @size: size of the UEFI image * @fdt: device-tree + * @dp_dev: EFI device-path + * @dp_img: 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, size_t size, void *fdt) +efi_status_t efi_binary_run_dp(void *image, size_t size, void *fdt, + struct efi_device_path *dp_dev, + struct efi_device_path *dp_img) { efi_status_t ret; @@ -255,6 +259,23 @@ efi_status_t efi_binary_run(void *image, size_t size, void *fdt) if (ret != EFI_SUCCESS) return ret; - return efi_run_image(image, size, bootefi_device_path, - bootefi_image_path); + return efi_run_image(image, size, dp_dev, dp_img); +} + +/** + * 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_dp(image, size, fdt, bootefi_device_path, + bootefi_image_path); } -- 2.39.5