]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/asm-powerpc/atomic.h
[PATCH] atomic: cmpxchg
[karo-tx-linux.git] / include / asm-powerpc / atomic.h
index 9c0b372a46e1ffb4f0160857ff0f21192f401692..37205faa9d7c7a872f4a711ee3b162ec1858ab6d 100644 (file)
@@ -164,6 +164,8 @@ static __inline__ int atomic_dec_return(atomic_t *v)
        return t;
 }
 
+#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
+
 #define atomic_sub_and_test(a, v)      (atomic_sub_return((a), (v)) == 0)
 #define atomic_dec_and_test(v)         (atomic_dec_return((v)) == 0)