]> 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 accb4967e9d2a82b5f5c8e49edf59894f742b496..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);