diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h index 8a364f2ca9..c2ed72112b 100644 --- a/ArmPkg/Include/Library/ArmLib.h +++ b/ArmPkg/Include/Library/ArmLib.h @@ -733,4 +733,21 @@ ArmHasGicSystemRegisters ( 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__ diff --git a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c index 3faada3a65..9f81a72237 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c +++ b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c @@ -87,3 +87,18 @@ ArmHasGicSystemRegisters ( { 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); +}