/** @file\r
Serial I/O status code reporting worker.\r
\r
- Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r
- This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
- \r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
\r
/**\r
Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
- \r
+\r
@param CodeType Indicates the type of status code being reported.\r
@param Value Describes the current status of a hardware or software entity.\r
This included information about the class and subclass that is used to\r
CHAR8 *Filename;\r
CHAR8 *Description;\r
CHAR8 *Format;\r
- CHAR8 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];\r
+ CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH];\r
UINT32 ErrorLevel;\r
UINT32 LineNumber;\r
UINTN CharCount;\r
// Print DEBUG() information into output buffer.\r
//\r
CharCount = AsciiBSPrint (\r
- Buffer, \r
- sizeof (Buffer), \r
- Format, \r
+ Buffer,\r
+ sizeof (Buffer),\r
+ Format,\r
Marker\r
);\r
} else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {\r
// Print ERROR information into output buffer.\r
//\r
CharCount = AsciiSPrint (\r
- Buffer, \r
- sizeof (Buffer), \r
- "ERROR: C%x:V%x I%x", \r
- CodeType, \r
- Value, \r
+ Buffer,\r
+ sizeof (Buffer),\r
+ "ERROR: C%08x:V%08x I%x",\r
+ CodeType,\r
+ Value,\r
Instance\r
);\r
- \r
+ ASSERT (CharCount > 0);\r
+\r
if (CallerId != NULL) {\r
CharCount += AsciiSPrint (\r
- &Buffer[CharCount - 1],\r
+ &Buffer[CharCount],\r
(sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
" %g",\r
CallerId\r
\r
if (Data != NULL) {\r
CharCount += AsciiSPrint (\r
- &Buffer[CharCount - 1],\r
+ &Buffer[CharCount],\r
(sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
" %x",\r
Data\r
}\r
\r
CharCount += AsciiSPrint (\r
- &Buffer[CharCount - 1],\r
+ &Buffer[CharCount],\r
(sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
"\n\r"\r
);\r
// Print PROGRESS information into output buffer.\r
//\r
CharCount = AsciiSPrint (\r
- Buffer, \r
- sizeof (Buffer), \r
- "PROGRESS CODE: V%x I%x\n\r", \r
- Value, \r
+ Buffer,\r
+ sizeof (Buffer),\r
+ "PROGRESS CODE: V%08x I%x\n\r",\r
+ Value,\r
Instance\r
);\r
+ } else if (Data != NULL &&\r
+ CompareGuid (&Data->Type, &gEfiStatusCodeDataTypeStringGuid) &&\r
+ ((EFI_STATUS_CODE_STRING_DATA *) Data)->StringType == EfiStringAscii) {\r
+ //\r
+ // EFI_STATUS_CODE_STRING_DATA\r
+ //\r
+ CharCount = AsciiSPrint (\r
+ Buffer,\r
+ sizeof (Buffer),\r
+ "%a",\r
+ ((EFI_STATUS_CODE_STRING_DATA *) Data)->String.Ascii\r
+ );\r
} else {\r
//\r
// Code type is not defined.\r
//\r
CharCount = AsciiSPrint (\r
- Buffer, \r
- sizeof (Buffer), \r
- "Undefined: C%x:V%x I%x\n\r", \r
- CodeType, \r
- Value, \r
+ Buffer,\r
+ sizeof (Buffer),\r
+ "Undefined: C%08x:V%08x I%x\n\r",\r
+ CodeType,\r
+ Value,\r
Instance\r
);\r
}\r