/** @file\r
Serial I/O status code reporting worker.\r
\r
- Copyright (c) 2006 - 2014, 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) 2006 - 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
// 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%08x:V%08x 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
ASSERT (CharCount > 0);\r
- \r
+\r
if (CallerId != NULL) {\r
CharCount += AsciiSPrint (\r
&Buffer[CharCount],\r
// Print PROGRESS information into output buffer.\r
//\r
CharCount = AsciiSPrint (\r
- Buffer, \r
- sizeof (Buffer), \r
- "PROGRESS CODE: V%08x 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
CharCount = AsciiSPrint (\r
Buffer,\r
sizeof (Buffer),\r
- "%a\n\r",\r
+ "%a",\r
((EFI_STATUS_CODE_STRING_DATA *) Data)->String.Ascii\r
);\r
} else {\r
// Code type is not defined.\r
//\r
CharCount = AsciiSPrint (\r
- Buffer, \r
- sizeof (Buffer), \r
- "Undefined: C%08x:V%08x 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
//\r
SerialPortWrite ((UINT8 *) Buffer, CharCount);\r
\r
+ //\r
+ // If register an unregister function of gEfiEventExitBootServicesGuid,\r
+ // then some log called in ExitBootServices() will be lost,\r
+ // so unregister the handler after receive the value of exit boot service.\r
+ //\r
+ if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE &&\r
+ Value == (EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_BS_PC_EXIT_BOOT_SERVICES)) {\r
+ UnregisterSerialBootTimeHandlers();\r
+ }\r
+\r
return EFI_SUCCESS;\r
}\r
\r