]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Combine asm statements to prevent the compiler from reordering them
authorLothar Waßmann <LW@KARO-electronics.de>
Tue, 6 Mar 2012 14:12:07 +0000 (15:12 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 6 Mar 2012 14:12:07 +0000 (15:12 +0100)
arch/arm/lib/cache-cp15.c
arch/arm/lib/cache.c

index e6c3eae6f9d2dad1b0bfe2f73d58922439870afa..26b386853a61055615e168ba05061a345494f833 100644 (file)
@@ -20,7 +20,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
  */
-
 #include <common.h>
 #include <asm/system.h>
 
@@ -80,12 +79,14 @@ static inline void mmu_setup(void)
                dram_bank_mmu_setup(i);
        }
 
-       /* Copy the page table address to cp15 */
-       asm volatile("mcr p15, 0, %0, c2, c0, 0"
-                    : : "r" (page_table) : "memory");
-       /* Set the access control to all-supervisor */
-       asm volatile("mcr p15, 0, %0, c3, c0, 0"
-                    : : "r" (~0));
+       asm volatile(
+               /* Copy the page table address to cp15 */
+               "mcr p15, 0, %0, c2, c0, 0\n"
+               /* Set the access control to all-supervisor */
+               "mcr p15, 0, %1, c3, c0, 0\n"
+               :
+               : "r"(page_table), "r"(~0)
+               );
        /* and enable the mmu */
        reg = get_cr(); /* get control reg. */
        cp_delay();
index b545fb79bc1a185972719b6c5684df6ee3f029e5..9adcb8dcd77f64c07e4660492a9f536b46ac4771 100644 (file)
@@ -33,10 +33,12 @@ void  __flush_cache(unsigned long start, unsigned long size)
        arm1136_cache_flush();
 #endif
 #ifdef CONFIG_ARM926EJS
-       /* test and clean, page 2-23 of arm926ejs manual */
-       asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : : "memory");
-       /* disable write buffer as well (page 2-22) */
-       asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
+       asm(
+               /* test and clean, page 2-23 of arm926ejs manual */
+               "0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n"
+               /* flush write buffer as well (page 2-22) */
+               "mcr p15, 0, %0, c7, c10, 4" : : "r"(0) : "memory"
+               );
 #endif
        return;
 }