[edk2-devel] [PATCH v2 09/16] MdeModulePkg: Swap to MmuLib instead of Arm-specific lib

Bret Barkelew bret at corthon.com
Tue Nov 2 20:17:41 UTC 2021


From: Bret Barkelew <brbarkel at microsoft.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3651

Cc: Jian J Wang <jian.j.wang at intel.com>
Cc: Liming Gao <gaoliming at byosoft.com.cn>
Cc: Dandan Bi <dandan.bi at intel.com>
Cc: Liming Gao <gaoliming at byosoft.com.cn>
Cc: Sean Brogan <sean.brogan at microsoft.com>
Signed-off-by: Bret Barkelew <bret.barkelew at microsoft.com>
---
 MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c | 4 ++--
 MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf        | 4 +---
 MdeModulePkg/MdeModulePkg.dsc                  | 3 +--
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c
index 6619a650661b..16c20930a662 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c
+++ b/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c
@@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #include "DxeIpl.h"
 
-#include <Library/ArmMmuLib.h>
+#include <Library/MmuLib.h>
 
 /**
    Transfers control to DxeCore.
@@ -40,7 +40,7 @@ HandOffToDxeCore (
   ASSERT (BaseOfStack != NULL);
 
   if (PcdGetBool (PcdSetNxForStack)) {
-    Status = ArmSetMemoryRegionNoExec ((UINTN)BaseOfStack, STACK_SIZE);
+    Status = MmuSetAttributes ((UINTN)BaseOfStack, STACK_SIZE, EFI_MEMORY_XP);
     ASSERT_EFI_ERROR (Status);
   }
 
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
index 19b8a4c8aefa..3634d836548f 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
@@ -57,8 +57,6 @@ [Packages]
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
 
-[Packages.ARM, Packages.AARCH64]
-  ArmPkg/ArmPkg.dec
 
 [LibraryClasses]
   PcdLib
@@ -77,7 +75,7 @@ [LibraryClasses]
   PerformanceLib
 
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
-  ArmMmuLib
+  MmuLib
 
 [Ppis]
   gEfiDxeIplPpiGuid                      ## PRODUCES
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index ab505f5bb2c6..20790145d5bf 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -103,6 +103,7 @@ [LibraryClasses]
   DisplayUpdateProgressLib|MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/DisplayUpdateProgressLibGraphics.inf
   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
   MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf
+  MmuLib|MdePkg/Library/BaseMmuLibNull/BaseMmuLibNull.inf
 
 [LibraryClasses.EBC.PEIM]
   IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf
@@ -174,8 +175,6 @@ [LibraryClasses.common.MM_STANDALONE]
   MemLib|StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf
 
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
-  ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
-  ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
   LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf
 
   #
-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#83168): https://edk2.groups.io/g/devel/message/83168
Mute This Topic: https://groups.io/mt/86776051/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list