summaryrefslogtreecommitdiff
path: root/lib/el3_runtime
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2023-03-03 10:30:06 +0000
committerManish Pandey <manish.pandey2@arm.com>2023-03-27 19:36:15 +0100
commitb57e16a4f96b6cfa4da9e3b2cc6d6d4533da1950 (patch)
tree10e651165d5673daa1c6d300345955188fe5b5a2 /lib/el3_runtime
parentd23acc9e4f94d95280ee7985e3f96482eb7fe04d (diff)
refactor(amu): use new AMU feature check routines
The AMU extension code was using its own feature detection routines. Replace them with the generic CPU feature handlers (defined in arch_features.h), which get updated to cover the v1p1 variant as well. Change-Id: I8540f1e745d7b02a25a6c6cdf2a39d6f5e21f2aa Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'lib/el3_runtime')
-rw-r--r--lib/el3_runtime/aarch32/context_mgmt.c6
-rw-r--r--lib/el3_runtime/aarch64/context_mgmt.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/el3_runtime/aarch32/context_mgmt.c b/lib/el3_runtime/aarch32/context_mgmt.c
index f31ee5dde..62e30fcab 100644
--- a/lib/el3_runtime/aarch32/context_mgmt.c
+++ b/lib/el3_runtime/aarch32/context_mgmt.c
@@ -136,9 +136,9 @@ void cm_setup_context(cpu_context_t *ctx, const entry_point_info_t *ep)
static void enable_extensions_nonsecure(bool el2_unused)
{
#if IMAGE_BL32
-#if ENABLE_FEAT_AMU
- amu_enable(el2_unused);
-#endif
+ if (is_feat_amu_supported()) {
+ amu_enable(el2_unused);
+ }
if (is_feat_sys_reg_trace_supported()) {
sys_reg_trace_enable();
diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c
index bb6db9f4d..12f3e6d03 100644
--- a/lib/el3_runtime/aarch64/context_mgmt.c
+++ b/lib/el3_runtime/aarch64/context_mgmt.c
@@ -485,9 +485,9 @@ static void manage_extensions_nonsecure(bool el2_unused, cpu_context_t *ctx)
spe_enable(el2_unused);
}
-#if ENABLE_FEAT_AMU
- amu_enable(el2_unused, ctx);
-#endif
+ if (is_feat_amu_supported()) {
+ amu_enable(el2_unused, ctx);
+ }
#if ENABLE_SME_FOR_NS
/* Enable SME, SVE, and FPU/SIMD for non-secure world. */