]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
efi_loader: correct logging StartImage()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 17 Jan 2025 00:09:51 +0000 (01:09 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sun, 26 Jan 2025 10:06:56 +0000 (11:06 +0100)
When logging running an image, e.g. `bootefi hello` the indent is not
correctly reset.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
include/efi_loader.h
lib/efi_loader/efi_boottime.c

index 0d858c1e12eb55b8e4b1a6d30a1a3f3a8631dfd5..5bf271afaad96d6de17c32b362502652666f810a 100644 (file)
@@ -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:
  */
index 723a9b586910791044ee9c5fcab8116e15f99135..db544382137a5276665490d708e748380fe30ac7 100644 (file)
@@ -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);
        }