]> err.no Git - linux-2.6/blobdiff - include/asm-sparc/atomic.h
[PATCH] mutex subsystem, add atomic_xchg() to all arches
[linux-2.6] / include / asm-sparc / atomic.h
index 62bec7ad271c496e81a8f2d95d4f4377cb16c952..e1033170bd3ad89dcb473f76ebd9f636641cb57a 100644 (file)
@@ -20,6 +20,7 @@ typedef struct { volatile int counter; } atomic_t;
 
 extern int __atomic_add_return(int, atomic_t *);
 extern int atomic_cmpxchg(atomic_t *, int, int);
+#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
 extern int atomic_add_unless(atomic_t *, int, int);
 extern void atomic_set(atomic_t *, int);
 
@@ -159,4 +160,5 @@ static inline int __atomic24_sub(int i, atomic24_t *v)
 
 #endif /* !(__KERNEL__) */
 
+#include <asm-generic/atomic.h>
 #endif /* !(__ARCH_SPARC_ATOMIC__) */