Hello Leif,

I think the following files:
- ArmPkg/Include/Chipset/AArch64.h
- ArmPkg/Include/Chipset/AArch64Mmu.h
- ArmPkg/Include/Chipset/ArmV7.h
- ArmPkg/Include/Chipset/ArmV7Mmu.h
also need to be moved to the MdePkg. Otherwise the MdePkg
would depend on the ArmPkg, cf. ArmLib.h:

#ifdef MDE_CPU_ARM
  #include <Chipset/ArmV7.h>
#elif defined (MDE_CPU_AARCH64)
  #include <Chipset/AArch64.h>

Depending on where these files are placed in the MdePkg, this
might imply some renaming to include them. Meaning that all
  #include <Chipset/AArch64.h>
might need to be renamed
  #include <[New path]/AArch64.h>
but it should be ok.

A ArmLibNull.inf library might also need to be created. If the
OpensslLibFullAccel.inf module will depend on the ArmLib library,
a Null implementation will be necessary for non-Arm architectures.

Otherwise I could apply and run the CryptoPkg/Arm native instructions
patchset on top of this patch.

---

As a side note, it also seems that:
- ArmPkg/Include/Chipset/ArmCortexA5x.h
  isn't used anymore in edk2/edk2-platorms
- ArmPkg/Include/Chipset/ArmCortexA9.h
  is barely used in edk2-platforms.
Maybe the files should have been removed/simplified as part of
- cffa7925a293 ("ArmPkg: remove ArmCpuLib header and implementations")
- a913ad02479d ("ArmPlatformPkg: remove ArmVExpressPkg")

Regards,
Pierre

On 11/21/23 17:42, Leif Lindholm wrote:
Related to https://bugzilla.tianocore.org/show_bug.cgi?id=4121, but not
resolving it. (Nearly?) all of ArmPkg describes industry standard
behaviour, and hence according to general rules, ought to live in MdePkg.

Addressing this will however be a substantial task.
Take a first step by moving the ArmLib interface definition to MdePkg,
as discussed in
https://edk2.groups.io/g/devel/topic/patch_v5_2_6/102725178

Cc: Pierre Gondois <pierre.gond...@arm.com>
Cc: Jiewen Yao <jiewen....@intel.com>
Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>
Cc: Liming Gao <gaolim...@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kin...@intel.com>
Cc: Sami Mujawar <sami.muja...@arm.com>
Cc: Zhiguang Liu <zhiguang....@intel.com>
Signed-off-by: Leif Lindholm <quic_llind...@quicinc.com>
---

This should have no functional differences (and the set of
platforms I have test built didn't find any problems).
This may result in some modules depending on ArmPkg only
for ArmLib now being able to drop ArmPkg dependency.

  ArmPkg/ArmPkg.dec                           | 4 ----
  MdePkg/MdePkg.dec                           | 5 +++++
  {ArmPkg => MdePkg}/Include/Library/ArmLib.h | 0
  Maintainers.txt                             | 6 ++++++
  4 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec
index 7fe2b9bca43b..4ce59f3e1fbd 100644
--- a/ArmPkg/ArmPkg.dec
+++ b/ArmPkg/ArmPkg.dec
@@ -50,10 +50,6 @@ [LibraryClasses.common]
    #
    ArmHvcLib|Include/Library/ArmHvcLib.h
- ## @libraryclass Provides an interface to Arm registers.
-  #
-  ArmLib|Include/Library/ArmLib.h
-
    ##  @libraryclass  Provides a Mmu interface.
    #
    ArmMmuLib|Include/Library/ArmMmuLib.h
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index ac54338089e8..78e18ee444cd 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -339,6 +339,11 @@ [LibraryClasses.RISCV64]
    ##  @libraryclass  Provides function to make ecalls to SBI
    BaseRiscVSbiLib|Include/Library/BaseRiscVSbiLib.h
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
+  ##  @libraryclass  Provides an interface to Arm registers.
+  #
+  ArmLib|Include/Library/ArmLib.h
+
  [Guids]
    #
    # GUID defined in UEFI2.1/UEFI2.0/EFI1.1
diff --git a/ArmPkg/Include/Library/ArmLib.h b/MdePkg/Include/Library/ArmLib.h
similarity index 100%
rename from ArmPkg/Include/Library/ArmLib.h
rename to MdePkg/Include/Library/ArmLib.h
diff --git a/Maintainers.txt b/Maintainers.txt
index 7c0b4cb58cfd..0315fa23dfce 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -450,6 +450,12 @@ M: Abner Chang <abner.ch...@amd.com> [changab]
  R: Abdul Lateef Attar <abdullateef.at...@amd.com> [abdattar]
  R: Nickle Wang <nick...@nvidia.com> [nicklela]
+MdePkg: ARM/AARCH64 standard interfaces
+F: MdePkg/Include/Library/ArmLib.h
+M: Leif Lindholm <quic_llind...@quicinc.com> [leiflindholm]
+M: Ard Biesheuvel <ardb+tianoc...@kernel.org> [ardbiesheuvel]
+R: Sami Mujawar <sami.muja...@arm.com> [samimujawar]
+
  NetworkPkg
  F: NetworkPkg/
  W: https://github.com/tianocore/tianocore.github.io/wiki/NetworkPkg


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112809): https://edk2.groups.io/g/devel/message/112809
Mute This Topic: https://groups.io/mt/102731845/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to