* sysdeps/unix/sysv/linux/mips/sys/tas.h (_test_and_set): Added memory
barriers to enforce strict ordering on weakly ordered systems.
This commit is contained in:
parent
04d6ca32f1
commit
625680f978
|
@ -1,3 +1,8 @@
|
||||||
|
2008-03-27 Robin Randhawa <robin@mips.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/mips/sys/tas.h (_test_and_set): Added memory
|
||||||
|
barriers to enforce strict ordering on weakly ordered systems.
|
||||||
|
|
||||||
2008-03-26 David Stephenson <david.stephenson@sicortex.com>
|
2008-03-26 David Stephenson <david.stephenson@sicortex.com>
|
||||||
Daniel Jacobowitz <dan@codesourcery.com>
|
Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
|
|
|
@ -40,17 +40,19 @@ __NTH (_test_and_set (int *p, int v))
|
||||||
|
|
||||||
__asm__ __volatile__
|
__asm__ __volatile__
|
||||||
("/* Inline test and set */\n"
|
("/* Inline test and set */\n"
|
||||||
"1:\n\t"
|
|
||||||
".set push\n\t"
|
".set push\n\t"
|
||||||
#if _MIPS_SIM == _ABIO32
|
#if _MIPS_SIM == _ABIO32
|
||||||
".set mips2\n\t"
|
".set mips2\n\t"
|
||||||
#endif
|
#endif
|
||||||
|
"sync\n\t"
|
||||||
|
"1:\n\t"
|
||||||
"ll %0,%3\n\t"
|
"ll %0,%3\n\t"
|
||||||
"move %1,%4\n\t"
|
"move %1,%4\n\t"
|
||||||
"beq %0,%4,2f\n\t"
|
"beq %0,%4,2f\n\t"
|
||||||
"sc %1,%2\n\t"
|
"sc %1,%2\n\t"
|
||||||
".set pop\n\t"
|
|
||||||
"beqz %1,1b\n"
|
"beqz %1,1b\n"
|
||||||
|
"sync\n\t"
|
||||||
|
".set pop\n\t"
|
||||||
"2:\n\t"
|
"2:\n\t"
|
||||||
"/* End test and set */"
|
"/* End test and set */"
|
||||||
: "=&r" (r), "=&r" (t), "=m" (*p)
|
: "=&r" (r), "=&r" (t), "=m" (*p)
|
||||||
|
|
Loading…
Reference in New Issue