Lines Matching +full:1 +full:v

19 #define atomic_read(v)		READ_ONCE((v)->counter)  argument
20 #define atomic_set(v, i) WRITE_ONCE(((v)->counter), (i)) argument
33 static inline void atomic_##op(int i, atomic_t *v) \
35 __asm__ __volatile__(#asm_op "l %1,%0" : "+m" (*v) : ASM_DI (i));\
41 static inline int atomic_##op##_return(int i, atomic_t *v) \
46 "1: movel %2,%1\n" \
47 " " #asm_op "l %3,%1\n" \
48 " casl %2,%1,%0\n" \
49 " jne 1b" \
50 : "+m" (*v), "=&d" (t), "=&d" (tmp) \
51 : "g" (i), "2" (atomic_read(v))); \
56 static inline int atomic_fetch_##op(int i, atomic_t *v) \
61 "1: movel %2,%1\n" \
62 " " #asm_op "l %3,%1\n" \
63 " casl %2,%1,%0\n" \
64 " jne 1b" \
65 : "+m" (*v), "=&d" (t), "=&d" (tmp) \
66 : "g" (i), "2" (atomic_read(v))); \
73 static inline int atomic_##op##_return(int i, atomic_t * v) \
79 t = (v->counter c_op i); \
86 static inline int atomic_fetch_##op(int i, atomic_t * v) \
92 t = v->counter; \
93 v->counter c_op i; \
123 static inline void atomic_inc(atomic_t *v) in atomic_inc() argument
125 __asm__ __volatile__("addql #1,%0" : "+m" (*v)); in atomic_inc()
129 static inline void atomic_dec(atomic_t *v) in atomic_dec() argument
131 __asm__ __volatile__("subql #1,%0" : "+m" (*v)); in atomic_dec()
135 static inline int atomic_dec_and_test(atomic_t *v) in atomic_dec_and_test() argument
138 __asm__ __volatile__("subql #1,%1; seq %0" : "=d" (c), "+m" (*v)); in atomic_dec_and_test()
143 static inline int atomic_dec_and_test_lt(atomic_t *v) in atomic_dec_and_test_lt() argument
147 "subql #1,%1; slt %0" in atomic_dec_and_test_lt()
148 : "=d" (c), "=m" (*v) in atomic_dec_and_test_lt()
149 : "m" (*v)); in atomic_dec_and_test_lt()
153 static inline int atomic_inc_and_test(atomic_t *v) in atomic_inc_and_test() argument
156 __asm__ __volatile__("addql #1,%1; seq %0" : "=d" (c), "+m" (*v)); in atomic_inc_and_test()
163 #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) argument
164 #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) argument
168 static inline int atomic_cmpxchg(atomic_t *v, int old, int new) in atomic_cmpxchg() argument
174 prev = atomic_read(v); in atomic_cmpxchg()
176 atomic_set(v, new); in atomic_cmpxchg()
181 static inline int atomic_xchg(atomic_t *v, int new) in atomic_xchg() argument
187 prev = atomic_read(v); in atomic_xchg()
188 atomic_set(v, new); in atomic_xchg()
195 static inline int atomic_sub_and_test(int i, atomic_t *v) in atomic_sub_and_test() argument
198 __asm__ __volatile__("subl %2,%1; seq %0" in atomic_sub_and_test()
199 : "=d" (c), "+m" (*v) in atomic_sub_and_test()
205 static inline int atomic_add_negative(int i, atomic_t *v) in atomic_add_negative() argument
208 __asm__ __volatile__("addl %2,%1; smi %0" in atomic_add_negative()
209 : "=d" (c), "+m" (*v) in atomic_add_negative()