]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sparc32: add atomic_sub_and_test()
authorWilliam Lee Irwin III <wli@holomorphy.com>
Wed, 20 Oct 2004 01:14:28 +0000 (18:14 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 20 Oct 2004 01:14:28 +0000 (18:14 -0700)
Add atomic_sub_and_test() to sparc32, implemented in terms of
atomic_sub_return(), so reiser4 can be simultaneously microoptimized for
x86 and made to pass compilation testing on sparc32.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/asm-sparc/atomic.h

index fe210f3614c3117106f557a7d179ae19c62021e1..37f6ab601c3ddf846392e1ef8d732a778e10a55e 100644 (file)
@@ -46,6 +46,7 @@ extern void atomic_set(atomic_t *, int);
 #define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
 
 #define atomic_dec_and_test(v) (atomic_dec_return(v) == 0)
+#define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0)
 
 /* This is the old 24-bit implementation.  It's still used internally
  * by some sparc-specific code, notably the semaphore implementation.