]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c
ArmPkg/ArmLib: add ArmHasGicSystemRegisters () helper function
[mirror_edk2.git] / ArmPkg / Library / ArmLib / Arm / ArmV7Lib.c
index 2c4a23e1a1b2a5e183b052716e51598b2d47a19a..3faada3a653945bc8a706ef288a152f499ae7859 100644 (file)
@@ -2,6 +2,7 @@
 \r
   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
   Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
+  Copyright (c) 2020, NUVIA Inc. All rights reserved.<BR>\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -71,3 +72,18 @@ ArmCleanDataCache (
   ArmDataSynchronizationBarrier ();\r
   ArmV7DataCacheOperation (ArmCleanDataCacheEntryBySetWay);\r
 }\r
+\r
+/**\r
+  Check whether the CPU supports the GIC system register interface (any version)\r
+\r
+  @return   Whether GIC System Register Interface is supported\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+ArmHasGicSystemRegisters (\r
+  VOID\r
+  )\r
+{\r
+  return ((ArmReadIdPfr1 () & ARM_PFR1_GIC) != 0);\r
+}\r