[PARISC] Add atomic_sub_and_test
authorKyle McMartin <kyle@parisc-linux.org>
Thu, 30 Mar 2006 00:47:32 +0000 (19:47 -0500)
committerKyle McMartin <kyle@hera.kernel.org>
Thu, 30 Mar 2006 17:48:59 +0000 (17:48 +0000)
Define atomic_sub_and_test to fix build failures.

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
include/asm-parisc/atomic.h

index 4dc7253ff5d06a2e80a44388996b31bd8ce9019c..403ea97316cf2fbdeecefed72db9c38561ad8965 100644 (file)
@@ -210,6 +210,8 @@ static __inline__ int atomic_read(const atomic_t *v)
 
 #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_INIT(i) ((atomic_t) { (i) })
 
 #define smp_mb__before_atomic_dec()    smp_mb()
@@ -267,6 +269,7 @@ atomic64_read(const atomic64_t *v)
 
 #define atomic64_inc_and_test(v)       (atomic64_inc_return(v) == 0)
 #define atomic64_dec_and_test(v)       (atomic64_dec_return(v) == 0)
+#define atomic64_sub_and_test(i,v)     (atomic64_sub_return((i),(v)) == 0)
 
 #endif /* __LP64__ */