]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c
Update comments.
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / PeiReportStatusCodeLib / ReportStatusCodeLib.c
index 9bd3109121931c99efcde79b96e33f2bfcc2f7bb..24606289c02db0df410ce07ecf551a24a88b6adf 100644 (file)
@@ -16,6 +16,7 @@
 #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
@@ -25,8 +26,6 @@
 #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
@@ -261,8 +260,13 @@ ReportStatusCodeExtractDebugInfo (
   *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