diff options
Diffstat (limited to 'include/asm-i386/atomic.h')
-rw-r--r-- | include/asm-i386/atomic.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h index fd1d75beb..6346f91d1 100644 --- a/include/asm-i386/atomic.h +++ b/include/asm-i386/atomic.h @@ -73,6 +73,17 @@ static __inline__ int atomic_dec_and_test(volatile atomic_t *v) 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" \ |