summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_bootbin.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2025-01-23 15:07:20 -0700
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2025-01-26 11:06:57 +0100
commita70759898a0ee9750d418da78ff0ebcd432e9bb5 (patch)
tree57add1a4fd188053f36f57b1fba108c34e1c741e /lib/efi_loader/efi_bootbin.c
parent7a713ab1c63fd5efb1f71caf6678166f9a7447be (diff)
efi_loader: Update efi_run_image() to accept image and device path
Provide these globals as parameters to this function, on the way to making it possible to start an image without relying on the globals. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib/efi_loader/efi_bootbin.c')
-rw-r--r--lib/efi_loader/efi_bootbin.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/efi_loader/efi_bootbin.c b/lib/efi_loader/efi_bootbin.c
index 428991df88f..71591dd54b9 100644
--- a/lib/efi_loader/efi_bootbin.c
+++ b/lib/efi_loader/efi_bootbin.c
@@ -157,9 +157,13 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path,
*
* @source_buffer: memory address of the UEFI image
* @source_size: size of the UEFI image
+ * @dp_dev: EFI device-path
+ * @dp_img: EFI image-path
* Return: status code
*/
-static efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size)
+static efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size,
+ struct efi_device_path *dp_dev,
+ struct efi_device_path *dp_img)
{
efi_handle_t mem_handle = NULL, handle;
struct efi_device_path *file_path = NULL;
@@ -167,7 +171,7 @@ static efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size)
efi_status_t ret;
u16 *load_options;
- if (!bootefi_device_path || !bootefi_image_path) {
+ if (!dp_img || !dp_img) {
log_debug("Not loaded from disk\n");
/*
* Special case for efi payload not loaded from disk,
@@ -188,9 +192,8 @@ static efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size)
goto out;
msg_path = file_path;
} else {
- file_path = efi_dp_concat(bootefi_device_path,
- bootefi_image_path, 0);
- msg_path = bootefi_image_path;
+ file_path = efi_dp_concat(dp_img, dp_img, 0);
+ msg_path = dp_img;
log_debug("Loaded from disk\n");
}
@@ -252,5 +255,6 @@ 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);
+ return efi_run_image(image, size, bootefi_device_path,
+ bootefi_image_path);
}