From: "Nate DeSimone" <nathaniel.l.desimone@intel.com>
To: devel@edk2.groups.io
Cc: Leif Lindholm <quic_llindhol@quicinc.com>,
Ard Biesheuvel <ardb+tianocore@kernel.org>,
Sami Mujawar <sami.mujawar@arm.com>,
Michael D Kinney <michael.d.kinney@intel.com>,
Chasel Chiu <chasel.chiu@intel.com>
Subject: [PATCH v1 1/6] ArmPkg: Add ArmMmuNullLib
Date: Sun, 5 Mar 2023 16:22:00 -0800 [thread overview]
Message-ID: <20230306002205.1640-2-nathaniel.l.desimone@intel.com> (raw)
In-Reply-To: <20230306002205.1640-1-nathaniel.l.desimone@intel.com>
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@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@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
next prev parent reply other threads:[~2023-03-06 0:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-06 0:21 [PATCH v1 0/6] Add Raspberry Pi Support to EmulatorPkg Nate DeSimone
2023-03-06 0:22 ` Nate DeSimone [this message]
2023-03-06 0:22 ` [PATCH v1 2/6] EmulatorPkg: Add ARM Build Target Nate DeSimone
2023-03-06 0:22 ` [PATCH v1 3/6] EmulatorPkg: Fix PosixFileSystem function misspellings Nate DeSimone
2023-03-06 0:22 ` [PATCH v1 4/6] EmulatorPkg: Add ARM support to UNIX Host App Nate DeSimone
2023-03-06 0:22 ` [PATCH v1 5/6] EmulatorPkg: Add ARM support to EmuSec Nate DeSimone
2023-03-06 0:22 ` [PATCH v1 6/6] EmulatorPkg: Add EmuCacheMaintenanceLib Nate DeSimone
2023-03-10 16:45 ` [edk2-devel] [PATCH v1 0/6] Add Raspberry Pi Support to EmulatorPkg Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230306002205.1640-2-nathaniel.l.desimone@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox