diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-28 12:25:22 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-28 12:25:22 -0500 |
commit | 78cd9e04e0acea4f622e84ca0c760c7eae0c6854 (patch) | |
tree | 6df4f07bfa77f8115e4250a14be76c04a2b5dc3e /include | |
parent | ec7e15d6486e9d1da1c2f344b670b8388ba7019b (diff) | |
parent | 6e57a3a89785692bd8d012d80f5ee210ab8e0b68 (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]: Implement futex_atomic_cmpxchg_inatomic().
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-sparc64/futex.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/asm-sparc64/futex.h b/include/asm-sparc64/futex.h index cd340a233156..dee40206b221 100644 --- a/include/asm-sparc64/futex.h +++ b/include/asm-sparc64/futex.h | |||
@@ -84,9 +84,27 @@ static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | |||
84 | } | 84 | } |
85 | 85 | ||
86 | static inline int | 86 | static inline int |
87 | futex_atomic_cmpxchg_inuser(int __user *uaddr, int oldval, int newval) | 87 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) |
88 | { | 88 | { |
89 | return -ENOSYS; | 89 | __asm__ __volatile__( |
90 | "\n1: lduwa [%2] %%asi, %0\n" | ||
91 | "2: casa [%2] %%asi, %0, %1\n" | ||
92 | "3:\n" | ||
93 | " .section .fixup,#alloc,#execinstr\n" | ||
94 | " .align 4\n" | ||
95 | "4: ba 3b\n" | ||
96 | " mov %3, %0\n" | ||
97 | " .previous\n" | ||
98 | " .section __ex_table,\"a\"\n" | ||
99 | " .align 4\n" | ||
100 | " .word 1b, 4b\n" | ||
101 | " .word 2b, 4b\n" | ||
102 | " .previous\n" | ||
103 | : "=&r" (oldval) | ||
104 | : "r" (newval), "r" (uaddr), "i" (-EFAULT) | ||
105 | : "memory"); | ||
106 | |||
107 | return oldval; | ||
90 | } | 108 | } |
91 | 109 | ||
92 | #endif /* !(_SPARC64_FUTEX_H) */ | 110 | #endif /* !(_SPARC64_FUTEX_H) */ |