aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@codesourcery.com>2008-03-28 17:41:20 +0000
committerDaniel Jacobowitz <dan@codesourcery.com>2008-03-28 17:41:20 +0000
commit625680f978077a09e210e5dcfc66e5700db26dad (patch)
treea44b3d9fd9396fbadc5086ce5f361c6007879cad
parent04d6ca32f128f2d5571bdeb36e34e306ec71e9f9 (diff)
downloadglibc-625680f978077a09e210e5dcfc66e5700db26dad.tar.xz
glibc-625680f978077a09e210e5dcfc66e5700db26dad.zip
* sysdeps/unix/sysv/linux/mips/sys/tas.h (_test_and_set): Added memory
barriers to enforce strict ordering on weakly ordered systems.
-rw-r--r--ChangeLog.mips5
-rw-r--r--sysdeps/unix/sysv/linux/mips/sys/tas.h6
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog.mips b/ChangeLog.mips
index 711f23b730..0ca16cc546 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -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>
Daniel Jacobowitz <dan@codesourcery.com>
diff --git a/sysdeps/unix/sysv/linux/mips/sys/tas.h b/sysdeps/unix/sysv/linux/mips/sys/tas.h
index 309438d78a..b370ee4993 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/tas.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/tas.h
@@ -40,17 +40,19 @@ __NTH (_test_and_set (int *p, int v))
__asm__ __volatile__
("/* Inline test and set */\n"
- "1:\n\t"
".set push\n\t"
#if _MIPS_SIM == _ABIO32
".set mips2\n\t"
#endif
+ "sync\n\t"
+ "1:\n\t"
"ll %0,%3\n\t"
"move %1,%4\n\t"
"beq %0,%4,2f\n\t"
"sc %1,%2\n\t"
- ".set pop\n\t"
"beqz %1,1b\n"
+ "sync\n\t"
+ ".set pop\n\t"
"2:\n\t"
"/* End test and set */"
: "=&r" (r), "=&r" (t), "=m" (*p)