aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-11-02 08:50:02 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-11-02 08:50:02 -0800
commit0ca2b776ab1f4ba99d7f592baa4ff8525e53b050 (patch)
tree9a71bafec47e7f344a65e2dc7085512b4c521ee5
parentaefba081d7b7dfd1c5752f6e6e709d8b5ab80ab7 (diff)
parentc7fed9d75074f7c243ec8ff2c55d04de2839a6f6 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC64]: Fix futex_atomic_cmpxchg_inatomic implementation.
-rw-r--r--include/asm-sparc64/futex.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/include/asm-sparc64/futex.h b/include/asm-sparc64/futex.h
index dee40206b22..7392fc4a954 100644
--- a/include/asm-sparc64/futex.h
+++ b/include/asm-sparc64/futex.h
@@ -87,24 +87,22 @@ static inline int
futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
{
__asm__ __volatile__(
- "\n1: lduwa [%2] %%asi, %0\n"
- "2: casa [%2] %%asi, %0, %1\n"
- "3:\n"
+ "\n1: casa [%3] %%asi, %2, %0\n"
+ "2:\n"
" .section .fixup,#alloc,#execinstr\n"
" .align 4\n"
- "4: ba 3b\n"
- " mov %3, %0\n"
+ "3: ba 2b\n"
+ " mov %4, %0\n"
" .previous\n"
" .section __ex_table,\"a\"\n"
" .align 4\n"
- " .word 1b, 4b\n"
- " .word 2b, 4b\n"
+ " .word 1b, 3b\n"
" .previous\n"
- : "=&r" (oldval)
- : "r" (newval), "r" (uaddr), "i" (-EFAULT)
+ : "=r" (newval)
+ : "0" (newval), "r" (oldval), "r" (uaddr), "i" (-EFAULT)
: "memory");
- return oldval;
+ return newval;
}
#endif /* !(_SPARC64_FUTEX_H) */