X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FBasePrintLib%2FPrintLibInternal.c;h=2be6ad55e7a158799127e02a1e81a908279a7690;hp=cf5c28e6f77ec1db39dfde644a9a775b901dedaf;hb=274402de4642937735918e6c756777c40524957d;hpb=c553db4b78024d7b3a14c0224c750976f4062585 diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.c b/MdePkg/Library/BasePrintLib/PrintLibInternal.c index cf5c28e6f7..2be6ad55e7 100644 --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c @@ -1,11 +1,11 @@ /** @file Print Library internal worker functions. - Copyright (c) 2006 - 2008, Intel Corporation
- All rights reserved. This program and the accompanying materials + Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php + http://opensource.org/licenses/bsd-license.php. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. @@ -57,15 +57,15 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *mStatusString[] = { Internal function that places ASCII or Unicode character into the Buffer. - @param Buffer Buffer to place the Unicode or ASCII string. + @param Buffer The buffer to place the Unicode or ASCII string. @param EndBuffer The end of the input Buffer. No characters will be placed after that. - @param Length Count of character to be placed into Buffer. + @param Length The count of character to be placed into Buffer. (Negative value indicates no buffer fill.) - @param Character Character to be placed into Buffer. - @param Increment Character increment in Buffer. + @param Character The character to be placed into Buffer. + @param Increment The character increment in Buffer. - @return Buffer Buffer filled with the input Character. + @return Buffer. **/ CHAR8 * @@ -96,7 +96,7 @@ BasePrintLibFillBuffer ( Print worker function that converts a decimal or hexadecimal number to an ASCII string in Buffer. @param Buffer Location to place the ASCII string of Value. - @param Value Value to convert to a Decimal or Hexadecimal string in Buffer. + @param Value The value to convert to a Decimal or Hexadecimal string in Buffer. @param Radix Radix of the value @return A pointer to the end of buffer filled with ASCII string. @@ -152,14 +152,14 @@ BasePrintLibValueToString ( If unsupported bits are set in Flags, then ASSERT(). If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT() - @param Buffer Pointer to the output buffer for the produced Null-terminated + @param Buffer The pointer to the output buffer for the produced Null-terminated string. @param Flags The bitmask of flags that specify left justification, zero pad, and commas. @param Value The 64-bit signed value to convert to a string. @param Width The maximum number of characters to place in Buffer, not including the Null-terminator. - @param Increment Character increment in Buffer. + @param Increment The character increment in Buffer. @return Total number of characters required to perform the conversion. @@ -193,7 +193,7 @@ BasePrintLibConvertValueToString ( ASSERT ((Flags & ~(LEFT_JUSTIFY | COMMA_TYPE | PREFIX_ZERO | RADIX_HEX)) == 0); // - // If both COMMA_TYPE and HEX_RADIX are set, then ASSERT () + // If both COMMA_TYPE and RADIX_HEX are set, then ASSERT () // ASSERT (((Flags & COMMA_TYPE) == 0) || ((Flags & RADIX_HEX) == 0)); @@ -275,16 +275,16 @@ BasePrintLibConvertValueToString ( VA_LIST is used this routine allows the nesting of Vararg routines. Thus this is the main print working routine. - @param Buffer Character buffer to print the results of the parsing + @param Buffer The character buffer to print the results of the parsing of Format into. - @param BufferSize Maximum number of characters to put into buffer. + @param BufferSize The maximum number of characters to put into buffer. @param Flags Initial flags value. Can only have FORMAT_UNICODE and OUTPUT_UNICODE set. - @param Format Null-terminated format string. + @param Format A Null-terminated format string. @param VaListMarker VA_LIST style variable argument list consumed by processing Format. @param BaseListMarker BASE_LIST style variable argument list consumed by processing Format. - @return Number of characters printed not including the Null-terminator. + @return The number of characters printed not including the Null-terminator. **/ UINTN @@ -323,6 +323,9 @@ BasePrintLibSPrintMarker ( UINTN Digits; UINTN Radix; RETURN_STATUS Status; + UINT32 GuidData1; + UINT16 GuidData2; + UINT16 GuidData3; if (BufferSize == 0) { return 0; @@ -631,14 +634,17 @@ BasePrintLibSPrintMarker ( if (TmpGuid == NULL) { ArgumentString = ""; } else { + GuidData1 = ReadUnaligned32 (&(TmpGuid->Data1)); + GuidData2 = ReadUnaligned16 (&(TmpGuid->Data2)); + GuidData3 = ReadUnaligned16 (&(TmpGuid->Data3)); BasePrintLibSPrint ( ValueBuffer, MAXIMUM_VALUE_CHARACTERS, 0, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - TmpGuid->Data1, - TmpGuid->Data2, - TmpGuid->Data3, + GuidData1, + GuidData2, + GuidData3, TmpGuid->Data4[0], TmpGuid->Data4[1], TmpGuid->Data4[2], @@ -898,19 +904,20 @@ BasePrintLibSPrintMarker ( VA_LIST is used this routine allows the nesting of Vararg routines. Thus this is the main print working routine - @param StartOfBuffer Character buffer to print the results of the parsing + @param StartOfBuffer The character buffer to print the results of the parsing of Format into. - @param BufferSize Maximum number of characters to put into buffer. + @param BufferSize The maximum number of characters to put into buffer. Zero means no limit. @param Flags Initial flags value. Can only have FORMAT_UNICODE and OUTPUT_UNICODE set - @param FormatString Null-terminated format string. + @param FormatString A Null-terminated format string. @param ... The variable argument list. - @return Number of characters printed. + @return The number of characters printed. **/ UINTN +EFIAPI BasePrintLibSPrint ( OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize,