ArmPkg/ArmLib: add ArmHasGicSystemRegisters () helper function
Create a helper function to eliminate direct feature register reading, which gets messy in code shared between ARM/AArch64. Returns BOOLEAN True if the CPU implements the GIC System Register Interface (any version), otherwise returns BOOL False. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Signed-off-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
This commit is contained in:
committed by
mergify[bot]
parent
6573ae8c85
commit
5cc25cff5d
@@ -2,6 +2,7 @@
|
||||
|
||||
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||
Portions copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
|
||||
Copyright (c) 2020, NUVIA Inc. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
@@ -71,3 +72,18 @@ ArmCleanDataCache (
|
||||
ArmDataSynchronizationBarrier ();
|
||||
AArch64DataCacheOperation (ArmCleanDataCacheEntryBySetWay);
|
||||
}
|
||||
|
||||
/**
|
||||
Check whether the CPU supports the GIC system register interface (any version)
|
||||
|
||||
@return Whether GIC System Register Interface is supported
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
ArmHasGicSystemRegisters (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return ((ArmReadIdPfr0 () & AARCH64_PFR0_GIC) != 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user