#include <FrameworkPei.h>\r
\r
#include <Guid/StatusCodeDataTypeId.h>\r
+#include <Guid/StatusCodeDataTypeDebug.h>\r
\r
#include <Library/ReportStatusCodeLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/OemHookStatusCodeLib.h>\r
#include <Library/PcdLib.h>\r
\r
-#include <DebugInfo.h>\r
-\r
//\r
// Define the maximum extended data size that is supported in the PEI phase\r
//\r
*ErrorLevel = DebugInfo->ErrorLevel;\r
\r
//\r
- // The first 12 * UINTN bytes of the string are really an\r
- // argument stack to support varargs on the Format string.\r
+ // The first 12 * sizeof (UINT64) bytes following EFI_DEBUG_INFO are for variable arguments\r
+ // of format in DEBUG string. Its address is returned in Marker and has to be 64-bit aligned.\r
+ // It must be noticed that EFI_DEBUG_INFO follows EFI_STATUS_CODE_DATA, whose size is\r
+ // 20 bytes. The size of EFI_DEBUG_INFO is 4 bytes, so we can ensure that Marker\r
+ // returned is 64-bit aligned.\r
+ // 64-bit aligned is a must, otherwise retrieving 64-bit parameter from BASE_LIST will\r
+ // cause unalignment exception.\r
//\r
*Marker = (BASE_LIST) (DebugInfo + 1);\r
*Format = (CHAR8 *)(((UINT64 *)*Marker) + 12);\r