summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c
diff options
context:
space:
mode:
authorSami Mujawar <sami.mujawar@arm.com>2023-09-22 15:35:15 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-10-30 12:16:56 +0000
commit08431081a3623bd6c44de5c859ef42c579de63d1 (patch)
treed7601613c66ae9d68cbfeaeee8026abac21a57b0 /ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c
parent09fd4e41728ffabbb98bc4e0520369f70eb9c583 (diff)
downloadedk2-08431081a3623bd6c44de5c859ef42c579de63d1.tar.gz
edk2-08431081a3623bd6c44de5c859ef42c579de63d1.tar.bz2
edk2-08431081a3623bd6c44de5c859ef42c579de63d1.zip
ArmPkg/ArmLib: Add ArmHasTrbe () helper function
Create a helper function to query whether ID_AA64MFR1_EL1 indicates presence of the Trace Buffer Extension (TRBE). This feature is only visible in AARCH64 state. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
Diffstat (limited to 'ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c')
-rw-r--r--ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c
index da5755106e..3a46f360ef 100644
--- a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c
+++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c
@@ -119,3 +119,18 @@ ArmHasVhe (
{
return ((ArmReadIdAA64Mmfr1 () & AARCH64_MMFR1_VH) != 0);
}
+
+/**
+ Checks whether the CPU implements the Trace Buffer Extension.
+
+ @retval TRUE FEAT_TRBE is implemented.
+ @retval FALSE FEAT_TRBE is not mplemented.
+**/
+BOOLEAN
+EFIAPI
+ArmHasTrbe (
+ VOID
+ )
+{
+ return ((ArmReadIdAA64Dfr0 () & AARCH64_DFR0_TRBE) != 0);
+}