summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2019-11-18 13:06:23 -0500
committerNigel Croxon <ncroxon@redhat.com>2023-04-04 09:28:42 -0400
commit4b5db35e9d1f4295fa7a8f393021fd2f433a90e4 (patch)
tree38eeb006149e41642e3c54f72fe6465492a426ba
parent4f8b339facb471192e021fffd5db545a0fbddbc3 (diff)
downloadgnu-efi-4b5db35e9d1f4295fa7a8f393021fd2f433a90e4.tar.gz
Implement Print(L"%p", ptr);
Signed-off-by: Peter Jones <pjones@redhat.com>
-rw-r--r--lib/print.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/print.c b/lib/print.c
index 6a50a51..a43dc8c 100644
--- a/lib/print.c
+++ b/lib/print.c
@@ -1239,6 +1239,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;