
From: Simon Glass <sjg@chromium.org> The conversion to using an event was not done correctly, with the result that it has no effect. Fix it, by passing in the length and actually using the returned address. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 207bf34de79 ("boot: efi: Use an event to relocate the OS") --- (no changes since v1) boot/bootm.c | 2 ++ lib/efi_client/efi_app.c | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/boot/bootm.c b/boot/bootm.c index 715b78da336..d9bcb748cb1 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -1179,11 +1179,13 @@ int bootm_run_states(struct bootm_info *bmi, int states) struct event_os_load data; data.addr = images->os.load; + data.size = images->os.image_len; log_debug("notify EVT_BOOT_OS_ADDR\n"); ret = event_notify(EVT_BOOT_OS_ADDR, &data, sizeof(data)); if (ret) goto err; + images->os.load = data.addr; } ret = bootm_load_os(bmi, 0); if (ret && ret != BOOTM_ERR_OVERLAP) diff --git a/lib/efi_client/efi_app.c b/lib/efi_client/efi_app.c index ea53c3c1678..37f8e95d481 100644 --- a/lib/efi_client/efi_app.c +++ b/lib/efi_client/efi_app.c @@ -244,7 +244,6 @@ static int efi_sysreset_request(struct udevice *dev, enum sysreset_t type) int board_fixup_os(void *ctx, struct event *evt) { int pages; - ulong load_addr; u64 addr; efi_status_t status; struct efi_priv *priv = efi_get_priv(); @@ -264,8 +263,8 @@ int board_fixup_os(void *ctx, struct event *evt) /* That failed, so try allocating anywhere there's enough room */ status = boot->allocate_pages(EFI_ALLOCATE_ANY_PAGES, EFI_LOADER_DATA, pages, &addr); if (status) { - printf("Failed to alloc %lx bytes at %lx: %lx\n", os_load->size, - load_addr, status); + printf("Failed to alloc %lx bytes: %lx\n", os_load->size, + status); return -EFAULT; } -- 2.43.0