]> err.no Git - linux-2.6/commitdiff
MIPS R2 instruction hazard handling.
authorRalf Baechle <ralf@linux-mips.org>
Tue, 12 Jul 2005 18:35:38 +0000 (18:35 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Sat, 29 Oct 2005 18:31:46 +0000 (19:31 +0100)
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/mm/c-r4k.c
include/asm-mips/hazards.h

index b90147399ea4b7b3ff8833d95eca0c3155897201..08d7229a06886bbcc686d6e3a98b887dda09df1e 100644 (file)
@@ -529,6 +529,7 @@ static void r4k_flush_icache_range(unsigned long __user start,
        args.end = end;
 
        on_each_cpu(local_r4k_flush_icache_range, &args, 1, 1);
+       instruction_hazard();
 }
 
 /*
index 181f08de889ca9176b1ef2a6f13295e5d281902d..f63d824e6e485dc91a7d5d8eadf17566088afcd4 100644 (file)
@@ -228,6 +228,22 @@ __asm__(
 
 #endif
 
+#if defined(CONFIG_CPU_MIPS32_R2) || defined (CONFIG_CPU_MIPS64_R2)
+#define instruction_hazard()                                           \
+do {                                                                   \
+__label__ __next;                                                      \
+       __asm__ __volatile__(                                           \
+       "       jr.hb   %0                                      \n"     \
+       :                                                               \
+       : "r" (&&__next));                                              \
+__next:                                                                        \
+       ;                                                               \
+} while (0)
+
+#else
+#define instruction_hazard() do { } while (0)
+#endif
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_HAZARDS_H */