diff options
author | Leif Lindholm <leif@nuviainc.com> | 2020-12-18 13:21:08 +0000 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-12-18 15:27:26 +0000 |
commit | 740b870dc8660906523c85187ab5badd2fd8ea08 (patch) | |
tree | 5c70ccf63b6ee66f59adf8e614759f76afac7c9b /ArmPkg/Library/ArmLib | |
parent | 7bb8dd9f9844802eb6ae2c8fcd8c2ff613570583 (diff) | |
download | edk2-740b870dc8660906523c85187ab5badd2fd8ea08.zip edk2-740b870dc8660906523c85187ab5badd2fd8ea08.tar.gz edk2-740b870dc8660906523c85187ab5badd2fd8ea08.tar.bz2 |
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>
Diffstat (limited to 'ArmPkg/Library/ArmLib')
-rw-r--r-- | ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c index 3faada3..9f81a72 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);
+}
|