Skip to content

Commit

Permalink
Switch to non-arm implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
cfernald committed Feb 7, 2024
1 parent 06141ff commit 88fda9c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/SynchronizationLib.h>
#include <Library/ArmMmuLib.h>
#include <Library/MmuLib.h>

#include "../AdvancedLoggerCommon.h"

Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
BaseMemoryLib
DebugLib
SynchronizationLib
ArmMmuLib
MmuLib

[Guids]
gAdvancedLoggerHobGuid
Expand Down

0 comments on commit 88fda9c

Please sign in to comment.