Go to the documentation of this file.
17 #ifndef _ASM_TILE_ATOMIC_H
18 #define _ASM_TILE_ATOMIC_H
20 #include <asm/cmpxchg.h>
24 #include <linux/compiler.h>
25 #include <linux/types.h>
27 #define ATOMIC_INIT(i) { (i) }
47 #define atomic_sub_return(i, v) atomic_add_return((int)(-(i)), (v))
56 #define atomic_sub(i, v) atomic_add((int)(-(i)), (v))
66 #define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0)
74 #define atomic_inc_return(v) atomic_add_return(1, (v))
82 #define atomic_dec_return(v) atomic_sub_return(1, (v))
90 #define atomic_inc(v) atomic_add(1, (v))
98 #define atomic_dec(v) atomic_sub(1, (v))
106 #define atomic_dec_and_test(v) (atomic_dec_return(v) == 0)
114 #define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
124 #define atomic_add_negative(i, v) (atomic_add_return((i), (v)) < 0)
129 #include <asm/atomic_32.h>
131 #include <asm/atomic_64.h>