]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
Update comments.
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / PeiDxeDebugLibReportStatusCode / DebugLib.c
index 3c9e03527fd8fa5bdec53364daf689cf645e2b4e..4898d8126049dc400f3bc4a1683f675f334a92d7 100644 (file)
@@ -15,8 +15,8 @@
 \r
 \r
 #include <FrameworkPei.h>\r
-#include <FrameworkModuleBase.h>\r
 #include <Guid/StatusCodeDataTypeId.h>\r
+#include <Guid/StatusCodeDataTypeDebug.h>\r
 \r
 #include <Library/DebugLib.h>\r
 #include <Library/BaseLib.h>\r
@@ -24,8 +24,6 @@
 #include <Library/ReportStatusCodeLib.h>\r
 #include <Library/PcdLib.h>\r
 \r
-#include <DebugInfo.h>\r
-\r
 /**\r
 \r
   Prints a debug message to the debug output device if the specified error level is enabled.\r
@@ -50,7 +48,7 @@ DebugPrint (
   ...\r
   )\r
 {\r
-  UINT64          Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64)];\r
+  UINT64          Buffer[(EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64)) + 1];\r
   EFI_DEBUG_INFO  *DebugInfo;\r
   UINTN           TotalSize;\r
   VA_LIST         VaListMarker;\r
@@ -76,22 +74,17 @@ DebugPrint (
   //\r
   TotalSize = sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64) + AsciiStrLen (Format) + 1;\r
 \r
-  //\r
-  // If the TotalSize is larger than the maximum record size, then ASSERT()\r
-  //\r
-  ASSERT (TotalSize <= EFI_STATUS_CODE_DATA_MAX_SIZE);\r
-\r
   //\r
   // If the TotalSize is larger than the maximum record size, then return\r
   //\r
-  if (TotalSize > EFI_STATUS_CODE_DATA_MAX_SIZE) {\r
+  if (TotalSize > sizeof (Buffer)) {\r
     return;\r
   }\r
 \r
   //\r
   // Fill in EFI_DEBUG_INFO\r
   //\r
-  DebugInfo             = (EFI_DEBUG_INFO *)Buffer;\r
+  DebugInfo             = (EFI_DEBUG_INFO *)(Buffer) + 1;\r
   DebugInfo->ErrorLevel = (UINT32)ErrorLevel;\r
   BaseListMarker        = (BASE_LIST)(DebugInfo + 1);\r
   FormatString          = (CHAR8 *)((UINT64 *)(DebugInfo + 1) + 12);\r
@@ -260,7 +253,7 @@ DebugAssert (
   FileNameLength    = AsciiStrLen (FileName);\r
   DescriptionLength = AsciiStrLen (Description);\r
   TotalSize = sizeof (EFI_DEBUG_ASSERT_DATA) + FileNameLength + 1 + DescriptionLength + 1;\r
-  if (TotalSize <= EFI_STATUS_CODE_DATA_MAX_SIZE) {\r
+  if (TotalSize <= sizeof (Buffer)) {\r
     //\r
     // Fill in EFI_DEBUG_ASSERT_DATA\r
     //\r