From 7f2267b220824dfb7a0bed8ff170cf215d47a4ca Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 7 Feb 2008 00:16:20 -0800 Subject: [PATCH] --- yaml --- r: 83901 b: refs/heads/master c: 027bcc27d3d1a218dbf4477964a18fed78983357 h: refs/heads/master i: 83899: daaf5ac245659f251d8b8c359063f16eb65090b1 v: v3 --- [refs] | 2 +- trunk/include/asm-m68knommu/system.h | 28 +++++++++++----------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/[refs] b/[refs] index 57fd10ea5463..b72f2092bddd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5da751035c5c8f5b30978e97fd4b3c75f453b04e +refs/heads/master: 027bcc27d3d1a218dbf4477964a18fed78983357 diff --git a/trunk/include/asm-m68knommu/system.h b/trunk/include/asm-m68knommu/system.h index ee2dc07bae0e..039ab3f81732 100644 --- a/trunk/include/asm-m68knommu/system.h +++ b/trunk/include/asm-m68knommu/system.h @@ -186,26 +186,20 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz } #endif +#include + /* - * Atomic compare and exchange. Compare OLD with MEM, if identical, - * store NEW in MEM. Return the initial value in MEM. Success is - * indicated by comparing RETURN with OLD. + * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make + * them available. */ -#define __HAVE_ARCH_CMPXCHG 1 - -static __inline__ unsigned long -cmpxchg(volatile int *p, int old, int new) -{ - unsigned long flags; - int prev; - - local_irq_save(flags); - if ((prev = *p) == old) - *p = new; - local_irq_restore(flags); - return(prev); -} +#define cmpxchg_local(ptr, o, n) \ + ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ + (unsigned long)(n), sizeof(*(ptr)))) +#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) +#ifndef CONFIG_SMP +#include +#endif #if defined( CONFIG_M68328 ) || defined( CONFIG_M68EZ328 ) || \ defined (CONFIG_M68360) || defined( CONFIG_M68VZ328 )