summaryrefslogtreecommitdiffstats
path: root/include/asm-sparc/atomic.h
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-11-16 02:56:07 +0100
committerJeff Garzik <jgarzik@pobox.com>2005-11-16 02:56:07 +0100
commit77ed78e5cf32be1c3fae5c477cc1d78e2e3f17db (patch)
tree805db8c5c180ee7ee85b3c484461100c91f6c781 /include/asm-sparc/atomic.h
parentMerge branch 'upstream-fixes' (diff)
parentMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 (diff)
downloadlinux-77ed78e5cf32be1c3fae5c477cc1d78e2e3f17db.tar.xz
linux-77ed78e5cf32be1c3fae5c477cc1d78e2e3f17db.zip
Merge branch 'master'
Diffstat (limited to 'include/asm-sparc/atomic.h')
-rw-r--r--include/asm-sparc/atomic.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/asm-sparc/atomic.h b/include/asm-sparc/atomic.h
index 37f6ab601c3d..62bec7ad271c 100644
--- a/include/asm-sparc/atomic.h
+++ b/include/asm-sparc/atomic.h
@@ -19,6 +19,8 @@ typedef struct { volatile int counter; } atomic_t;
#define ATOMIC_INIT(i) { (i) }
extern int __atomic_add_return(int, atomic_t *);
+extern int atomic_cmpxchg(atomic_t *, int, int);
+extern int atomic_add_unless(atomic_t *, int, int);
extern void atomic_set(atomic_t *, int);
#define atomic_read(v) ((v)->counter)
@@ -48,6 +50,8 @@ extern void atomic_set(atomic_t *, int);
#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0)
#define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0)
+#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
+
/* This is the old 24-bit implementation. It's still used internally
* by some sparc-specific code, notably the semaphore implementation.
*/