Blame SOURCES/0099-Add-PRIxGRUB_EFI_STATUS-and-use-it.patch

8631a2
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
8631a2
From: Peter Jones <pjones@redhat.com>
8631a2
Date: Thu, 1 Jun 2017 10:07:50 -0400
8631a2
Subject: [PATCH] Add PRIxGRUB_EFI_STATUS and use it.
8631a2
8631a2
This avoids syntax checkers getting confused about if it's llx or lx.
8631a2
8631a2
Signed-off-by: Peter Jones <pjones@redhat.com>
8631a2
---
8631a2
 grub-core/loader/efi/chainloader.c | 3 ++-
8631a2
 include/grub/efi/api.h             | 8 ++++++++
8631a2
 2 files changed, 10 insertions(+), 1 deletion(-)
8631a2
8631a2
diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c
8631a2
index 106eb10a362..3630b0cbf2d 100644
8631a2
--- a/grub-core/loader/efi/chainloader.c
8631a2
+++ b/grub-core/loader/efi/chainloader.c
8631a2
@@ -783,7 +783,8 @@ handle_image (void *data, grub_efi_uint32_t datasize)
8631a2
   efi_status = efi_call_2 (entry_point, grub_efi_image_handle,
8631a2
 			   grub_efi_system_table);
8631a2
 
8631a2
-  grub_dprintf ("chain", "entry_point returned %ld\n", efi_status);
8631a2
+  grub_dprintf ("chain", "entry_point returned 0x%"PRIxGRUB_EFI_STATUS"\n",
8631a2
+		efi_status);
8631a2
   grub_memcpy (li, &li_bak, sizeof (grub_efi_loaded_image_t));
8631a2
   efi_status = grub_efi_free_pool (buffer);
8631a2
 
8631a2
diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
8631a2
index 28b6adf7648..e5b521bd9be 100644
8631a2
--- a/include/grub/efi/api.h
8631a2
+++ b/include/grub/efi/api.h
8631a2
@@ -527,6 +527,14 @@ typedef grub_uint8_t grub_efi_char8_t;
8631a2
 typedef grub_uint16_t grub_efi_char16_t;
8631a2
 
8631a2
 typedef grub_efi_intn_t grub_efi_status_t;
8631a2
+/* Make grub_efi_status_t reasonably printable. */
8631a2
+#if GRUB_CPU_SIZEOF_VOID_P == 8
8631a2
+#define PRIxGRUB_EFI_STATUS "lx"
8631a2
+#define PRIdGRUB_EFI_STATUS "ld"
8631a2
+#else
8631a2
+#define PRIxGRUB_EFI_STATUS "llx"
8631a2
+#define PRIdGRUB_EFI_STATUS "lld"
8631a2
+#endif
8631a2
 
8631a2
 #define GRUB_EFI_ERROR_CODE(value)	\
8631a2
   ((((grub_efi_status_t) 1) << (sizeof (grub_efi_status_t) * 8 - 1)) | (value))