From f554773520602d146acb5370242c4c62dafc5080 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 26 Mar 2020 13:18:48 +0900 Subject: xlat_tables_v2: add enable_mmu() enable_mmu_* has a different function name, so it is not handy in the shared code. enable_mmu() calls an appropriate one depending on the exception level. Change-Id: I0657968bfcb91c32733f75f9259f550a5c35b1c3 Signed-off-by: Masahiro Yamada --- lib/xlat_tables_v2/xlat_tables_context.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/xlat_tables_v2') diff --git a/lib/xlat_tables_v2/xlat_tables_context.c b/lib/xlat_tables_v2/xlat_tables_context.c index a1c974ec0..032e1424f 100644 --- a/lib/xlat_tables_v2/xlat_tables_context.c +++ b/lib/xlat_tables_v2/xlat_tables_context.c @@ -239,6 +239,23 @@ void enable_mmu_el3(unsigned int flags) enable_mmu_direct_el3(flags); } +void enable_mmu(unsigned int flags) +{ + switch (get_current_el_maybe_constant()) { + case 1: + enable_mmu_el1(flags); + break; + case 2: + enable_mmu_el2(flags); + break; + case 3: + enable_mmu_el3(flags); + break; + default: + panic(); + } +} + #else /* !__aarch64__ */ void enable_mmu_svc_mon(unsigned int flags) -- cgit v1.2.3