patch-2.3.15 linux/include/asm-i386/atomic.h

Next file: linux/include/asm-i386/dma.h
Previous file: linux/include/asm-arm/unistd.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.14/linux/include/asm-i386/atomic.h linux/include/asm-i386/atomic.h
@@ -73,6 +73,17 @@
 	return c != 0;
 }
 
+extern __inline__ int atomic_add_negative(int i, volatile atomic_t *v)
+{
+	unsigned char c;
+
+	__asm__ __volatile__(
+		LOCK "addl %2,%0; sets %1"
+		:"=m" (__atomic_fool_gcc(v)), "=qm" (c)
+		:"ir" (i), "m" (__atomic_fool_gcc(v)));
+	return c;
+}
+
 /* These are x86-specific, used by some header files */
 #define atomic_clear_mask(mask, addr) \
 __asm__ __volatile__(LOCK "andl %0,%1" \

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