Replace 8 nops with proper sync instruction on mips
Cc: Ralf Baechle <ralf@linux-mips.org> Acked-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
563fa1c5d7
commit
52aa049521
|
@ -165,16 +165,17 @@ extern unsigned short ldw_brx(volatile unsigned char *, int);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# elif defined __mips__
|
# elif defined __mips__
|
||||||
# define mem_barrier() \
|
/* Note: sync instruction requires MIPS II instruction set */
|
||||||
__asm__ __volatile__( \
|
# define mem_barrier() \
|
||||||
"# prevent instructions being moved around\n\t" \
|
__asm__ __volatile__( \
|
||||||
".set\tnoreorder\n\t" \
|
".set push\n\t" \
|
||||||
"# 8 nops to fool the R4400 pipeline\n\t" \
|
".set noreorder\n\t" \
|
||||||
"nop;nop;nop;nop;nop;nop;nop;nop\n\t" \
|
".set mips2\n\t" \
|
||||||
".set\treorder" \
|
"sync\n\t" \
|
||||||
: /* no output */ \
|
".set pop" \
|
||||||
: /* no input */ \
|
: /* no output */ \
|
||||||
: "memory")
|
: /* no input */ \
|
||||||
|
: "memory")
|
||||||
# define write_mem_barrier() mem_barrier()
|
# define write_mem_barrier() mem_barrier()
|
||||||
|
|
||||||
# elif defined __powerpc__
|
# elif defined __powerpc__
|
||||||
|
|
Loading…
Reference in New Issue
Block a user