diff options
author | Jonas Bonn <jonas@southpole.se> | 2013-02-28 00:37:05 -0500 |
---|---|---|
committer | Jonas Bonn <jonas@southpole.se> | 2013-03-13 01:11:05 -0400 |
commit | 00c30e0681bf5563c8670c0ab419886f56626430 (patch) | |
tree | 994d47deeb1771f3018317d7bad45dfbf7ba9d19 /include | |
parent | d4cb776f33c7343e805dc3d6dd71a80eff9f66f1 (diff) |
asm-generic: move cmpxchg*_local defs to cmpxchg.h
asm/cmpxchg.h can be included on its own and needs to be self-consistent.
The definitions for the cmpxchg*_local macros, as such, need to be part
of this file.
This fixes a build issue on OpenRISC since the system.h smashing patch
96f951edb1f1bdbbc99b0cd458f9808bb83d58ae that introdued the direct inclusion
asm/cmpxchg.h into linux/llist.h.
CC: David Howells <dhowells@redhat.com>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/atomic.h | 6 | ||||
-rw-r--r-- | include/asm-generic/cmpxchg.h | 10 |
2 files changed, 10 insertions, 6 deletions
diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h index 1ced6413ea03..33bd2de3bc1e 100644 --- a/include/asm-generic/atomic.h +++ b/include/asm-generic/atomic.h | |||
@@ -136,12 +136,6 @@ static inline void atomic_dec(atomic_t *v) | |||
136 | #define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v))) | 136 | #define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v))) |
137 | #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) | 137 | #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) |
138 | 138 | ||
139 | #define cmpxchg_local(ptr, o, n) \ | ||
140 | ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ | ||
141 | (unsigned long)(n), sizeof(*(ptr)))) | ||
142 | |||
143 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | ||
144 | |||
145 | static inline int __atomic_add_unless(atomic_t *v, int a, int u) | 139 | static inline int __atomic_add_unless(atomic_t *v, int a, int u) |
146 | { | 140 | { |
147 | int c, old; | 141 | int c, old; |
diff --git a/include/asm-generic/cmpxchg.h b/include/asm-generic/cmpxchg.h index 14883026015d..811fb1e9b061 100644 --- a/include/asm-generic/cmpxchg.h +++ b/include/asm-generic/cmpxchg.h | |||
@@ -92,6 +92,16 @@ unsigned long __xchg(unsigned long x, volatile void *ptr, int size) | |||
92 | */ | 92 | */ |
93 | #include <asm-generic/cmpxchg-local.h> | 93 | #include <asm-generic/cmpxchg-local.h> |
94 | 94 | ||
95 | #ifndef cmpxchg_local | ||
96 | #define cmpxchg_local(ptr, o, n) \ | ||
97 | ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ | ||
98 | (unsigned long)(n), sizeof(*(ptr)))) | ||
99 | #endif | ||
100 | |||
101 | #ifndef cmpxchg64_local | ||
102 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | ||
103 | #endif | ||
104 | |||
95 | #define cmpxchg(ptr, o, n) cmpxchg_local((ptr), (o), (n)) | 105 | #define cmpxchg(ptr, o, n) cmpxchg_local((ptr), (o), (n)) |
96 | #define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n)) | 106 | #define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n)) |
97 | 107 | ||