patch-2.4.22 linux-2.4.22/include/asm-mips64/atomic.h

Next file: linux-2.4.22/include/asm-mips64/bitops.h
Previous file: linux-2.4.22/include/asm-mips64/asm.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/include/asm-mips64/atomic.h linux-2.4.22/include/asm-mips64/atomic.h
@@ -140,8 +140,8 @@
  * and returns true if the result is zero, or false for all
  * other cases.  Note that the guaranteed
  * useful range of an atomic_t is only 24 bits.
- * atomic_inc_and_test is currently not implemented for mips64.
  */
+#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
 
 /*
  * atomic_dec_and_test - decrement by 1 and test
@@ -181,9 +181,8 @@
  * if the result is negative, or false when
  * result is greater than or equal to zero.  Note that the guaranteed
  * useful range of an atomic_t is only 24 bits.
- *
- * atomic_add_negative is currently not implemented for mips64.
  */
+#define atomic_add_negative(i,v) (atomic_add_return(i, (v)) < 0)
 
 /* Atomic operations are already serializing */
 #define smp_mb__before_atomic_dec()	smp_mb()

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)