]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: use ID register helper for ArmGicArch(Sec)Lib
authorLeif Lindholm <leif@nuviainc.com>
Fri, 18 Dec 2020 12:05:44 +0000 (12:05 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 18 Dec 2020 15:27:26 +0000 (15:27 +0000)
Use ArmHasGicSystemRegisters () instead of direct ID register tests.

Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
ArmPkg/Library/ArmGicArchLib/AArch64/ArmGicArchLib.c
ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c
ArmPkg/Library/ArmGicArchSecLib/AArch64/ArmGicArchLib.c
ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c

index 4086a294dafdb178e3c17d7332f54cb1cf873d08..6fd69658e0e57d1414afc5f40271281cb8151d9d 100644 (file)
@@ -25,7 +25,7 @@ ArmGicArchLibInitialize (
   // feature is implemented on the CPU. This is also convenient as our GICv3\r
   // driver requires SRE. If only Memory mapped access is available we try to\r
   // drive the GIC as a v2.\r
-  if (ArmReadIdPfr0 () & AARCH64_PFR0_GIC) {\r
+  if (ArmHasGicSystemRegisters ()) {\r
     // Make sure System Register access is enabled (SRE). This depends on the\r
     // higher privilege level giving us permission, otherwise we will either\r
     // cause an exception here, or the write doesn't stick in which case we need\r
index 222d8059825d0817c9757919492c242c9b8074f6..7e7e46e69faac1ac6681b21665e08f5e7b173c1e 100644 (file)
@@ -25,7 +25,7 @@ ArmGicArchLibInitialize (
   // feature is implemented on the CPU. This is also convenient as our GICv3\r
   // driver requires SRE. If only Memory mapped access is available we try to\r
   // drive the GIC as a v2.\r
-  if (ArmReadIdPfr1 () & ARM_PFR1_GIC) {\r
+  if (ArmHasGicSystemRegisters ()) {\r
     // Make sure System Register access is enabled (SRE). This depends on the\r
     // higher privilege level giving us permission, otherwise we will either\r
     // cause an exception here, or the write doesn't stick in which case we need\r
index 4f2479e70c74882d31f68b9f2a84c7529491ec9d..ca81951b2b2bdae93724255ec0777bfa1872f1a1 100644 (file)
@@ -23,7 +23,7 @@ ArmGicGetSupportedArchRevision (
   // feature is implemented on the CPU. This is also convenient as our GICv3\r
   // driver requires SRE. If only Memory mapped access is available we try to\r
   // drive the GIC as a v2.\r
-  if (ArmReadIdPfr0 () & AARCH64_PFR0_GIC) {\r
+  if (ArmHasGicSystemRegisters ()) {\r
     // Make sure System Register access is enabled (SRE). This depends on the\r
     // higher privilege level giving us permission, otherwise we will either\r
     // cause an exception here, or the write doesn't stick in which case we need\r
index 8e1baeee201a4a29dd07f76640b20a91b32b061e..2373ca409a17420043530584c6bf7fc2abbe8ec5 100644 (file)
@@ -23,7 +23,7 @@ ArmGicGetSupportedArchRevision (
   // feature is implemented on the CPU. This is also convenient as our GICv3\r
   // driver requires SRE. If only Memory mapped access is available we try to\r
   // drive the GIC as a v2.\r
-  if (ArmReadIdPfr1 () & ARM_PFR1_GIC) {\r
+  if (ArmHasGicSystemRegisters ()) {\r
     // Make sure System Register access is enabled (SRE). This depends on the\r
     // higher privilege level giving us permission, otherwise we will either\r
     // cause an exception here, or the write doesn't stick in which case we need\r