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 <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>
This commit is contained in:
parent
08431081a3
commit
a671a14e63
|
@ -32,7 +32,8 @@
|
||||||
#define AARCH64_PFR0_GIC (0xF << 24)
|
#define AARCH64_PFR0_GIC (0xF << 24)
|
||||||
|
|
||||||
// ID_AA64DFR0 - AArch64 Debug Feature Register 0 definitions
|
// 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
|
// SCR - Secure Configuration Register definitions
|
||||||
#define SCR_NS (1 << 0)
|
#define SCR_NS (1 << 0)
|
||||||
|
|
|
@ -793,6 +793,18 @@ ArmHasTrbe (
|
||||||
VOID
|
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
|
#endif // MDE_CPU_AARCH64
|
||||||
|
|
||||||
#ifdef MDE_CPU_ARM
|
#ifdef MDE_CPU_ARM
|
||||||
|
|
|
@ -134,3 +134,19 @@ ArmHasTrbe (
|
||||||
{
|
{
|
||||||
return ((ArmReadIdAA64Dfr0 () & AARCH64_DFR0_TRBE) != 0);
|
return ((ArmReadIdAA64Dfr0 () & AARCH64_DFR0_TRBE) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
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
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// The ID_AA64DFR0_EL1.TraceVer field identifies the presence of FEAT_ETE.
|
||||||
|
return ((ArmReadIdAA64Dfr0 () & AARCH64_DFR0_TRACEVER) != 0);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue