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_llind...@quicinc.com> Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org> Cc: Sami Mujawar <sami.muja...@arm.com> Cc: Michael D Kinney <michael.d.kin...@intel.com> Cc: Chasel Chiu <chasel.c...@intel.com> Signed-off-by: Nate DeSimone <nathaniel.l.desim...@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/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-