efi: boot: Correct calculation of load address in app

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: 207bf34de7 ("boot: efi: Use an event to relocate the OS")
This commit is contained in:
Simon Glass
2025-08-12 11:31:25 -06:00
parent 4bccd4ea31
commit ea30e7c267
2 changed files with 4 additions and 3 deletions

View File

@@ -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;
}