--- zzzz-none-000/linux-2.4.17/include/asm-mips/atomic.h 2001-09-09 17:43:01.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/include/asm-mips/atomic.h 2004-11-24 13:21:33.000000000 +0000 @@ -228,7 +228,7 @@ * other cases. Note that the guaranteed * useful range of an atomic_t is only 24 bits. */ -#define atomic_inc_and_test(v) (atomic_inc_return(1, (v)) == 0) +#define atomic_inc_and_test(v) (atomic_inc_return((v)) == 0) /* * atomic_dec_and_test - decrement by 1 and test @@ -269,9 +269,10 @@ * result is greater than or equal to zero. Note that the guaranteed * useful range of an atomic_t is only 24 bits. * - * Currently not implemented for MIPS. */ +#define atomic_add_negative(i,v) (atomic_add_return((i), (v)) < 0) + /* Atomic operations are already serializing */ #define smp_mb__before_atomic_dec() barrier() #define smp_mb__after_atomic_dec() barrier()