\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
#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
...\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
//\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
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