The order matters on ARM32, because arm_fixup_vectors() actually rewrite
the vector table, which is in the text area.

On ARM64, the order doesn't matter. As we are going to make the memory
bank remapping code common between both ARM32 and ARM64, move
setup_trap_pages, so the code between ARM32 and ARM64 becomes identical.

Signed-off-by: Ahmad Fatoum <a.fat...@barebox.org>
---
 arch/arm/cpu/mmu_64.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/mmu_64.c b/arch/arm/cpu/mmu_64.c
index 7e6e89cb98c2..a770be7ed611 100644
--- a/arch/arm/cpu/mmu_64.c
+++ b/arch/arm/cpu/mmu_64.c
@@ -417,10 +417,10 @@ void __mmu_init(bool mmu_on)
                remap_range((void *)pos, bank->start + bank->size - pos, 
MAP_CACHED);
        }
 
+       setup_trap_pages();
+
        remap_range((void *)code_start, code_size, MAP_CODE);
        remap_range((void *)rodata_start, rodata_size, ARCH_MAP_CACHED_RO);
-
-       setup_trap_pages();
 }
 
 void mmu_disable(void)
-- 
2.39.5


Reply via email to