[edk2-devel] [PATCH v1 1/6] ArmPkg: Add ArmMmuNullLib

Nate DeSimone nathaniel.l.desimone at intel.com
Mon Mar 6 00:22:00 UTC 2023


Adds a NULL implementation of the ArmMmuLib. This is nessesary for
ARM support in EmulatorPkg due to DxeIplPeim requiring an
implementation of ArmMmuLib.

Cc: Leif Lindholm <quic_llindhol at quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore at kernel.org>
Cc: Sami Mujawar <sami.mujawar at arm.com>
Cc: Michael D Kinney <michael.d.kinney at intel.com>
Cc: Chasel Chiu <chasel.chiu at intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone at intel.com>
---
 ArmPkg/ArmPkg.dsc                             |  2 +
 ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.c  | 84 +++++++++++++++++++
 .../Library/ArmMmuNullLib/ArmMmuNullLib.inf   | 36 ++++++++
 3 files changed, 122 insertions(+)
 create mode 100644 ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.c
 create mode 100644 ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.inf

diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
index 3fb95d1951..3dc2c21e9d 100644
--- a/ArmPkg/ArmPkg.dsc
+++ b/ArmPkg/ArmPkg.dsc
@@ -6,6 +6,7 @@
 # Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
 # Copyright (c) Microsoft Corporation.<BR>
 # Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
+# Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
 #
 #    SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -142,6 +143,7 @@
   ArmPkg/Filesystem/SemihostFs/SemihostFs.inf
 
   ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
+  ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.inf
 
   ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
   ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
diff --git a/ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.c b/ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.c
new file mode 100644
index 0000000000..f91582f86a
--- /dev/null
+++ b/ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.c
@@ -0,0 +1,84 @@
+/** @file
+  ARM MMU NULL Library
+
+Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2016, Linaro Ltd. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Uefi/UefiBaseType.h>
+#include <Library/ArmMmuLib.h>
+
+EFI_STATUS
+EFIAPI
+ArmConfigureMmu (
+  IN  ARM_MEMORY_REGION_DESCRIPTOR  *MemoryTable,
+  OUT VOID                          **TranslationTableBase OPTIONAL,
+  OUT UINTN                         *TranslationTableSize  OPTIONAL
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+EFI_STATUS
+EFIAPI
+ArmSetMemoryRegionNoExec (
+  IN  EFI_PHYSICAL_ADDRESS  BaseAddress,
+  IN  UINT64                Length
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+EFI_STATUS
+EFIAPI
+ArmClearMemoryRegionNoExec (
+  IN  EFI_PHYSICAL_ADDRESS  BaseAddress,
+  IN  UINT64                Length
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+EFI_STATUS
+EFIAPI
+ArmSetMemoryRegionReadOnly (
+  IN  EFI_PHYSICAL_ADDRESS  BaseAddress,
+  IN  UINT64                Length
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+EFI_STATUS
+EFIAPI
+ArmClearMemoryRegionReadOnly (
+  IN  EFI_PHYSICAL_ADDRESS  BaseAddress,
+  IN  UINT64                Length
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+VOID
+EFIAPI
+ArmReplaceLiveTranslationEntry (
+  IN  UINT64   *Entry,
+  IN  UINT64   Value,
+  IN  UINT64   RegionStart,
+  IN  BOOLEAN  DisableMmu
+  )
+{
+  return;
+}
+
+EFI_STATUS
+ArmSetMemoryAttributes (
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
+  IN UINT64                Length,
+  IN UINT64                Attributes
+  )
+{
+  return EFI_UNSUPPORTED;
+}
diff --git a/ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.inf b/ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.inf
new file mode 100644
index 0000000000..fa6791f3d9
--- /dev/null
+++ b/ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.inf
@@ -0,0 +1,36 @@
+## @file
+#  Module Information description file for ARM MMU NULL Library
+#
+#  For user space environments like EmulatorPkg
+#
+#  Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010017
+  BASE_NAME                      = ArmMmuNullLib
+  FILE_GUID                      = E61735C8-DD00-4C4A-B07B-FD71A67C239D
+  VERSION_STRING                 = 1.0
+  MODULE_TYPE                    = BASE
+  LIBRARY_CLASS                  = ArmMmuLib
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES ARM AARCH64
+#
+
+[LibraryClasses]
+
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  MdePkg/MdePkg.dec
+
+[Pcd]
+
+[Sources]
+  ArmMmuNullLib.c
+
+[Guids]
-- 
2.30.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100705): https://edk2.groups.io/g/devel/message/100705
Mute This Topic: https://groups.io/mt/97414909/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