patch-2.1.114 linux/include/asm-i386/spinlock.h

Next file: linux/include/asm-m68k/smplock.h
Previous file: linux/include/asm-i386/smplock.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.113/linux/include/asm-i386/spinlock.h linux/include/asm-i386/spinlock.h
@@ -128,8 +128,7 @@
 typedef struct { unsigned long a[100]; } __dummy_lock_t;
 #define __dummy_lock(lock) (*(__dummy_lock_t *)(lock))
 
-#define spin_lock(lock) \
-__asm__ __volatile__( \
+#define spin_lock_string \
 	"\n1:\t" \
 	"lock ; btsl $0,%0\n\t" \
 	"jc 2f\n" \
@@ -138,12 +137,19 @@
 	"testb $1,%0\n\t" \
 	"jne 2b\n\t" \
 	"jmp 1b\n" \
-	".previous" \
+	".previous"
+
+#define spin_unlock_string \
+	"lock ; btrl $0,%0"
+
+#define spin_lock(lock) \
+__asm__ __volatile__( \
+	spin_lock_string \
 	:"=m" (__dummy_lock(lock)))
 
 #define spin_unlock(lock) \
 __asm__ __volatile__( \
-	"lock ; btrl $0,%0" \
+	spin_unlock_string \
 	:"=m" (__dummy_lock(lock)))
 
 #define spin_trylock(lock) (!test_and_set_bit(0,(lock)))

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov