diff options
-rw-r--r-- | include/asm-m68knommu/system.h | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h index ee2dc07bae0e..039ab3f81732 100644 --- a/include/asm-m68knommu/system.h +++ b/include/asm-m68knommu/system.h | |||
@@ -186,26 +186,20 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz | |||
186 | } | 186 | } |
187 | #endif | 187 | #endif |
188 | 188 | ||
189 | #include <asm-generic/cmpxchg-local.h> | ||
190 | |||
189 | /* | 191 | /* |
190 | * Atomic compare and exchange. Compare OLD with MEM, if identical, | 192 | * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make |
191 | * store NEW in MEM. Return the initial value in MEM. Success is | 193 | * them available. |
192 | * indicated by comparing RETURN with OLD. | ||
193 | */ | 194 | */ |
194 | #define __HAVE_ARCH_CMPXCHG 1 | 195 | #define cmpxchg_local(ptr, o, n) \ |
195 | 196 | ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ | |
196 | static __inline__ unsigned long | 197 | (unsigned long)(n), sizeof(*(ptr)))) |
197 | cmpxchg(volatile int *p, int old, int new) | 198 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) |
198 | { | ||
199 | unsigned long flags; | ||
200 | int prev; | ||
201 | |||
202 | local_irq_save(flags); | ||
203 | if ((prev = *p) == old) | ||
204 | *p = new; | ||
205 | local_irq_restore(flags); | ||
206 | return(prev); | ||
207 | } | ||
208 | 199 | ||
200 | #ifndef CONFIG_SMP | ||
201 | #include <asm-generic/cmpxchg.h> | ||
202 | #endif | ||
209 | 203 | ||
210 | #if defined( CONFIG_M68328 ) || defined( CONFIG_M68EZ328 ) || \ | 204 | #if defined( CONFIG_M68328 ) || defined( CONFIG_M68EZ328 ) || \ |
211 | defined (CONFIG_M68360) || defined( CONFIG_M68VZ328 ) | 205 | defined (CONFIG_M68360) || defined( CONFIG_M68VZ328 ) |