Fix SerialPortWrite call in MemLogfVA.

This commit is contained in:
jief666 2020-08-26 10:56:05 +03:00
parent 19ce4d6edf
commit 8703ccab7f
2 changed files with 7 additions and 6 deletions

View File

@ -452,7 +452,6 @@ MemLogfVA (
)
{
EFI_STATUS Status;
UINTN DataWritten;
CHAR8 *LastMessage;
if (Format == NULL) {
@ -488,17 +487,18 @@ MemLogfVA (
// Add log to buffer
//
LastMessage = mMemLog->Cursor;
UINTN TimingDataWritten = 0;
if (Timing) {
//
// Write timing only at the beginning of a new line
//
if ((mMemLog->Buffer[0] == '\0') || (mMemLog->Cursor[-1] == '\n')) {
DataWritten = AsciiSPrint(
TimingDataWritten = AsciiSPrint(
mMemLog->Cursor,
mMemLog->BufferSize - (mMemLog->Cursor - mMemLog->Buffer),
"%a ",
GetTiming ());
mMemLog->Cursor += DataWritten;
mMemLog->Cursor += TimingDataWritten;
}
}
@ -507,7 +507,7 @@ MemLogfVA (
// mMemLog->BufferSize - (mMemLog->Cursor - mMemLog->Buffer),
// Format,
// Marker);
DataWritten = vsnprintf(
/*DataWritten =*/ vsnprintf(
mMemLog->Cursor,
mMemLog->BufferSize - (mMemLog->Cursor - mMemLog->Buffer),
Format,
@ -534,7 +534,7 @@ MemLogfVA (
// Write to standard debug device also
//
// Jief : use SerialPortWrite instead of DebugPrint to avoid 256 chars message length limitation.
SerialPortWrite((UINT8*)LastMessage, LastMessageLen);
SerialPortWrite((UINT8*)LastMessage, TimingDataWritten+LastMessageLen);
// DebugPrint(DEBUG_INFO, "%a", LastMessage);
}

View File

@ -39,6 +39,7 @@
[BuildOptions]
XCODE:*_*_*_CC_FLAGS = -Os -fno-lto -UUSING_LTO -DMDEPKG_NDEBUG
GCC:*_*_*_CC_FLAGS = -Os -fno-lto -DMDEPKG_NDEBUG
GCC:RELEASE_*_*_CC_FLAGS = -Os -fno-lto -DMDEPKG_NDEBUG
GCC:DEBUG_*_*_CC_FLAGS = -fno-lto -DMDEPKG_NDEBUG
MSFT:*_*_*_CC_FLAGS =