patch-2.2.11 linux/include/asm-i386/atomic.h
Next file: linux/include/asm-i386/bugs.h
Previous file: linux/include/asm-arm/socket.h
Back to the patch index
Back to the overall index
- Lines: 18
- Date:
Mon Aug 9 12:04:41 1999
- Orig file:
v2.2.10/linux/include/asm-i386/atomic.h
- Orig date:
Tue May 11 10:35:42 1999
diff -u --recursive --new-file v2.2.10/linux/include/asm-i386/atomic.h linux/include/asm-i386/atomic.h
@@ -73,6 +73,17 @@
return c != 0;
}
+extern __inline__ int atomic_inc_and_test_greater_zero(volatile atomic_t *v)
+{
+ unsigned char c;
+
+ __asm__ __volatile__(
+ LOCK "incl %0; setg %1"
+ :"=m" (__atomic_fool_gcc(v)), "=qm" (c)
+ :"m" (__atomic_fool_gcc(v)));
+ return c; /* can be only 0 or 1 */
+}
+
/* 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)