diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.c b/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.c index 84919179cd..e2e7b429cc 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.c +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/PeiCore/AdvancedLoggerLib.c @@ -14,13 +14,6 @@ #include #include -VOID -EFIAPI -InternalPrintMessage ( - IN CONST CHAR8 *Format, - ... - ); - /** Including the PeiMain.h from PeiCore in order to access the Platform Blob data member. @@ -214,13 +207,11 @@ InstallPermanentMemoryBuffer ( // // Must be PeiCore allocated small memory buffer // - Status = PeiServicesAllocatePages ( EfiReservedMemoryType, FixedPcdGet32 (PcdAdvancedLoggerPages), &NewLogBuffer ); - if (!EFI_ERROR (Status)) { NewLoggerInfo = ALI_FROM_PA (NewLogBuffer); CopyMem ((VOID *)NewLoggerInfo, (VOID *)LoggerInfo, sizeof (ADVANCED_LOGGER_INFO)); @@ -452,19 +443,20 @@ AdvancedLoggerGetLoggerInfo ( VOID ) { - UINTN BufferSize; - EFI_HOB_GUID_TYPE *GuidHob; - EFI_HOB_GUID_TYPE *GuidHobInterim; - EFI_HOB_GUID_TYPE *GuidHobInterimBuf; - PEI_CORE_INSTANCE *PeiCoreInstance; - ADVANCED_LOGGER_INFO *LoggerInfo; - ADVANCED_LOGGER_INFO *LoggerInfoSec; - ADVANCED_LOGGER_PTR *LogPtr; - EFI_PHYSICAL_ADDRESS NewLoggerInfo; - UINTN Pages; - CONST EFI_PEI_SERVICES **PeiServices; - EFI_STATUS Status; - EFI_MEMORY_TYPE Type; + UINTN BufferSize; + EFI_HOB_GUID_TYPE *GuidHob; + EFI_HOB_GUID_TYPE *GuidHobInterim; + EFI_HOB_GUID_TYPE *GuidHobInterimBuf; + PEI_CORE_INSTANCE *PeiCoreInstance; + ADVANCED_LOGGER_INFO *LoggerInfo; + ADVANCED_LOGGER_INFO *LoggerInfoSec; + ADVANCED_LOGGER_PTR *LogPtr; + EFI_PHYSICAL_ADDRESS NewLoggerInfo; + UINTN Pages; + CONST EFI_PEI_SERVICES **PeiServices; + EFI_STATUS Status; + EFI_MEMORY_TYPE Type; + ADVANCED_LOGGER_MESSAGE_ENTRY_V2 *LogEntry; // Try to do the minimum work at the start of this function as this // is called quite often. @@ -614,7 +606,7 @@ AdvancedLoggerGetLoggerInfo ( // If we have an interim buffer, copy it to the new buffer // LoggerInfo = (ADVANCED_LOGGER_INFO *)GET_GUID_HOB_DATA (GuidHobInterimBuf); - ADVANCED_LOGGER_MESSAGE_ENTRY_V2 *LogEntry = (ADVANCED_LOGGER_MESSAGE_ENTRY_V2 *)LoggerInfo->LogBuffer; + LogEntry = (ADVANCED_LOGGER_MESSAGE_ENTRY_V2 *)(UINTN)LoggerInfo->LogBuffer; AdvancedLoggerMemoryLoggerWrite (LogEntry->DebugLevel, LogEntry->MessageText, LogEntry->MessageLen); GuidHobInterimBuf = GetNextGuidHob (&gAdvancedLoggerInterimHobGuid, GuidHobInterimBuf); }