patch-2.3.16 linux/include/asm-arm/atomic.h

Next file: linux/include/asm-arm/bugs.h
Previous file: linux/include/asm-arm/arch-rpc/system.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.15/linux/include/asm-arm/atomic.h linux/include/asm-arm/atomic.h
@@ -81,6 +81,19 @@
 	return result;
 }
 
+extern __inline__ int atomic_add_negative(int i, volatile atomic_t *v)
+{
+	unsigned long flags;
+	int result;
+
+	save_flags_cli(flags);
+	v->counter += i;
+	result = (v->counter < 0);
+	restore_flags(flags);
+
+	return result;
+}
+
 static __inline__ void atomic_clear_mask(unsigned long mask, unsigned long *addr)
 {
 	unsigned long flags;

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