summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2008-08-03 13:00:44 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:27:18 +0200
commit511300311b1a57ad7279f91ab11d1bcf6fe202da (patch)
tree4d0423f6b860a88576e366fcef7b26e6dab92288
parenta2e1ed839ebd352c3114193c24a61ef2ef72ddff (diff)
2008-08-03 Samuel Thibault <samuel.thibault@ens-lyon.org>
* i386/i386/lock.h (_simple_lock_xchg_, bit_lock, bit_unlock): Add memory clobbers. * i386/include/mach/i386/cthreads.h (spin_unlock, spin_try_lock): Add memory clobbers.
-rw-r--r--ChangeLog7
-rw-r--r--i386/i386/lock.h6
-rw-r--r--i386/include/mach/i386/cthreads.h4
3 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 83b1914..10c6553 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-08-03 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * i386/i386/lock.h (_simple_lock_xchg_, bit_lock, bit_unlock): Add
+ memory clobbers.
+ * i386/include/mach/i386/cthreads.h (spin_unlock, spin_try_lock): Add
+ memory clobbers.
+
2008-07-23 Barry deFreese <bddebian@comcast.net>
* device/chario.c (ttyinput_many): Change chars param to char *.
diff --git a/i386/i386/lock.h b/i386/i386/lock.h
index 2b5c4aa..38a66c8 100644
--- a/i386/i386/lock.h
+++ b/i386/i386/lock.h
@@ -47,7 +47,7 @@
({ register int _old_val_; \
asm volatile("xchgl %0, %2" \
: "=r" (_old_val_) \
- : "0" (new_val), "m" (*(lock)) \
+ : "0" (new_val), "m" (*(lock) : "memory") \
); \
_old_val_; \
})
@@ -81,7 +81,7 @@
btsl %0, %1 \n\
jb 0b" \
: \
- : "r" (bit), "m" (*(volatile int *)(l))); \
+ : "r" (bit), "m" (*(volatile int *)(l)) : "memory"); \
0; \
})
@@ -90,7 +90,7 @@
asm volatile(" lock \n\
btrl %0, %1" \
: \
- : "r" (bit), "m" (*(volatile int *)(l))); \
+ : "r" (bit), "m" (*(volatile int *)(l)) : "memory"); \
0; \
})
diff --git a/i386/include/mach/i386/cthreads.h b/i386/include/mach/i386/cthreads.h
index e10cda3..f9755b4 100644
--- a/i386/include/mach/i386/cthreads.h
+++ b/i386/include/mach/i386/cthreads.h
@@ -37,14 +37,14 @@ typedef volatile int spin_lock_t;
({ register int _u__ ; \
__asm__ volatile("xorl %0, %0; \n\
xchgl %0, %1" \
- : "=&r" (_u__), "=m" (*(p)) ); \
+ : "=&r" (_u__), "=m" (*(p)) : "memory" ); \
0; })
#define spin_try_lock(p)\
(!({ boolean_t _r__; \
__asm__ volatile("movl $1, %0; \n\
xchgl %0, %1" \
- : "=&r" (_r__), "=m" (*(p)) ); \
+ : "=&r" (_r__), "=m" (*(p)) : "memory" ); \
_r__; }))
#define cthread_sp() \