aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/mm/c-r4k.c1
-rw-r--r--include/asm-mips/hazards.h16
2 files changed, 17 insertions, 0 deletions
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index b90147399ea4..08d7229a0688 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -529,6 +529,7 @@ static void r4k_flush_icache_range(unsigned long __user start,
529 args.end = end; 529 args.end = end;
530 530
531 on_each_cpu(local_r4k_flush_icache_range, &args, 1, 1); 531 on_each_cpu(local_r4k_flush_icache_range, &args, 1, 1);
532 instruction_hazard();
532} 533}
533 534
534/* 535/*
diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h
index 181f08de889c..f63d824e6e48 100644
--- a/include/asm-mips/hazards.h
+++ b/include/asm-mips/hazards.h
@@ -228,6 +228,22 @@ __asm__(
228 228
229#endif 229#endif
230 230
231#if defined(CONFIG_CPU_MIPS32_R2) || defined (CONFIG_CPU_MIPS64_R2)
232#define instruction_hazard() \
233do { \
234__label__ __next; \
235 __asm__ __volatile__( \
236 " jr.hb %0 \n" \
237 : \
238 : "r" (&&__next)); \
239__next: \
240 ; \
241} while (0)
242
243#else
244#define instruction_hazard() do { } while (0)
245#endif
246
231#endif /* __ASSEMBLY__ */ 247#endif /* __ASSEMBLY__ */
232 248
233#endif /* _ASM_HAZARDS_H */ 249#endif /* _ASM_HAZARDS_H */