]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c
ArmPkg/ArmLib: add ArmHasGicSystemRegisters () helper function
[mirror_edk2.git] / ArmPkg / Library / ArmLib / AArch64 / AArch64Lib.c
index 3fbd591192e270131af594cca53f1babd7cb0489..5b10eb33c97d00c45b928d8e260d851fb793ddb0 100644 (file)
@@ -2,6 +2,7 @@
 \r
   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
   Portions copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>\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
   AArch64DataCacheOperation (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 ((ArmReadIdPfr0 () & AARCH64_PFR0_GIC) != 0);\r
+}\r