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>
VOID\r
);\r
\r
+#ifdef MDE_CPU_ARM\r
+///\r
+/// AArch32-only ID Register Helper functions\r
+///\r
+/**\r
+ Check whether the CPU supports the Security extensions\r
+\r
+ @return Whether the Security extensions are implemented\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+ArmHasSecurityExtensions (\r
+ VOID\r
+ );\r
+#endif // MDE_CPU_ARM\r
+\r
#endif // __ARM_LIB__\r
{\r
return ((ArmReadIdPfr1 () & ARM_PFR1_GIC) != 0);\r
}\r
+\r
+/**\r
+ Check whether the CPU supports the Security extensions\r
+\r
+ @return Whether the Security extensions are implemented\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+ArmHasSecurityExtensions (\r
+ VOID\r
+ )\r
+{\r
+ return ((ArmReadIdPfr1 () & ARM_PFR1_SEC) != 0);\r
+}\r