]> nv-tegra.nvidia Code Review - linux-3.10.git/blobdiff - include/asm-i386/atomic.h
[PATCH] mutex subsystem, add atomic_xchg() to all arches
[linux-3.10.git] / include / asm-i386 / atomic.h
index c68557aa04b2b0ef9246086f6d52b156c72966c0..de649d3aa2d45d630874634c11f732e5e4819491 100644 (file)
@@ -216,6 +216,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t *v)
 }
 
 #define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new))
+#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
 
 /**
  * atomic_add_unless - add unless the number is a given value
@@ -254,4 +255,5 @@ __asm__ __volatile__(LOCK "orl %0,%1" \
 #define smp_mb__before_atomic_inc()    barrier()
 #define smp_mb__after_atomic_inc()     barrier()
 
+#include <asm-generic/atomic.h>
 #endif