diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2025-01-17 01:09:51 +0100 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2025-01-26 11:06:56 +0100 |
commit | 9f00d38ce7600a162e37156ee6d5a050857a3a9f (patch) | |
tree | 8524f62ab3d9736d9c79aadff0bb2383952bd40f | |
parent | 292278d6828e6c8c6ae11bc8658586d1acc411d4 (diff) |
efi_loader: correct logging StartImage()
When logging running an image, e.g. `bootefi hello` the indent is not
correctly reset.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
-rw-r--r-- | include/efi_loader.h | 12 | ||||
-rw-r--r-- | lib/efi_loader/efi_boottime.c | 7 |
2 files changed, 15 insertions, 4 deletions
diff --git a/include/efi_loader.h b/include/efi_loader.h index 0d858c1e12e..5bf271afaad 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -245,6 +245,18 @@ const char *__efi_nesting_dec(void); _r; \ }) +/** + * define EFI_RETURN() - return from EFI_CALL in efi_start_image() + * + * @ret: status code + */ +#define EFI_RETURN(ret) ({ \ + typeof(ret) _r = ret; \ + assert(__efi_entry_check()); \ + debug("%sEFI: %lu returned by started image", __efi_nesting_dec(), \ + (unsigned long)((uintptr_t)_r & ~EFI_ERROR_MASK)); \ +}) + /* * Call void UEFI function from u-boot: */ diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 723a9b58691..db544382137 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -3256,11 +3256,10 @@ efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle, * To get ready to call EFI_EXIT below we have to execute the * missed out steps of EFI_CALL. */ - assert(__efi_entry_check()); - EFI_PRINT("%lu returned by started image\n", - (unsigned long)((uintptr_t)exit_status & - ~EFI_ERROR_MASK)); + EFI_RETURN(exit_status); + current_image = parent_image; + return EFI_EXIT(exit_status); } |