patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / include / asm-ppc / atomic.h
index 6cd515b..eeafd50 100644 (file)
@@ -134,6 +134,16 @@ static __inline__ int atomic_inc_return(atomic_t *v)
        return t;
 }
 
+/*
+ * atomic_inc_and_test - increment and test
+ * @v: pointer of type atomic_t
+ *
+ * Atomically increments @v by 1
+ * and returns true if the result is zero, or false for all
+ * other cases.
+ */
+#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
+
 static __inline__ void atomic_dec(atomic_t *v)
 {
        int t;