]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-m68knommu/system.h
bluetooth/hci_bcsp: fix bitrev Kconfig
[linux-2.6-omap-h63xx.git] / include / asm-m68knommu / system.h
index 15b4c7d45c94a643865b511040cff2e5dcd0e04a..64c64432bbb80248c44ddfc34a6cc98beff938e1 100644 (file)
@@ -104,7 +104,7 @@ asmlinkage void resume(void);
 #define mb()   asm volatile (""   : : :"memory")
 #define rmb()  asm volatile (""   : : :"memory")
 #define wmb()  asm volatile (""   : : :"memory")
-#define set_mb(var, value) do { xchg(&var, value); } while (0)
+#define set_mb(var, value)     ({ (var) = (value); wmb(); })
 
 #ifdef CONFIG_SMP
 #define smp_mb()       mb()
@@ -186,42 +186,19 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
 }
 #endif
 
+#include <asm-generic/cmpxchg-local.h>
+
 /*
- * 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))
 
-#ifdef CONFIG_M68332
-#define HARD_RESET_NOW() ({            \
-        local_irq_disable();           \
-        asm("                          \
-       movew   #0x0000, 0xfffa6a;      \
-        reset;                         \
-        /*movew #0x1557, 0xfffa44;*/   \
-        /*movew #0x0155, 0xfffa46;*/   \
-        moveal #0, %a0;                        \
-        movec %a0, %vbr;               \
-        moveal 0, %sp;                 \
-        moveal 4, %a0;                 \
-        jmp (%a0);                     \
-        ");                            \
-})
+#ifndef CONFIG_SMP
+#include <asm-generic/cmpxchg.h>
 #endif
 
 #if defined( CONFIG_M68328 ) || defined( CONFIG_M68EZ328 ) || \