summaryrefslogtreecommitdiffstats
path: root/IntelFrameworkModulePkg
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-07-30 08:34:20 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-07-30 08:34:20 +0000
commit11c62012114d0da49bc6a9f6b087f3409320a633 (patch)
treed60a83ece8cd1b88495f1b4d41f96c92a41958dc /IntelFrameworkModulePkg
parentb6193b1ab9a59bbb68803595112e8d9d7404cf88 (diff)
downloadedk2-11c62012114d0da49bc6a9f6b087f3409320a633.tar.gz
Sync patch r9062 from main trunk.
r9062 - Recalculate the total size of format string printed by DebugPrint(). 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/branches/UDK2008@10723 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r--IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c b/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
index 29639e9424..339a002cd5 100644
--- a/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
+++ b/IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
@@ -68,9 +68,23 @@ DebugPrint (
}
//
- // Compute the total size of the record
+ // Compute the total size of the record.
+ // Note that the passing-in format string and variable parameters will be constructed to
+ // the following layout:
//
- TotalSize = sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64) + AsciiStrSize (Format);
+ // Buffer->|------------------------|
+ // | Pading | 4 bytes
+ // DebugInfo->|------------------------|
+ // | EFI_DEBUG_INFO | sizeof(EFI_DEBUG_INFO)
+ // BaseListMarker->|------------------------|
+ // | ... |
+ // | variable arguments | 12 * sizeof (UINT64)
+ // | ... |
+ // |------------------------|
+ // | Format String |
+ // |------------------------|<- (UINT8 *)Buffer + sizeof(Buffer)
+ //
+ TotalSize = 4 + sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64) + AsciiStrSize (Format);
//
// If the TotalSize is larger than the maximum record size, then return