aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-11-02 11:50:02 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-11-02 11:50:02 -0500
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 dee40206b221..7392fc4a954e 100644
--- a/include/asm-sparc64/futex.h
+++ b/include/asm-sparc64/futex.h
@@ -87,24 +87,22 @@ static inline int
87futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) 87futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
88{ 88{
89 __asm__ __volatile__( 89 __asm__ __volatile__(
90 "\n1: lduwa [%2] %%asi, %0\n" 90 "\n1: casa [%3] %%asi, %2, %0\n"
91 "2: casa [%2] %%asi, %0, %1\n" 91 "2:\n"
92 "3:\n"
93 " .section .fixup,#alloc,#execinstr\n" 92 " .section .fixup,#alloc,#execinstr\n"
94 " .align 4\n" 93 " .align 4\n"
95 "4: ba 3b\n" 94 "3: ba 2b\n"
96 " mov %3, %0\n" 95 " mov %4, %0\n"
97 " .previous\n" 96 " .previous\n"
98 " .section __ex_table,\"a\"\n" 97 " .section __ex_table,\"a\"\n"
99 " .align 4\n" 98 " .align 4\n"
100 " .word 1b, 4b\n" 99 " .word 1b, 3b\n"
101 " .word 2b, 4b\n"
102 " .previous\n" 100 " .previous\n"
103 : "=&r" (oldval) 101 : "=r" (newval)
104 : "r" (newval), "r" (uaddr), "i" (-EFAULT) 102 : "0" (newval), "r" (oldval), "r" (uaddr), "i" (-EFAULT)
105 : "memory"); 103 : "memory");
106 104
107 return oldval; 105 return newval;
108} 106}
109 107
110#endif /* !(_SPARC64_FUTEX_H) */ 108#endif /* !(_SPARC64_FUTEX_H) */