From 01d8aa0d313b65da017576cec02a8b411e5eae59 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Mon, 28 Apr 2008 03:04:41 +0000 Subject: [PATCH] The first argment of mtdbatu or mtibatu is part of the encoding. It needs to be constant, so eliminate the loop and "hand-unroll". --- sys/powerpc/aim/mmu_oea.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index d179b4081c21..a425ccd07c2d 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -623,16 +623,17 @@ pmap_cpu_bootstrap(volatile uint32_t *trcp, int ap) trcp[0] = 0x1001; - for (i = 1; i < 4; i++) { - __asm __volatile("mtdbatu %0,%1" :: "n"(i), "r"(0)); - __asm __volatile("mtibatu %0,%1" :: "n"(i), "r"(0)); - isync(); - } + __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu)); + __asm __volatile("mtdbatl 1,%0" :: "r"(battable[8].batl)); + isync(); trcp[0] = 0x1002; - __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu)); - __asm __volatile("mtdbatl 1,%0" :: "r"(battable[8].batl)); + __asm __volatile("mtibatu 1,%0" :: "r"(0)); + __asm __volatile("mtdbatu 2,%0" :: "r"(0)); + __asm __volatile("mtibatu 2,%0" :: "r"(0)); + __asm __volatile("mtdbatu 3,%0" :: "r"(0)); + __asm __volatile("mtibatu 3,%0" :: "r"(0)); isync(); trcp[0] = 0x1003;