diff options
-rw-r--r-- | include/asm-m68k/system.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h index caa9b1663e45..dbb6515ffd5b 100644 --- a/include/asm-m68k/system.h +++ b/include/asm-m68k/system.h | |||
@@ -154,6 +154,10 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz | |||
154 | } | 154 | } |
155 | #endif | 155 | #endif |
156 | 156 | ||
157 | #include <asm-generic/cmpxchg-local.h> | ||
158 | |||
159 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | ||
160 | |||
157 | /* | 161 | /* |
158 | * Atomic compare and exchange. Compare OLD with MEM, if identical, | 162 | * Atomic compare and exchange. Compare OLD with MEM, if identical, |
159 | * store NEW in MEM. Return the initial value in MEM. Success is | 163 | * store NEW in MEM. Return the initial value in MEM. Success is |
@@ -185,9 +189,26 @@ static inline unsigned long __cmpxchg(volatile void *p, unsigned long old, | |||
185 | return old; | 189 | return old; |
186 | } | 190 | } |
187 | 191 | ||
188 | #define cmpxchg(ptr,o,n)\ | 192 | #define cmpxchg(ptr, o, n) \ |
189 | ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ | 193 | ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \ |
190 | (unsigned long)(n),sizeof(*(ptr)))) | 194 | (unsigned long)(n), sizeof(*(ptr)))) |
195 | #define cmpxchg_local(ptr, o, n) \ | ||
196 | ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \ | ||
197 | (unsigned long)(n), sizeof(*(ptr)))) | ||
198 | #else | ||
199 | |||
200 | /* | ||
201 | * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make | ||
202 | * them available. | ||
203 | */ | ||
204 | #define cmpxchg_local(ptr, o, n) \ | ||
205 | ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ | ||
206 | (unsigned long)(n), sizeof(*(ptr)))) | ||
207 | |||
208 | #ifndef CONFIG_SMP | ||
209 | #include <asm-generic/cmpxchg.h> | ||
210 | #endif | ||
211 | |||
191 | #endif | 212 | #endif |
192 | 213 | ||
193 | #define arch_align_stack(x) (x) | 214 | #define arch_align_stack(x) (x) |