Revert the patch named arm-cmpxchg.patch in the preempt-rt patchset Currently the patch arm-cmpxchg.patch is part of the preempt-rt patchset. Although it applies correctly, it introduces now a 2nd implementation of the cmpxchg() macro, and thus a compile error. Because this architecture does not have a real cmpxchg() assembler instruction, and the implementation is almost the same as the generic definition, the generic definition is now used instead. BUT: the __HAVE_ARCH_CMPXCHG is not set any longer, because it is not set in the generic implementation. Some review is required for the kernel/rtmutex.c code to make sure the code still behaves well without this flag set. I have only compile tested this patch! I have not confronted any hardware with this patch yet. **** REVIEW REQUIRED on rtmutex code! **** NOTE: Instead of applying this patch, it is even better to remove the arm-cmpxchg.patch from the preempt-rt set because this patch only reverts that patch. Signed-off-by: Remy Bohmer --- include/asm-arm/atomic.h | 35 ----------------------------------- 1 file changed, 35 deletions(-) Index: linux-2.6.25.11/include/asm-arm/atomic.h =================================================================== --- linux-2.6.25.11.orig/include/asm-arm/atomic.h 2008-07-16 17:14:01.000000000 +0200 +++ linux-2.6.25.11/include/asm-arm/atomic.h 2008-07-16 17:15:15.000000000 +0200 @@ -213,41 +213,6 @@ static inline void atomic_clear_mask(uns raw_local_irq_restore(flags); } -#ifndef CONFIG_SMP -/* - * Atomic compare and exchange. - */ -#define __HAVE_ARCH_CMPXCHG 1 - -extern unsigned long wrong_size_cmpxchg(volatile void *ptr); - -static inline unsigned long __cmpxchg(volatile void *ptr, - unsigned long old, - unsigned long new, int size) -{ - unsigned long flags, prev; - volatile unsigned long *p = ptr; - - if (size == 4) { - local_irq_save(flags); - if ((prev = *p) == old) - *p = new; - local_irq_restore(flags); - return(prev); - } else - return wrong_size_cmpxchg(ptr); -} - -#define cmpxchg(ptr,o,n) \ -({ \ - __typeof__(*(ptr)) _o_ = (o); \ - __typeof__(*(ptr)) _n_ = (n); \ - (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \ - (unsigned long)_n_, sizeof(*(ptr))); \ -}) - -#endif - #endif /* __LINUX_ARM_ARCH__ */ #define atomic_xchg(v, new) (xchg(&((v)->counter), new))