summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Lindholm <leif@nuviainc.com>2020-12-18 12:22:32 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-12-18 15:27:26 +0000
commit319138d3f6df83711dcbb0a285cbc6417adee820 (patch)
treee6a2919343f385acbea835d84bbac4f624c48a8d
parentb7ae5efb79919a1e7bd893ad2e612456ebb608d3 (diff)
downloadedk2-319138d3f6df83711dcbb0a285cbc6417adee820.tar.gz
edk2-319138d3f6df83711dcbb0a285cbc6417adee820.tar.bz2
edk2-319138d3f6df83711dcbb0a285cbc6417adee820.zip
ArmPkg: remove duplicated ARM/AArch64 ArmGicArchLib sources
The ID register access was the only difference between them, so after switching to the ArmHasGicSystemRegisters () helper, there is no longer any need to have separate ARM/AArch64 source files for ArmGicArchLib, so unify them and drop the subdirectories. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Signed-off-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
-rw-r--r--ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c60
-rw-r--r--ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.c (renamed from ArmPkg/Library/ArmGicArchLib/AArch64/ArmGicArchLib.c)0
-rw-r--r--ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf7
3 files changed, 2 insertions, 65 deletions
diff --git a/ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c b/ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c
deleted file mode 100644
index 7e7e46e69f..0000000000
--- a/ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/** @file
-*
-* Copyright (c) 2014, ARM Limited. All rights reserved.
-*
-* SPDX-License-Identifier: BSD-2-Clause-Patent
-*
-**/
-
-#include <Library/ArmLib.h>
-#include <Library/ArmGicLib.h>
-
-STATIC ARM_GIC_ARCH_REVISION mGicArchRevision;
-
-RETURN_STATUS
-EFIAPI
-ArmGicArchLibInitialize (
- VOID
- )
-{
- UINT32 IccSre;
-
- // Ideally we would like to use the GICC IIDR Architecture version here, but
- // this does not seem to be very reliable as the implementation could easily
- // get it wrong. It is more reliable to check if the GICv3 System Register
- // feature is implemented on the CPU. This is also convenient as our GICv3
- // driver requires SRE. If only Memory mapped access is available we try to
- // drive the GIC as a v2.
- if (ArmHasGicSystemRegisters ()) {
- // Make sure System Register access is enabled (SRE). This depends on the
- // higher privilege level giving us permission, otherwise we will either
- // cause an exception here, or the write doesn't stick in which case we need
- // to fall back to the GICv2 MMIO interface.
- // Note: We do not need to set ICC_SRE_EL2.Enable because the OS is started
- // at the same exception level.
- // It is the OS responsibility to set this bit.
- IccSre = ArmGicV3GetControlSystemRegisterEnable ();
- if (!(IccSre & ICC_SRE_EL2_SRE)) {
- ArmGicV3SetControlSystemRegisterEnable (IccSre| ICC_SRE_EL2_SRE);
- IccSre = ArmGicV3GetControlSystemRegisterEnable ();
- }
- if (IccSre & ICC_SRE_EL2_SRE) {
- mGicArchRevision = ARM_GIC_ARCH_REVISION_3;
- goto Done;
- }
- }
-
- mGicArchRevision = ARM_GIC_ARCH_REVISION_2;
-
-Done:
- return RETURN_SUCCESS;
-}
-
-ARM_GIC_ARCH_REVISION
-EFIAPI
-ArmGicGetSupportedArchRevision (
- VOID
- )
-{
- return mGicArchRevision;
-}
diff --git a/ArmPkg/Library/ArmGicArchLib/AArch64/ArmGicArchLib.c b/ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.c
index 6fd69658e0..6fd69658e0 100644
--- a/ArmPkg/Library/ArmGicArchLib/AArch64/ArmGicArchLib.c
+++ b/ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.c
diff --git a/ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf b/ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf
index 92ac11c2f5..bedddff939 100644
--- a/ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf
+++ b/ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf
@@ -14,11 +14,8 @@
LIBRARY_CLASS = ArmGicArchLib|DXE_DRIVER UEFI_DRIVER UEFI_APPLICATION
CONSTRUCTOR = ArmGicArchLibInitialize
-[Sources.ARM]
- Arm/ArmGicArchLib.c
-
-[Sources.AARCH64]
- AArch64/ArmGicArchLib.c
+[Sources]
+ ArmGicArchLib.c
[Packages]
MdePkg/MdePkg.dec