gnu-efi/0041-Implement-Print-L-p-ptr.patch

39 lines
1.2 KiB
Diff
Raw Normal View History

From a39c7b9bbbacc6554bba79a7ab8eeb37f88d8c15 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 18 Nov 2019 13:06:23 -0500
Subject: [PATCH 41/46] Implement Print(L"%p", ptr);
Signed-off-by: Peter Jones <pjones@redhat.com>
---
lib/print.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/lib/print.c b/lib/print.c
index 0b823481347..8fdba6ee166 100644
--- a/lib/print.c
+++ b/lib/print.c
@@ -1181,6 +1181,20 @@ Returns:
PSETATTR(ps, ps->AttrNorm);
break;
+ case 'p':
+ Item.Width = sizeof(void *) == (8 ? 16 : 8) + 2;
+ Item.Pad = '0';
+ Item.Scratch[0] = ' ';
+ Item.Scratch[1] = ' ';
+ ValueToHex (
+ Item.Scratch+2,
+ Item.Long ? va_arg(ps->args, UINT64) : va_arg(ps->args, UINT32)
+ );
+ Item.Scratch[0] = '0';
+ Item.Scratch[1] = 'x';
+ Item.Item.pw = Item.Scratch;
+ break;
+
case 'r':
StatusToString (Item.Scratch, va_arg(ps->args, EFI_STATUS));
Item.Item.pw = Item.Scratch;
--
2.24.1