patch-2.3.30 linux/include/asm-i386/atomic.h
Next file: linux/include/asm-i386/cache.h
Previous file: linux/include/asm-arm/processor.h
Back to the patch index
Back to the overall index
- Lines: 18
- Date:
Mon Dec 6 17:22:06 1999
- Orig file:
v2.3.29/linux/include/asm-i386/atomic.h
- Orig date:
Thu Aug 26 13:05:40 1999
diff -u --recursive --new-file v2.3.29/linux/include/asm-i386/atomic.h linux/include/asm-i386/atomic.h
@@ -46,6 +46,17 @@
:"ir" (i), "m" (__atomic_fool_gcc(v)));
}
+static __inline__ int atomic_sub_and_test(int i, volatile atomic_t *v)
+{
+ unsigned char c;
+
+ __asm__ __volatile__(
+ LOCK "subl %2,%0; sete %1"
+ :"=m" (__atomic_fool_gcc(v)), "=qm" (c)
+ :"ir" (i), "m" (__atomic_fool_gcc(v)));
+ return c;
+}
+
static __inline__ void atomic_inc(volatile atomic_t *v)
{
__asm__ __volatile__(
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)