Skip to content

Commit

Permalink
Switch MmCoreArm advanced logger to use updated MMU functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cfernald committed Feb 7, 2024
1 parent 71b2167 commit 06141ff
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,20 @@ 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 = ArmSetMemoryRegionNoExec (Address, EFI_PAGE_SIZE);
Status = ArmClearMemoryRegionReadOnly (Address, EFI_PAGE_SIZE);
Status = ArmSetMemoryAttributes (
Address,
EFI_PAGE_SIZE,
EFI_MEMORY_XP,
EFI_MEMORY_ACCESS_MASK
);

Address = ALIGN_VALUE ((EFI_PHYSICAL_ADDRESS)(UINTN)&mLoggerInfo - EFI_PAGE_SIZE + 1, EFI_PAGE_SIZE);
Status = ArmSetMemoryRegionNoExec (Address, EFI_PAGE_SIZE);
Status = ArmClearMemoryRegionReadOnly (Address, EFI_PAGE_SIZE);
Status = ArmSetMemoryAttributes (
Address,
EFI_PAGE_SIZE,
EFI_MEMORY_XP,
EFI_MEMORY_ACCESS_MASK
);

mInitialized = TRUE; // Only allow initialization once
mLoggerInfo = (ADVANCED_LOGGER_INFO *)(VOID *)FixedPcdGet64 (PcdAdvancedLoggerBase);
Expand Down

0 comments on commit 06141ff

Please sign in to comment.