patch-2.4.17 linux/arch/sparc64/lib/dec_and_lock.S
Next file: linux/arch/sparc64/mm/extable.c
Previous file: linux/arch/sparc64/lib/debuglocks.c
Back to the patch index
Back to the overall index
- Lines: 39
- Date:
Fri Dec 21 16:40:32 2001
- Orig file:
linux-2.4.16/arch/sparc64/lib/dec_and_lock.S
- Orig date:
Sun Aug 13 19:01:54 2000
diff -Naur -X /home/marcelo/lib/dontdiff linux-2.4.16/arch/sparc64/lib/dec_and_lock.S linux/arch/sparc64/lib/dec_and_lock.S
@@ -1,10 +1,12 @@
-/* $Id: dec_and_lock.S,v 1.2 2000/08/13 18:24:12 davem Exp $
+/* $Id: dec_and_lock.S,v 1.5 2001/11/18 00:12:56 davem Exp $
* dec_and_lock.S: Sparc64 version of "atomic_dec_and_lock()"
* using cas and ldstub instructions.
*
* Copyright (C) 2000 David S. Miller (davem@redhat.com)
*/
+#include <linux/config.h>
+#ifndef CONFIG_DEBUG_SPINLOCK
.text
.align 64
@@ -34,13 +36,15 @@
bne,pn %icc, loop1
mov 0, %g1
-out: retl
+out:
+ membar #StoreLoad | #StoreStore
+ retl
mov %g1, %o0
-to_zero:ldstub [%o1], %g3
+to_zero:
+ ldstub [%o1], %g3
brnz,pn %g3, spin_on_lock
membar #StoreLoad | #StoreStore
loop2: cas [%o0], %g5, %g7 /* ASSERT(g7 == 0) */
- nop
cmp %g5, %g7
be,pt %icc, out
@@ -61,3 +65,5 @@
ba,pt %xcc, to_zero
nop
nop
+
+#endif /* !(CONFIG_DEBUG_SPINLOCK) */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)