]> git.proxmox.com Git - mirror_edk2.git/commitdiff
recalculate the total size of format string printed by DebugPrint().
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 13 Aug 2009 02:33:05 +0000 (02:33 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 13 Aug 2009 02:33:05 +0000 (02:33 +0000)
To ensure constructed BaseListMarker can work on IPF, code preserves 4bytes to guarantee it's 64bits alignment. So the calculation algorithm on total size also should be updated.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9062 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c

index 29639e9424f6ce1a9ffdba21c71e32e29e76a615..339a002cd5449d1854e0373f986880eb2d83f74b 100644 (file)
@@ -68,9 +68,23 @@ DebugPrint (
   }\r
 \r
   //\r
-  // Compute the total size of the record\r
+  // Compute the total size of the record.\r
+  // Note that the passing-in format string and variable parameters will be constructed to \r
+  // the following layout:\r
   //\r
-  TotalSize = sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64) + AsciiStrSize (Format);\r
+  //         Buffer->|------------------------|\r
+  //                 |         Pading         | 4 bytes\r
+  //      DebugInfo->|------------------------|\r
+  //                 |      EFI_DEBUG_INFO    | sizeof(EFI_DEBUG_INFO)\r
+  // BaseListMarker->|------------------------|\r
+  //                 |           ...          |\r
+  //                 |   variable arguments   | 12 * sizeof (UINT64)\r
+  //                 |           ...          |\r
+  //                 |------------------------|\r
+  //                 |       Format String    |\r
+  //                 |------------------------|<- (UINT8 *)Buffer + sizeof(Buffer)\r
+  //\r
+  TotalSize = 4 + sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64) + AsciiStrSize (Format);\r
 \r
   //\r
   // If the TotalSize is larger than the maximum record size, then return\r