summaryrefslogtreecommitdiff
path: root/ArmPkg/Library/ArmGicArchSecLib
diff options
context:
space:
mode:
authorLeif Lindholm <leif@nuviainc.com>2020-12-18 12:28:25 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-12-18 15:27:26 +0000
commit7bb8dd9f9844802eb6ae2c8fcd8c2ff613570583 (patch)
tree43735d55f8c90b9449edb8297e47c4dce34a00d5 /ArmPkg/Library/ArmGicArchSecLib
parent319138d3f6df83711dcbb0a285cbc6417adee820 (diff)
downloadedk2-7bb8dd9f9844802eb6ae2c8fcd8c2ff613570583.zip
edk2-7bb8dd9f9844802eb6ae2c8fcd8c2ff613570583.tar.gz
edk2-7bb8dd9f9844802eb6ae2c8fcd8c2ff613570583.tar.bz2
ArmPkg: remove duplicated ARM/AArch64 ArmGicArchSecLib 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 ArmGicArchSecLib, 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>
Diffstat (limited to 'ArmPkg/Library/ArmGicArchSecLib')
-rw-r--r--ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c45
-rw-r--r--ArmPkg/Library/ArmGicArchSecLib/ArmGicArchLib.c (renamed from ArmPkg/Library/ArmGicArchSecLib/AArch64/ArmGicArchLib.c)0
-rw-r--r--ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf7
3 files changed, 2 insertions, 50 deletions
diff --git a/ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c b/ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c
deleted file mode 100644
index 2373ca4..0000000
--- a/ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c
+++ /dev/null
@@ -1,45 +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>
-
-ARM_GIC_ARCH_REVISION
-EFIAPI
-ArmGicGetSupportedArchRevision (
- 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) {
- return ARM_GIC_ARCH_REVISION_3;
- }
- }
-
- return ARM_GIC_ARCH_REVISION_2;
-}
diff --git a/ArmPkg/Library/ArmGicArchSecLib/AArch64/ArmGicArchLib.c b/ArmPkg/Library/ArmGicArchSecLib/ArmGicArchLib.c
index ca81951..ca81951 100644
--- a/ArmPkg/Library/ArmGicArchSecLib/AArch64/ArmGicArchLib.c
+++ b/ArmPkg/Library/ArmGicArchSecLib/ArmGicArchLib.c
diff --git a/ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf b/ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf
index 1a1179a..ccebabe 100644
--- a/ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf
+++ b/ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf
@@ -13,11 +13,8 @@
VERSION_STRING = 1.0
LIBRARY_CLASS = ArmGicArchLib|SEC
-[Sources.ARM]
- Arm/ArmGicArchLib.c
-
-[Sources.AARCH64]
- AArch64/ArmGicArchLib.c
+[Sources]
+ ArmGicArchLib.c
[Packages]
MdePkg/MdePkg.dec