gnu-efi/0041-Implement-Print-L-p-ptr.patch
Peter Jones 1104109978 Make the gnu-efi Makefiles install some of our compat libs.
Signed-off-by: Peter Jones <pjones@redhat.com>
2020-01-24 16:37:19 -05:00

39 lines
1.2 KiB
Diff

From 58c33b63da0e8def2fab43b79ae73403f5ccc23d 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/45] 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