]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UnixPkg/Library/DxeUnixOemHookStatusCodeLib/UnixOemHookStatusCodeLib.c
Fix issue with fixing tabs.
[mirror_edk2.git] / UnixPkg / Library / DxeUnixOemHookStatusCodeLib / UnixOemHookStatusCodeLib.c
index f09bf93c63e91f9580ef7988f700903e58777291..d9a7b3e9813bfc4d67eddd9189034162588c7f6a 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   OEM hook status code library functions with no library constructor/destructor\r
 \r
-  Copyright (c) 2006, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
+  Copyright (c) 2006 - 2010, 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
@@ -13,8 +13,8 @@
   Module Name:  UnixOemHookStatusCodeLib.c\r
 \r
 **/\r
-#include "PiDxe.h"\r
 #include <Guid/StatusCodeDataTypeId.h>\r
+#include <Guid/StatusCodeDataTypeDebug.h>\r
 #include "UnixDxe.h"\r
 #include <Library/OemHookStatusCodeLib.h>\r
 #include <Library/DebugLib.h>\r
@@ -22,8 +22,6 @@
 #include <Library/PrintLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/ReportStatusCodeLib.h>\r
-#include <FrameworkModuleBase.h>\r
-#include <DebugInfo.h>\r
 \r
 //\r
 // Cache of UnixThunk protocol \r
@@ -61,7 +59,7 @@ OemHookStatusCodeInitialize (
   //\r
   // Cache standard output handle.\r
   //\r
-  mStdOut = 1;
+  mStdOut = 1;\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -111,8 +109,7 @@ OemHookStatusCodeReport (
   UINT32          ErrorLevel;\r
   UINT32          LineNumber;\r
   UINTN           CharCount;\r
-  VA_LIST         Marker;\r
-  EFI_DEBUG_INFO  *DebugInfo;\r
+  BASE_LIST       Marker;\r
 \r
   Buffer[0] = '\0';\r
 \r
@@ -123,7 +120,7 @@ OemHookStatusCodeReport (
     //\r
     CharCount = AsciiSPrint (\r
                   Buffer,\r
-                  EFI_STATUS_CODE_DATA_MAX_SIZE,\r
+                  sizeof (Buffer),\r
                   "\n\rASSERT!: %a (%d): %a\n\r",\r
                   Filename,\r
                   LineNumber,\r
@@ -137,7 +134,7 @@ OemHookStatusCodeReport (
               mStdOut,\r
               Buffer,\r
               CharCount\r
-             );
+        );\r
 \r
     return EFI_SUCCESS;\r
 \r
@@ -146,30 +143,19 @@ OemHookStatusCodeReport (
     //\r
     // Print DEBUG() information into output buffer.\r
     //\r
-    CharCount = AsciiVSPrint (\r
+    CharCount = AsciiBSPrint (\r
                   Buffer, \r
-                  EFI_STATUS_CODE_DATA_MAX_SIZE\r
+                  sizeof (Buffer)\r
                   Format, \r
                   Marker\r
                   );\r
-  } else if (Data != NULL && \r
-             CompareGuid (&Data->Type, &gEfiStatusCodeSpecificDataGuid) &&\r
-             (CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) {\r
-    //\r
-    // Print specific data into output buffer.\r
-    //\r
-    DebugInfo = (EFI_DEBUG_INFO *) (Data + 1);\r
-    Marker    = (VA_LIST) (DebugInfo + 1);\r
-    Format    = (CHAR8 *) (((UINT64 *) Marker) + 12);\r
-\r
-    CharCount = AsciiVSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, Format, Marker);\r
   } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {\r
     //\r
     // Print ERROR information into output buffer.\r
     //\r
     CharCount = AsciiSPrint (\r
                   Buffer, \r
-                  EFI_STATUS_CODE_DATA_MAX_SIZE\r
+                  sizeof (Buffer)\r
                   "ERROR: C%x:V%x I%x", \r
                   CodeType, \r
                   Value, \r
@@ -183,7 +169,7 @@ OemHookStatusCodeReport (
     if (CallerId != NULL) {\r
       CharCount += AsciiSPrint (\r
                      &Buffer[CharCount - 1],\r
-                     (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),\r
+                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
                      " %g",\r
                      CallerId\r
                      );\r
@@ -192,7 +178,7 @@ OemHookStatusCodeReport (
     if (Data != NULL) {\r
       CharCount += AsciiSPrint (\r
                      &Buffer[CharCount - 1],\r
-                     (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),\r
+                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
                      " %x",\r
                      Data\r
                      );\r
@@ -200,13 +186,13 @@ OemHookStatusCodeReport (
 \r
     CharCount += AsciiSPrint (\r
                    &Buffer[CharCount - 1],\r
-                   (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),\r
+                   (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
                    "\n\r"\r
                    );\r
   } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {\r
     CharCount = AsciiSPrint (\r
                   Buffer, \r
-                  EFI_STATUS_CODE_DATA_MAX_SIZE\r
+                  sizeof (Buffer)\r
                   "PROGRESS CODE: V%x I%x\n\r", \r
                   Value, \r
                   Instance\r
@@ -214,7 +200,7 @@ OemHookStatusCodeReport (
   } else {\r
     CharCount = AsciiSPrint (\r
                   Buffer, \r
-                  EFI_STATUS_CODE_DATA_MAX_SIZE\r
+                  sizeof (Buffer)\r
                   "Undefined: C%x:V%x I%x\n\r", \r
                   CodeType, \r
                   Value, \r