]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-xtensa/system.h
[XTENSA] Clean up stat structs.
[linux-2.6-omap-h63xx.git] / include / asm-xtensa / system.h
index 9284867f1cb90616cfba4af95b14f42f3059cdd5..e0cb9116d8abe10249edcad13fdbcec603447bbe 100644 (file)
@@ -11,7 +11,6 @@
 #ifndef _XTENSA_SYSTEM_H
 #define _XTENSA_SYSTEM_H
 
-#include <linux/config.h>
 #include <linux/stringify.h>
 
 #include <asm/processor.h>
@@ -100,7 +99,6 @@ static inline void disable_coprocessor(int i)
 #endif
 
 #define set_mb(var, value)     do { var = value; mb(); } while (0)
-#define set_wmb(var, value)    do { var = value; wmb(); } while (0)
 
 #if !defined (__ASSEMBLY__)
 
@@ -111,8 +109,6 @@ extern void *_switch_to(void *last, void *next);
 
 #endif /* __ASSEMBLY__ */
 
-#define prepare_to_switch()    do { } while(0)
-
 #define switch_to(prev,next,last)              \
 do {                                           \
        clear_cpenable();                       \
@@ -160,8 +156,30 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
                                        (unsigned long)_n_, sizeof (*(ptr))); \
        })
 
+#include <asm-generic/cmpxchg-local.h>
 
+static inline unsigned long __cmpxchg_local(volatile void *ptr,
+                                     unsigned long old,
+                                     unsigned long new, int size)
+{
+       switch (size) {
+       case 4:
+               return __cmpxchg_u32(ptr, old, new);
+       default:
+               return __cmpxchg_local_generic(ptr, old, new, size);
+       }
 
+       return old;
+}
+
+/*
+ * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
+ * them available.
+ */
+#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))
 
 /*
  * xchg_u32
@@ -187,8 +205,6 @@ static inline unsigned long xchg_u32(volatile int * m, unsigned long val)
   return tmp;
 }
 
-#define tas(ptr) (xchg((ptr),1))
-
 #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
 
 /*
@@ -217,7 +233,7 @@ static inline void spill_registers(void)
        unsigned int a0, ps;
 
        __asm__ __volatile__ (
-               "movi   a14," __stringify (PS_EXCM_MASK) " | 1\n\t"
+               "movi   a14," __stringify (PS_EXCM_BIT) " | 1\n\t"
                "mov    a12, a0\n\t"
                "rsr    a13," __stringify(SAR) "\n\t"
                "xsr    a14," __stringify(PS) "\n\t"