From 88fda9cb6535930f39cd1d7eedb99b642a2ec5da Mon Sep 17 00:00:00 2001 From: Chris Fernald Date: Wed, 7 Feb 2024 05:21:24 -0800 Subject: [PATCH] Switch to non-arm implementation --- .../MmCoreArm/AdvancedLoggerLib.c | 22 ++++++++----------- .../MmCoreArm/AdvancedLoggerLib.inf | 2 +- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c b/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c index f46574806d..0cf4ad5217 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include "../AdvancedLoggerCommon.h" @@ -114,20 +114,16 @@ AdvancedLoggerGetLoggerInfo ( // If this is the first time for MM core to get here, the memory attributes of this module // may not be fully set yet. Thus set the memory for global variables attributes to RW first. Address = ALIGN_VALUE ((EFI_PHYSICAL_ADDRESS)(UINTN)&mInitialized - EFI_PAGE_SIZE + 1, EFI_PAGE_SIZE); - Status = ArmSetMemoryAttributes ( - Address, - EFI_PAGE_SIZE, - EFI_MEMORY_XP, - EFI_MEMORY_ACCESS_MASK - ); + Status = MmuSetAttributes (Address, EFI_PAGE_SIZE, EFI_MEMORY_XP); + ASSERT_EFI_ERROR (Status); + Status = MmuClearAttributes (Address, EFI_PAGE_SIZE, EFI_MEMORY_RO); + ASSERT_EFI_ERROR (Status); Address = ALIGN_VALUE ((EFI_PHYSICAL_ADDRESS)(UINTN)&mLoggerInfo - EFI_PAGE_SIZE + 1, EFI_PAGE_SIZE); - Status = ArmSetMemoryAttributes ( - Address, - EFI_PAGE_SIZE, - EFI_MEMORY_XP, - EFI_MEMORY_ACCESS_MASK - ); + Status = MmuSetAttributes (Address, EFI_PAGE_SIZE, EFI_MEMORY_XP); + ASSERT_EFI_ERROR (Status); + Status = MmuClearAttributes (Address, EFI_PAGE_SIZE, EFI_MEMORY_RO); + ASSERT_EFI_ERROR (Status); mInitialized = TRUE; // Only allow initialization once mLoggerInfo = (ADVANCED_LOGGER_INFO *)(VOID *)FixedPcdGet64 (PcdAdvancedLoggerBase); diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.inf b/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.inf index b4f06d49d3..7bf5cdb9dd 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.inf +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.inf @@ -36,7 +36,7 @@ BaseMemoryLib DebugLib SynchronizationLib - ArmMmuLib + MmuLib [Guids] gAdvancedLoggerHobGuid