Commit ffbf670f5cd50501a34a5187981460da2216071e
Committed by
Ingo Molnar
1 parent
f17578decc
Exists in
master
and in
7 other branches
[PATCH] mutex subsystem, add atomic_xchg() to all arches
add atomic_xchg() to all the architectures. Needed by the new mutex code. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Showing 22 changed files with 30 additions and 0 deletions Side-by-side Diff
- include/asm-alpha/atomic.h
- include/asm-arm/atomic.h
- include/asm-arm26/atomic.h
- include/asm-cris/atomic.h
- include/asm-frv/atomic.h
- include/asm-h8300/atomic.h
- include/asm-i386/atomic.h
- include/asm-ia64/atomic.h
- include/asm-m32r/atomic.h
- include/asm-m68k/atomic.h
- include/asm-m68knommu/atomic.h
- include/asm-mips/atomic.h
- include/asm-parisc/atomic.h
- include/asm-powerpc/atomic.h
- include/asm-s390/atomic.h
- include/asm-sh/atomic.h
- include/asm-sh64/atomic.h
- include/asm-sparc/atomic.h
- include/asm-sparc64/atomic.h
- include/asm-v850/atomic.h
- include/asm-x86_64/atomic.h
- include/asm-xtensa/atomic.h
include/asm-alpha/atomic.h
include/asm-arm/atomic.h
include/asm-arm26/atomic.h
include/asm-cris/atomic.h
include/asm-frv/atomic.h
include/asm-h8300/atomic.h
include/asm-i386/atomic.h
include/asm-ia64/atomic.h
include/asm-m32r/atomic.h
... | ... | @@ -243,6 +243,7 @@ |
243 | 243 | #define atomic_add_negative(i,v) (atomic_add_return((i), (v)) < 0) |
244 | 244 | |
245 | 245 | #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) |
246 | +#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | |
246 | 247 | |
247 | 248 | /** |
248 | 249 | * atomic_add_unless - add unless the number is a given value |
include/asm-m68k/atomic.h
include/asm-m68knommu/atomic.h
include/asm-mips/atomic.h
include/asm-parisc/atomic.h
... | ... | @@ -165,6 +165,7 @@ |
165 | 165 | |
166 | 166 | /* exported interface */ |
167 | 167 | #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) |
168 | +#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | |
168 | 169 | |
169 | 170 | /** |
170 | 171 | * atomic_add_unless - add unless the number is a given value |
include/asm-powerpc/atomic.h
include/asm-s390/atomic.h
include/asm-sh/atomic.h
include/asm-sh64/atomic.h
include/asm-sparc/atomic.h
... | ... | @@ -20,6 +20,7 @@ |
20 | 20 | |
21 | 21 | extern int __atomic_add_return(int, atomic_t *); |
22 | 22 | extern int atomic_cmpxchg(atomic_t *, int, int); |
23 | +#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | |
23 | 24 | extern int atomic_add_unless(atomic_t *, int, int); |
24 | 25 | extern void atomic_set(atomic_t *, int); |
25 | 26 |
include/asm-sparc64/atomic.h
... | ... | @@ -72,6 +72,7 @@ |
72 | 72 | #define atomic64_add_negative(i, v) (atomic64_add_ret(i, v) < 0) |
73 | 73 | |
74 | 74 | #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) |
75 | +#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | |
75 | 76 | |
76 | 77 | #define atomic_add_unless(v, a, u) \ |
77 | 78 | ({ \ |
include/asm-v850/atomic.h
include/asm-x86_64/atomic.h
... | ... | @@ -389,6 +389,7 @@ |
389 | 389 | #define atomic64_dec_return(v) (atomic64_sub_return(1,v)) |
390 | 390 | |
391 | 391 | #define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new)) |
392 | +#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | |
392 | 393 | |
393 | 394 | /** |
394 | 395 | * atomic_add_unless - add unless the number is a given value |
include/asm-xtensa/atomic.h
... | ... | @@ -224,6 +224,7 @@ |
224 | 224 | #define atomic_add_negative(i,v) (atomic_add_return((i),(v)) < 0) |
225 | 225 | |
226 | 226 | #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) |
227 | +#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | |
227 | 228 | |
228 | 229 | /** |
229 | 230 | * atomic_add_unless - add unless the number is a given value |