From a671a14e63fdaa9490e5c61cf11346416f1d1463 Mon Sep 17 00:00:00 2001 From: Sami Mujawar Date: Fri, 22 Sep 2023 15:35:16 +0100 Subject: ArmPkg/ArmLib: Add ArmHasEte () helper function Create a helper function to query whether ID_AA64MFR1_EL1 indicates presence of the Embedded Trace Extension (ETE). This feature is only visible in AARCH64 state. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Pierre Gondois Signed-off-by: Sami Mujawar Reviewed-by: Leif Lindholm Reviewed-by: Pierre Gondois --- ArmPkg/Include/Chipset/AArch64.h | 3 ++- ArmPkg/Include/Library/ArmLib.h | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'ArmPkg/Include') diff --git a/ArmPkg/Include/Chipset/AArch64.h b/ArmPkg/Include/Chipset/AArch64.h index d8711ad..5390bf0 100644 --- a/ArmPkg/Include/Chipset/AArch64.h +++ b/ArmPkg/Include/Chipset/AArch64.h @@ -32,7 +32,8 @@ #define AARCH64_PFR0_GIC (0xF << 24) // ID_AA64DFR0 - AArch64 Debug Feature Register 0 definitions -#define AARCH64_DFR0_TRBE (0xFULL << 44) +#define AARCH64_DFR0_TRACEVER (0xFULL << 4) +#define AARCH64_DFR0_TRBE (0xFULL << 44) // SCR - Secure Configuration Register definitions #define SCR_NS (1 << 0) diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h index c2d738c..6aa8a48 100644 --- a/ArmPkg/Include/Library/ArmLib.h +++ b/ArmPkg/Include/Library/ArmLib.h @@ -793,6 +793,18 @@ ArmHasTrbe ( VOID ); +/** + Checks whether the CPU implements the Embedded Trace Extension. + + @retval TRUE FEAT_ETE is implemented. + @retval FALSE FEAT_ETE is not mplemented. +**/ +BOOLEAN +EFIAPI +ArmHasEte ( + VOID + ); + #endif // MDE_CPU_AARCH64 #ifdef MDE_CPU_ARM -- cgit v1.1