'p' - arugment is VOID *; printed as hex number
Example is :
ASPrint (Buffer, 1024, "This is a %p\n", SystemTable);
ASPrint (Buffer, 1024, "This is a %10p\n", SystemTable);
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5554
6f19259b-4bc3-4df7-8a09-
765794883524
//\r
Format = GetFlagsAndWidth (Format, &Flags, &Width, &Marker);\r
switch (*Format) {\r
+ case 'p':\r
+ //\r
+ // Flag space, +, 0, L & l are invalid for type p.\r
+ //\r
+ Flags &= ~(PREFIX_BLANK| PREFIX_SIGN | LONG_TYPE);\r
+ if (sizeof (VOID *) > 4) {\r
+ Flags |= LONG_TYPE;\r
+ Value = VA_ARG (Marker, UINT64);\r
+ } else {\r
+ Value = VA_ARG (Marker, UINTN);\r
+ }\r
+ Flags |= PREFIX_ZERO;\r
+ \r
+ EfiValueToHexStr (TempBuffer, Value, Flags, Width);\r
+ UnicodeStr = TempBuffer;\r
+ \r
+ for ( ;(*UnicodeStr != '\0') && (Index < NumberOfCharacters - 1); UnicodeStr++) {\r
+ Buffer[Index++] = *UnicodeStr;\r
+ }\r
+ break;\r
+ \r
case 'X':\r
Flags |= PREFIX_ZERO;\r
Width = sizeof (UINT64) * 2;\r
Decimal number that represents width of print\r
\r
type:\r
+ 'p' - arugment is VOID *; printed as hex number\r
'X' - argument is a UINTN hex number, prefix '0'\r
'x' - argument is a hex number\r
'd' - argument is a decimal number\r
//\r
Format = GetFlagsAndWidth (Format, &Flags, &Width, &Marker);\r
switch (*Format) {\r
+ case 'p':\r
+ //\r
+ // Flag space, +, 0, L & l are invalid for type p.\r
+ //\r
+ Flags &= ~(PREFIX_BLANK| PREFIX_SIGN | LONG_TYPE);\r
+ if (sizeof (VOID *) > 4) {\r
+ Flags |= LONG_TYPE;\r
+ Value = VA_ARG (Marker, UINT64);\r
+ } else {\r
+ Value = VA_ARG (Marker, UINTN);\r
+ }\r
+ Flags |= PREFIX_ZERO;\r
+\r
+ EfiValueToHexStr (TempBuffer, Value, Flags, Width);\r
+ UnicodeStr = TempBuffer;\r
+\r
+ for ( ;(*UnicodeStr != '\0') && (Index < NumberOfCharacters - 1); UnicodeStr++) {\r
+ Buffer[Index++] = *UnicodeStr;\r
+ }\r
+ break;\r
+ \r
case 'X':\r
Flags |= PREFIX_ZERO;\r
Width = sizeof (UINT64) * 2;\r
Decimal number that represents width of print\r
\r
type:\r
+ 'p' - arugment is VOID *; printed as hex number\r
'X' - argument is a UINTN hex number, prefix '0'\r
'x' - argument is a hex number\r
'd' - argument is a decimal number\r
//\r
Format = GetFlagsAndWidth (Format, &Flags, &Width, &Marker);\r
switch (*Format) {\r
+ case 'p':\r
+ //\r
+ // Flag space, +, 0, L & l are invalid for type p.\r
+ //\r
+ Flags &= ~(PREFIX_BLANK| PREFIX_SIGN | LONG_TYPE);\r
+ if (sizeof (VOID *) > 4) {\r
+ Flags |= LONG_TYPE;\r
+ Value = VA_ARG (Marker, UINT64);\r
+ } else {\r
+ Value = VA_ARG (Marker, UINTN);\r
+ }\r
+ Flags |= PREFIX_ZERO;\r
+ \r
+ ValueTomHexStr (TempBuffer, Value, Flags, Width);\r
+ AsciiStr = TempBuffer;\r
+\r
+ for (; (*AsciiStr != '\0') && (Index < BufferSize - 1); AsciiStr++) {\r
+ Buffer[Index++] = *AsciiStr;\r
+ }\r
+ break;\r
case 'X':\r
Flags |= PREFIX_ZERO;\r
Width = sizeof (UINT64) * 2;\r