// }\r
//\r
\r
+/**\r
+ Return the size of argument that has been aligned to sizeof (UINTN).\r
+\r
+ @param n The parameter size is to be aligned.\r
+\r
+ @return The aligned size\r
+**/\r
+#define _INT_SIZE_OF(n) ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1))\r
+\r
#if defined(__GNUC__)\r
//\r
// Use GCC builtin macros for variable argument lists.\r
#define VA_END(Marker) __builtin_va_end (Marker)\r
\r
#else\r
-/**\r
- Return the size of argument that has been aligned to sizeof (UINTN).\r
-\r
- @param n The parameter size is to be aligned.\r
-\r
- @return The aligned size\r
-**/\r
-#define _INT_SIZE_OF(n) ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1))\r
-\r
///\r
/// Pointer to the start of a variable argument list. Same as CHAR8 *.\r
///\r
\r
#endif\r
\r
+///\r
+/// Pointer to the start of a variable argument list stored in a memory buffer. Same as UINT8 *.\r
+///\r
+typedef UINTN *BASE_LIST;\r
+\r
+/**\r
+ Returns an argument of a specified type from a variable argument list and updates \r
+ the pointer to the variable argument list to point to the next argument. \r
+\r
+ This function returns an argument of the type specified by TYPE from the beginning \r
+ of the variable argument list specified by Marker. Marker is then updated to point \r
+ to the next argument in the variable argument list. The method for computing the \r
+ pointer to the next argument in the argument list is CPU specific following the EFIAPI ABI.\r
+\r
+ @param Marker Pointer to the beginning of a variable argument list.\r
+ @param TYPE The type of argument to retrieve from the beginning \r
+ of the variable argument list.\r
+ \r
+ @return An argument of the type specified by TYPE.\r
+\r
+**/\r
+#define BASE_ARG(Marker, TYPE) (*(TYPE *)((UINT8 *)(Marker = (BASE_LIST)((UINT8 *)Marker + _INT_SIZE_OF (TYPE))) - _INT_SIZE_OF (TYPE)))\r
+\r
/**\r
Macro that returns the byte offset of a field in a data structure. \r
\r
IN VA_LIST Marker\r
);\r
\r
+/**\r
+ Produces a Null-terminated Unicode string in an output buffer based on \r
+ a Null-terminated Unicode format string and a BASE_LIST argument list\r
+ \r
+ Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
+ and BufferSize. \r
+ The Unicode string is produced by parsing the format string specified by FormatString. \r
+ Arguments are pulled from the variable argument list specified by Marker based on the \r
+ contents of the format string. \r
+ The number of Unicode characters in the produced output buffer is returned not including\r
+ the Null-terminator.\r
+ If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
+\r
+ If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
+ If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
+ If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
+ If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
+ If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
+ PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
+ ASSERT().\r
+ If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
+ contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+ Null-terminator, then ASSERT().\r
+\r
+ @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
+ Unicode string.\r
+ @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+ @param FormatString Null-terminated Unicode format string.\r
+ @param Marker BASE_LIST marker for the variable argument list.\r
+ \r
+ @return The number of Unicode characters in the produced output buffer not including the\r
+ Null-terminator.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+UnicodeBSPrint (\r
+ OUT CHAR16 *StartOfBuffer,\r
+ IN UINTN BufferSize,\r
+ IN CONST CHAR16 *FormatString,\r
+ IN BASE_LIST Marker\r
+ );\r
+\r
/**\r
Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated \r
Unicode format string and variable argument list.\r
IN VA_LIST Marker\r
);\r
\r
+/**\r
+ Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated\r
+ ASCII format string and a BASE_LIST argument list\r
+ \r
+ Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
+ and BufferSize.\r
+ The Unicode string is produced by parsing the format string specified by FormatString.\r
+ Arguments are pulled from the variable argument list specified by Marker based on the \r
+ contents of the format string.\r
+ The number of Unicode characters in the produced output buffer is returned not including\r
+ the Null-terminator.\r
+ If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
+\r
+ If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
+ If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
+ If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
+ If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
+ PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
+ ASSERT().\r
+ If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
+ contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+ Null-terminator, then ASSERT().\r
+\r
+ @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
+ Unicode string.\r
+ @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+ @param FormatString Null-terminated ASCII format string.\r
+ @param Marker BASE_LIST marker for the variable argument list.\r
+ \r
+ @return The number of Unicode characters in the produced output buffer not including the\r
+ Null-terminator.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+UnicodeBSPrintAsciiFormat (\r
+ OUT CHAR16 *StartOfBuffer,\r
+ IN UINTN BufferSize,\r
+ IN CONST CHAR8 *FormatString,\r
+ IN BASE_LIST Marker\r
+ );\r
+\r
/**\r
Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated \r
ASCII format string and variable argument list.\r
IN VA_LIST Marker\r
);\r
\r
+/**\r
+ Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
+ ASCII format string and a BASE_LIST argument list.\r
+ \r
+ Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
+ and BufferSize.\r
+ The ASCII string is produced by parsing the format string specified by FormatString.\r
+ Arguments are pulled from the variable argument list specified by Marker based on \r
+ the contents of the format string.\r
+ The number of ASCII characters in the produced output buffer is returned not including\r
+ the Null-terminator.\r
+ If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+\r
+ If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
+ If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
+ If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
+ PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
+ ASSERT().\r
+ If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
+ contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
+ Null-terminator, then ASSERT().\r
+\r
+ @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
+ ASCII string.\r
+ @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+ @param FormatString Null-terminated ASCII format string.\r
+ @param Marker BASE_LIST marker for the variable argument list.\r
+ \r
+ @return The number of ASCII characters in the produced output buffer not including the\r
+ Null-terminator.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiBSPrint (\r
+ OUT CHAR8 *StartOfBuffer,\r
+ IN UINTN BufferSize,\r
+ IN CONST CHAR8 *FormatString,\r
+ IN BASE_LIST Marker\r
+ );\r
+\r
/**\r
Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
ASCII format string and variable argument list.\r
IN VA_LIST Marker\r
);\r
\r
+/**\r
+ Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
+ Unicode format string and a BASE_LIST argument list.\r
+ \r
+ Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
+ and BufferSize.\r
+ The ASCII string is produced by parsing the format string specified by FormatString.\r
+ Arguments are pulled from the variable argument list specified by Marker based on \r
+ the contents of the format string.\r
+ The number of ASCII characters in the produced output buffer is returned not including\r
+ the Null-terminator.\r
+ If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+\r
+ If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
+ If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
+ If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
+ If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r
+ PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
+ ASSERT().\r
+ If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
+ contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
+ Null-terminator, then ASSERT().\r
+\r
+ @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
+ ASCII string.\r
+ @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+ @param FormatString Null-terminated Unicode format string.\r
+ @param Marker BASE_LIST marker for the variable argument list.\r
+ \r
+ @return The number of ASCII characters in the produced output buffer not including the\r
+ Null-terminator.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiBSPrintUnicodeFormat (\r
+ OUT CHAR8 *StartOfBuffer,\r
+ IN UINTN BufferSize,\r
+ IN CONST CHAR16 *FormatString,\r
+ IN BASE_LIST Marker\r
+ );\r
+\r
/**\r
Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
Unicode format string and variable argument list.\r
ReportStatusCodeExtractDebugInfo (\r
IN CONST EFI_STATUS_CODE_DATA *Data, \r
OUT UINT32 *ErrorLevel,\r
- OUT VA_LIST *Marker,\r
+ OUT BASE_LIST *Marker,\r
OUT CHAR8 **Format\r
);\r
\r
IN VA_LIST Marker\r
)\r
{\r
- ASSERT_UNICODE_BUFFER(StartOfBuffer);\r
- ASSERT_UNICODE_BUFFER(FormatString);\r
- return BasePrintLibVSPrint ((CHAR8 *)StartOfBuffer, BufferSize >> 1, FORMAT_UNICODE | OUTPUT_UNICODE, (CHAR8 *)FormatString, Marker);\r
+ ASSERT_UNICODE_BUFFER (StartOfBuffer);\r
+ ASSERT_UNICODE_BUFFER (FormatString);\r
+ return BasePrintLibSPrintMarker ((CHAR8 *)StartOfBuffer, BufferSize >> 1, FORMAT_UNICODE | OUTPUT_UNICODE, (CHAR8 *)FormatString, Marker, NULL);\r
+}\r
+\r
+/**\r
+ Produces a Null-terminated Unicode string in an output buffer based on \r
+ a Null-terminated Unicode format string and a BASE_LIST argument list\r
+ \r
+ Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
+ and BufferSize. \r
+ The Unicode string is produced by parsing the format string specified by FormatString. \r
+ Arguments are pulled from the variable argument list specified by Marker based on the \r
+ contents of the format string. \r
+ The number of Unicode characters in the produced output buffer is returned not including\r
+ the Null-terminator.\r
+ If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
+\r
+ If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
+ If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
+ If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
+ If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
+ If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
+ PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
+ ASSERT().\r
+ If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
+ contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+ Null-terminator, then ASSERT().\r
+\r
+ @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
+ Unicode string.\r
+ @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+ @param FormatString Null-terminated Unicode format string.\r
+ @param Marker BASE_LIST marker for the variable argument list.\r
+ \r
+ @return The number of Unicode characters in the produced output buffer not including the\r
+ Null-terminator.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+UnicodeBSPrint (\r
+ OUT CHAR16 *StartOfBuffer,\r
+ IN UINTN BufferSize,\r
+ IN CONST CHAR16 *FormatString,\r
+ IN BASE_LIST Marker\r
+ )\r
+{\r
+ ASSERT_UNICODE_BUFFER (StartOfBuffer);\r
+ ASSERT_UNICODE_BUFFER (FormatString);\r
+ return BasePrintLibSPrintMarker ((CHAR8 *)StartOfBuffer, BufferSize >> 1, FORMAT_UNICODE | OUTPUT_UNICODE, (CHAR8 *)FormatString, NULL, Marker);\r
}\r
\r
/**\r
IN VA_LIST Marker\r
)\r
{\r
- ASSERT_UNICODE_BUFFER(StartOfBuffer);\r
- return BasePrintLibVSPrint ((CHAR8 *)StartOfBuffer, BufferSize >> 1, OUTPUT_UNICODE,FormatString, Marker);\r
+ ASSERT_UNICODE_BUFFER (StartOfBuffer);\r
+ return BasePrintLibSPrintMarker ((CHAR8 *)StartOfBuffer, BufferSize >> 1, OUTPUT_UNICODE, FormatString, Marker, NULL);\r
+}\r
+\r
+/**\r
+ Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated\r
+ ASCII format string and a BASE_LIST argument list\r
+ \r
+ Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
+ and BufferSize.\r
+ The Unicode string is produced by parsing the format string specified by FormatString.\r
+ Arguments are pulled from the variable argument list specified by Marker based on the \r
+ contents of the format string.\r
+ The number of Unicode characters in the produced output buffer is returned not including\r
+ the Null-terminator.\r
+ If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
+\r
+ If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
+ If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().\r
+ If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
+ If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
+ PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
+ ASSERT().\r
+ If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
+ contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+ Null-terminator, then ASSERT().\r
+\r
+ @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
+ Unicode string.\r
+ @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+ @param FormatString Null-terminated ASCII format string.\r
+ @param Marker BASE_LIST marker for the variable argument list.\r
+ \r
+ @return The number of Unicode characters in the produced output buffer not including the\r
+ Null-terminator.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+UnicodeBSPrintAsciiFormat (\r
+ OUT CHAR16 *StartOfBuffer,\r
+ IN UINTN BufferSize,\r
+ IN CONST CHAR8 *FormatString,\r
+ IN BASE_LIST Marker\r
+ )\r
+{\r
+ ASSERT_UNICODE_BUFFER (StartOfBuffer);\r
+ return BasePrintLibSPrintMarker ((CHAR8 *)StartOfBuffer, BufferSize >> 1, OUTPUT_UNICODE, FormatString, NULL, Marker);\r
}\r
\r
/**\r
IN VA_LIST Marker\r
)\r
{\r
- return BasePrintLibVSPrint (StartOfBuffer, BufferSize, 0, FormatString, Marker);\r
+ return BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, 0, FormatString, Marker, NULL);\r
+}\r
+\r
+/**\r
+ Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
+ ASCII format string and a BASE_LIST argument list.\r
+ \r
+ Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
+ and BufferSize.\r
+ The ASCII string is produced by parsing the format string specified by FormatString.\r
+ Arguments are pulled from the variable argument list specified by Marker based on \r
+ the contents of the format string.\r
+ The number of ASCII characters in the produced output buffer is returned not including\r
+ the Null-terminator.\r
+ If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+\r
+ If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
+ If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
+ If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
+ PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
+ ASSERT().\r
+ If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
+ contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
+ Null-terminator, then ASSERT().\r
+\r
+ @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
+ ASCII string.\r
+ @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+ @param FormatString Null-terminated ASCII format string.\r
+ @param Marker BASE_LIST marker for the variable argument list.\r
+ \r
+ @return The number of ASCII characters in the produced output buffer not including the\r
+ Null-terminator.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiBSPrint (\r
+ OUT CHAR8 *StartOfBuffer,\r
+ IN UINTN BufferSize,\r
+ IN CONST CHAR8 *FormatString,\r
+ IN BASE_LIST Marker\r
+ )\r
+{\r
+ return BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, 0, FormatString, NULL, Marker);\r
}\r
\r
/**\r
)\r
{\r
ASSERT_UNICODE_BUFFER (FormatString);\r
- return BasePrintLibVSPrint (StartOfBuffer, BufferSize, FORMAT_UNICODE, (CHAR8 *)FormatString, Marker);\r
+ return BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, FORMAT_UNICODE, (CHAR8 *)FormatString, Marker, NULL);\r
+}\r
+\r
+/**\r
+ Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
+ Unicode format string and a BASE_LIST argument list.\r
+ \r
+ Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
+ and BufferSize.\r
+ The ASCII string is produced by parsing the format string specified by FormatString.\r
+ Arguments are pulled from the variable argument list specified by Marker based on \r
+ the contents of the format string.\r
+ The number of ASCII characters in the produced output buffer is returned not including\r
+ the Null-terminator.\r
+ If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+\r
+ If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
+ If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
+ If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().\r
+ If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r
+ PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
+ ASSERT().\r
+ If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
+ contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
+ Null-terminator, then ASSERT().\r
+\r
+ @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated \r
+ ASCII string.\r
+ @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+ @param FormatString Null-terminated Unicode format string.\r
+ @param Marker BASE_LIST marker for the variable argument list.\r
+ \r
+ @return The number of ASCII characters in the produced output buffer not including the\r
+ Null-terminator.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiBSPrintUnicodeFormat (\r
+ OUT CHAR8 *StartOfBuffer,\r
+ IN UINTN BufferSize,\r
+ IN CONST CHAR16 *FormatString,\r
+ IN BASE_LIST Marker\r
+ )\r
+{\r
+ ASSERT_UNICODE_BUFFER (FormatString);\r
+ return BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, FORMAT_UNICODE, (CHAR8 *)FormatString, NULL, Marker);\r
}\r
\r
/**\r
{\r
return BasePrintLibConvertValueToString (Buffer, Flags, Value, Width, 1);\r
}\r
-\r
VA_LIST is used this routine allows the nesting of Vararg routines. Thus \r
this is the main print working routine.\r
\r
- @param Buffer Character buffer to print the results of the parsing\r
- of Format into.\r
- @param BufferSize Maximum number of characters to put into buffer.\r
- @param Flags Initial flags value.\r
- Can only have FORMAT_UNICODE and OUTPUT_UNICODE set.\r
- @param Format Null-terminated format string.\r
- @param Marker Vararg list consumed by processing Format.\r
+ @param Buffer Character buffer to print the results of the parsing\r
+ of Format into.\r
+ @param BufferSize Maximum number of characters to put into buffer.\r
+ @param Flags Initial flags value.\r
+ Can only have FORMAT_UNICODE and OUTPUT_UNICODE set.\r
+ @param Format Null-terminated format string.\r
+ @param VaListMarker VA_LIST style variable argument list consumed by processing Format.\r
+ @param BaseListMarker BASE_LIST style variable argument list consumed by processing Format.\r
\r
@return Number of characters printed not including the Null-terminator.\r
\r
**/\r
UINTN\r
-BasePrintLibVSPrint (\r
+BasePrintLibSPrintMarker (\r
OUT CHAR8 *Buffer,\r
IN UINTN BufferSize,\r
IN UINTN Flags,\r
IN CONST CHAR8 *Format,\r
- IN VA_LIST Marker\r
+ IN VA_LIST VaListMarker, OPTIONAL\r
+ IN BASE_LIST BaseListMarker OPTIONAL\r
)\r
{\r
- CHAR8 *OriginalBuffer;\r
- CHAR8 *EndBuffer;\r
- CHAR8 ValueBuffer[MAXIMUM_VALUE_CHARACTERS];\r
- UINTN BytesPerOutputCharacter;\r
- UINTN BytesPerFormatCharacter;\r
- UINTN FormatMask;\r
- UINTN FormatCharacter;\r
- UINTN Width;\r
- UINTN Precision;\r
- INT64 Value;\r
- CONST CHAR8 *ArgumentString;\r
- UINTN Character;\r
- GUID *TmpGuid;\r
- TIME *TmpTime;\r
- UINTN Count;\r
- UINTN ArgumentMask;\r
- INTN BytesPerArgumentCharacter;\r
- UINTN ArgumentCharacter;\r
- BOOLEAN Done;\r
- UINTN Index;\r
- CHAR8 Prefix;\r
- BOOLEAN ZeroPad;\r
- BOOLEAN Comma;\r
- UINTN Digits;\r
- UINTN Radix;\r
- RETURN_STATUS Status;\r
+ CHAR8 *OriginalBuffer;\r
+ CHAR8 *EndBuffer;\r
+ CHAR8 ValueBuffer[MAXIMUM_VALUE_CHARACTERS];\r
+ UINTN BytesPerOutputCharacter;\r
+ UINTN BytesPerFormatCharacter;\r
+ UINTN FormatMask;\r
+ UINTN FormatCharacter;\r
+ UINTN Width;\r
+ UINTN Precision;\r
+ INT64 Value;\r
+ CONST CHAR8 *ArgumentString;\r
+ UINTN Character;\r
+ GUID *TmpGuid;\r
+ TIME *TmpTime;\r
+ UINTN Count;\r
+ UINTN ArgumentMask;\r
+ INTN BytesPerArgumentCharacter;\r
+ UINTN ArgumentCharacter;\r
+ BOOLEAN Done;\r
+ UINTN Index;\r
+ CHAR8 Prefix;\r
+ BOOLEAN ZeroPad;\r
+ BOOLEAN Comma;\r
+ UINTN Digits;\r
+ UINTN Radix;\r
+ RETURN_STATUS Status;\r
\r
if (BufferSize == 0) {\r
return 0;\r
//\r
BufferSize--;\r
OriginalBuffer = Buffer;\r
+\r
//\r
// Set the tag for the end of the input Buffer.\r
//\r
case '*':\r
if ((Flags & PRECISION) == 0) {\r
Flags |= PAD_TO_WIDTH;\r
- Width = VA_ARG (Marker, UINTN);\r
+ if (BaseListMarker == NULL) {\r
+ Width = VA_ARG (VaListMarker, UINTN);\r
+ } else {\r
+ Width = BASE_ARG (BaseListMarker, UINTN);\r
+ }\r
} else {\r
- Precision = VA_ARG (Marker, UINTN);\r
+ if (BaseListMarker == NULL) {\r
+ Precision = VA_ARG (VaListMarker, UINTN);\r
+ } else {\r
+ Precision = BASE_ARG (BaseListMarker, UINTN);\r
+ }\r
}\r
break;\r
case '0':\r
// provides an implementation that is compatible with that largest possible set of CPU \r
// architectures. This is why the type "int" is used in this one case.\r
//\r
- Value = (VA_ARG (Marker, int));\r
+ if (BaseListMarker == NULL) {\r
+ Value = VA_ARG (VaListMarker, int);\r
+ } else {\r
+ Value = BASE_ARG (BaseListMarker, int);\r
+ }\r
} else {\r
- Value = VA_ARG (Marker, INT64);\r
+ if (BaseListMarker == NULL) {\r
+ Value = VA_ARG (VaListMarker, INT64);\r
+ } else {\r
+ Value = BASE_ARG (BaseListMarker, INT64);\r
+ }\r
}\r
if ((Flags & PREFIX_BLANK) != 0) {\r
Prefix = ' ';\r
// break skipped on purpose\r
//\r
case 'a':\r
- ArgumentString = (CHAR8 *)VA_ARG (Marker, CHAR8 *);\r
+ if (BaseListMarker == NULL) {\r
+ ArgumentString = VA_ARG (VaListMarker, CHAR8 *);\r
+ } else {\r
+ ArgumentString = BASE_ARG (BaseListMarker, CHAR8 *);\r
+ }\r
if (ArgumentString == NULL) {\r
Flags &= (~ARGUMENT_UNICODE);\r
ArgumentString = "<null string>";\r
break;\r
\r
case 'c':\r
- Character = VA_ARG (Marker, UINTN) & 0xffff;\r
+ if (BaseListMarker == NULL) {\r
+ Character = VA_ARG (VaListMarker, UINTN) & 0xffff;\r
+ } else {\r
+ Character = BASE_ARG (BaseListMarker, UINTN) & 0xffff;\r
+ }\r
ArgumentString = (CHAR8 *)&Character;\r
Flags |= ARGUMENT_UNICODE;\r
break;\r
\r
case 'g':\r
- TmpGuid = VA_ARG (Marker, GUID *);\r
+ if (BaseListMarker == NULL) {\r
+ TmpGuid = VA_ARG (VaListMarker, GUID *);\r
+ } else {\r
+ TmpGuid = BASE_ARG (BaseListMarker, GUID *);\r
+ }\r
if (TmpGuid == NULL) {\r
ArgumentString = "<null guid>";\r
} else {\r
break;\r
\r
case 't':\r
- TmpTime = VA_ARG (Marker, TIME *); \r
+ if (BaseListMarker == NULL) {\r
+ TmpTime = VA_ARG (VaListMarker, TIME *); \r
+ } else {\r
+ TmpTime = BASE_ARG (BaseListMarker, TIME *); \r
+ }\r
if (TmpTime == NULL) {\r
ArgumentString = "<null time>";\r
} else {\r
break;\r
\r
case 'r':\r
- Status = VA_ARG (Marker, RETURN_STATUS);\r
+ if (BaseListMarker == NULL) {\r
+ Status = VA_ARG (VaListMarker, RETURN_STATUS);\r
+ } else {\r
+ Status = BASE_ARG (BaseListMarker, RETURN_STATUS);\r
+ }\r
ArgumentString = ValueBuffer;\r
if (RETURN_ERROR (Status)) {\r
//\r
VA_LIST Marker;\r
\r
VA_START (Marker, FormatString);\r
- return BasePrintLibVSPrint (StartOfBuffer, BufferSize, Flags, FormatString, Marker);\r
+ return BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, Flags, FormatString, Marker, NULL);\r
}\r
VA_LIST is used this routine allows the nesting of Vararg routines. Thus \r
this is the main print working routine.\r
\r
- @param Buffer Character buffer to print the results of the parsing\r
- of Format into.\r
- @param BufferSize Maximum number of characters to put into buffer.\r
- @param Flags Initial flags value.\r
- Can only have FORMAT_UNICODE and OUTPUT_UNICODE set.\r
- @param Format Null-terminated format string.\r
- @param Marker Vararg list consumed by processing Format.\r
+ @param Buffer Character buffer to print the results of the parsing\r
+ of Format into.\r
+ @param BufferSize Maximum number of characters to put into buffer.\r
+ @param Flags Initial flags value.\r
+ Can only have FORMAT_UNICODE and OUTPUT_UNICODE set.\r
+ @param Format Null-terminated format string.\r
+ @param VaListMarker VA_LIST style variable argument list consumed by processing Format.\r
+ @param BaseListMarker BASE_LIST style variable argument list consumed by processing Format.\r
\r
@return Number of characters printed not including the Null-terminator.\r
\r
**/\r
UINTN\r
-BasePrintLibVSPrint (\r
+BasePrintLibSPrintMarker (\r
OUT CHAR8 *Buffer,\r
IN UINTN BufferSize,\r
IN UINTN Flags,\r
IN CONST CHAR8 *Format,\r
- IN VA_LIST Marker\r
+ IN VA_LIST VaListMarker, OPTIONAL\r
+ IN BASE_LIST BaseListMarker OPTIONAL\r
);\r
\r
/**\r
ReportStatusCodeExtractDebugInfo (\r
IN CONST EFI_STATUS_CODE_DATA *Data,\r
OUT UINT32 *ErrorLevel,\r
- OUT VA_LIST *Marker,\r
+ OUT BASE_LIST *Marker,\r
OUT CHAR8 **Format\r
)\r
{\r
+ ASSERT (Data != NULL);\r
+ ASSERT (ErrorLevel != NULL);\r
+ ASSERT (StartOfBuffer != NULL);\r
+\r
return FALSE;\r
}\r
\r