mirror of https://github.com/acidanthera/audk.git
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/trunk/edk2@9062 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
fd7544c655
commit
0fac539f37
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue