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