mirror of https://github.com/acidanthera/audk.git
ArmPkg: add ArmHasSecurityExtensions () helper function
Create a helper function to eliminate direct feature register reading. Returns BOOLEAN True if the CPU implements the Security extensions, otherwise returns BOOL False. This function is only implemented for ARM, not AArch64. 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:
parent
7bb8dd9f98
commit
740b870dc8
|
@ -733,4 +733,21 @@ ArmHasGicSystemRegisters (
|
||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#ifdef MDE_CPU_ARM
|
||||||
|
///
|
||||||
|
/// AArch32-only ID Register Helper functions
|
||||||
|
///
|
||||||
|
/**
|
||||||
|
Check whether the CPU supports the Security extensions
|
||||||
|
|
||||||
|
@return Whether the Security extensions are implemented
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
ArmHasSecurityExtensions (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
#endif // MDE_CPU_ARM
|
||||||
|
|
||||||
#endif // __ARM_LIB__
|
#endif // __ARM_LIB__
|
||||||
|
|
|
@ -87,3 +87,18 @@ ArmHasGicSystemRegisters (
|
||||||
{
|
{
|
||||||
return ((ArmReadIdPfr1 () & ARM_PFR1_GIC) != 0);
|
return ((ArmReadIdPfr1 () & ARM_PFR1_GIC) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Check whether the CPU supports the Security extensions
|
||||||
|
|
||||||
|
@return Whether the Security extensions are implemented
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
EFIAPI
|
||||||
|
ArmHasSecurityExtensions (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return ((ArmReadIdPfr1 () & ARM_PFR1_SEC) != 0);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue