]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
loader/efi/linux: Print EFI status as hex number instead of uint
authorGlenn Washburn <development@efficientek.com>
Wed, 28 Jun 2023 06:19:48 +0000 (01:19 -0500)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 3 Jul 2023 11:29:28 +0000 (13:29 +0200)
EFI status codes are of different classes depending on the first byte and
all error status codes defined in appendix D of the main spec start from
1 and have the high bit set. When printing as a uint, the decimal is a very
large number that needs have the high bit cleared get the spec error code.
This can be easily visually done by a human if the number is printed as hex.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/loader/efi/linux.c

index c1eef7c9865f5d0dc72d561fb9bf5a3b0c4b98ea..3a910b5650072c00e7f5d9e9297dd158a9cf4ab5 100644 (file)
@@ -234,7 +234,7 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args)
   status = b->start_image (image_handle, 0, NULL);
 
   /* When successful, not reached */
-  grub_error (GRUB_ERR_BAD_OS, "start_image() returned %" PRIuGRUB_EFI_UINTN_T, status);
+  grub_error (GRUB_ERR_BAD_OS, "start_image() returned 0x%" PRIxGRUB_EFI_UINTN_T, status);
   grub_efi_free_pages ((grub_addr_t) loaded_image->load_options,
                       GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size));
 unload: