patch-1.3.84 linux/include/asm-i386/atomic.h
Next file: linux/include/asm-i386/system.h
Previous file: linux/include/asm-alpha/posix_types.h
Back to the patch index
Back to the overall index
- Lines: 16
- Date:
Thu Apr 4 13:04:45 1996
- Orig file:
v1.3.83/linux/include/asm-i386/atomic.h
- Orig date:
Wed Mar 20 14:38:42 1996
diff -u --recursive --new-file v1.3.83/linux/include/asm-i386/atomic.h linux/include/asm-i386/atomic.h
@@ -53,4 +53,15 @@
:"m" (__atomic_fool_gcc(v)));
}
+static __inline__ int atomic_dec_and_test(atomic_t *v)
+{
+ unsigned char c;
+
+ __asm__ __volatile__(
+ LOCK "decl %0; sete %1"
+ :"=m" (__atomic_fool_gcc(v)), "=qm" (c)
+ :"m" (__atomic_fool_gcc(v)));
+ return c != 0;
+}
+
#endif
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this