diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/DxeCore/AdvancedLoggerLib.c b/AdvLoggerPkg/Library/AdvancedLoggerLib/DxeCore/AdvancedLoggerLib.c index 1f76d905b0..f85f5edb96 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/DxeCore/AdvancedLoggerLib.c +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/DxeCore/AdvancedLoggerLib.c @@ -384,8 +384,13 @@ DxeCoreAdvancedLoggerLibConstructor ( LoggerInfo->LogBufferSize = EFI_PAGES_TO_SIZE (FixedPcdGet32 (PcdAdvancedLoggerPages)) - sizeof (ADVANCED_LOGGER_INFO); LoggerInfo->LogCurrent = LoggerInfo->LogBuffer; LoggerInfo->HwPrintLevel = FixedPcdGet32 (PcdAdvancedLoggerHdwPortDebugPrintErrorLevel); - mMaxAddress = LoggerInfo->LogBuffer + LoggerInfo->LogBufferSize; - mBufferSize = LoggerInfo->LogBufferSize; + if (LoggerInfo->HdwPortInitialized == FALSE) { + AdvancedLoggerHdwPortInitialize (); + LoggerInfo->HdwPortInitialized = TRUE; + } + + mMaxAddress = LoggerInfo->LogBuffer + LoggerInfo->LogBufferSize; + mBufferSize = LoggerInfo->LogBufferSize; } else { DEBUG ((DEBUG_ERROR, "%a: Error allocating Advanced Logger Buffer\n", __FUNCTION__)); }