]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/SerialStatusCodeWorker.c
Update the copyright notice format
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / StatusCode / RuntimeDxe / SerialStatusCodeWorker.c
index 1d5f53e47910518ebfb140d2e369d81749da832b..3f503687550450fa9e34456e65fd367bec639640 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Serial I/O status code reporting worker.\r
 \r
-  Copyright (c) 2006 - 2009, Intel Corporation                                                         \r
-  All rights reserved. This program and the accompanying materials                          \r
+  Copyright (c) 2006 - 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
 #include "StatusCodeRuntimeDxe.h"\r
 \r
-EFI_SERIAL_IO_PROTOCOL *mSerialIoProtocol;\r
-\r
-/**\r
-  Locates Serial I/O Protocol as initialization for serial status code worker.\r
\r
-  @retval EFI_SUCCESS  Serial I/O Protocol is successfully located.\r
-\r
-**/\r
-EFI_STATUS\r
-EfiSerialStatusCodeInitializeWorker (\r
-  VOID\r
-  )\r
-{\r
-  EFI_STATUS Status;\r
-\r
-  Status = gBS->LocateProtocol (\r
-             &gEfiSerialIoProtocolGuid,\r
-             NULL,\r
-             (VOID **) &mSerialIoProtocol\r
-             );\r
-\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return EFI_SUCCESS;\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
@@ -78,15 +51,6 @@ SerialStatusCodeReportWorker (
   UINTN           CharCount;\r
   BASE_LIST       Marker;\r
 \r
-  if (FeaturePcdGet (PcdStatusCodeUseEfiSerial)) {\r
-    if (EfiAtRuntime ()) {\r
-      return EFI_DEVICE_ERROR;\r
-    }\r
-    if (EfiGetCurrentTpl () > TPL_CALLBACK ) {\r
-      return EFI_DEVICE_ERROR;\r
-    }\r
-  }\r
-\r
   Buffer[0] = '\0';\r
 \r
   if (Data != NULL &&\r
@@ -128,7 +92,7 @@ SerialStatusCodeReportWorker (
    \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
@@ -137,7 +101,7 @@ SerialStatusCodeReportWorker (
 \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
@@ -145,7 +109,7 @@ SerialStatusCodeReportWorker (
     }\r
 \r
     CharCount += AsciiSPrint (\r
-                   &Buffer[CharCount - 1],\r
+                   &Buffer[CharCount],\r
                    (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
                    "\n\r"\r
                    );\r
@@ -174,20 +138,10 @@ SerialStatusCodeReportWorker (
                   );\r
   }\r
 \r
-\r
-  if (FeaturePcdGet (PcdStatusCodeUseHardSerial)) {\r
-    //\r
-    // Call SerialPort Lib function to do print.\r
-    //\r
-    SerialPortWrite ((UINT8 *) Buffer, CharCount);\r
-  }\r
-  if (FeaturePcdGet (PcdStatusCodeUseEfiSerial)) {\r
-    mSerialIoProtocol->Write (\r
-      mSerialIoProtocol,\r
-      &CharCount,\r
-      Buffer\r
-      );\r
-  }\r
+  //\r
+  // Call SerialPort Lib function to do print.\r
+  //\r
+  SerialPortWrite ((UINT8 *) Buffer, CharCount);\r
 \r
   return EFI_SUCCESS;\r
 }\r