summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Foundation/Library/Pei
diff options
context:
space:
mode:
Diffstat (limited to 'EdkCompatibilityPkg/Foundation/Library/Pei')
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Print/Print.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Print/Print.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Print/Print.c
index 458bb9ce4a..c35b830b51 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Print/Print.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Print/Print.c
@@ -39,6 +39,7 @@ Abstract:
Decimal number that represents width of print
type:
+ 'p' - arugment is VOID *; printed as hex number
'X' - argument is a UINTN hex number, prefix '0'
'x' - argument is a hex number
'd' - argument is a decimal number
@@ -220,6 +221,26 @@ Returns:
//
Format = GetFlagsAndWidth (Format, &Flags, &Width, &Marker);
switch (*Format) {
+ case 'p':
+ //
+ // Flag space, +, 0, L & l are invalid for type p.
+ //
+ Flags &= ~(PREFIX_BLANK| PREFIX_SIGN | LONG_TYPE);
+ if (sizeof (VOID *) > 4) {
+ Flags |= LONG_TYPE;
+ Value = VA_ARG (Marker, UINT64);
+ } else {
+ Value = VA_ARG (Marker, UINTN);
+ }
+ Flags |= PREFIX_ZERO;
+
+ ValueTomHexStr (TempBuffer, Value, Flags, Width);
+ AsciiStr = TempBuffer;
+
+ for (; (*AsciiStr != '\0') && (Index < BufferSize - 1); AsciiStr++) {
+ Buffer[Index++] = *AsciiStr;
+ }
+ break;
case 'X':
Flags |= PREFIX_ZERO;
Width = sizeof (UINT64) * 2;