Skip to content

Commit

Permalink
MIPS R2 instruction hazard handling.
Browse files Browse the repository at this point in the history
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed Oct 29, 2005
1 parent bbc7f22 commit cc61c1f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/mips/mm/c-r4k.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/*
Expand Down
16 changes: 16 additions & 0 deletions include/asm-mips/hazards.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit cc61c1f

Please sign in to comment.