Lines Matching +full:2 +full:v
34 * @v: pointer of type atomic_t
36 * Atomically reads the value of @v.
38 #define arch_atomic_read(v) READ_ONCE((v)->counter) argument
42 * @v: pointer of type atomic_t
45 * Atomically sets the value of @v to @i.
47 #define arch_atomic_set(v, i) WRITE_ONCE((v)->counter, (i)) argument
50 static inline void arch_atomic_##op(int i, atomic_t *v) \
54 : "+ZB" (v->counter) \
60 static inline int arch_atomic_##op##_return_relaxed(int i, atomic_t *v) \
65 "am"#asm_op"_db.w" " %1, %2, %0 \n" \
66 : "+ZB" (v->counter), "=&r" (result) \
74 static inline int arch_atomic_fetch_##op##_relaxed(int i, atomic_t *v) \
79 "am"#asm_op"_db.w" " %1, %2, %0 \n" \
80 : "+ZB" (v->counter), "=&r" (result) \
119 static inline int arch_atomic_fetch_add_unless(atomic_t *v, int a, int u) in ATOMIC_OPS()
129 " b 2f\n" in ATOMIC_OPS()
132 "2:\n" in ATOMIC_OPS()
134 [c]"=ZB" (v->counter) in ATOMIC_OPS()
145 * @v: pointer of type atomic_t
147 * Atomically test @v and subtract @i if @v is greater or equal than @i.
148 * The function returns the old value of @v minus @i.
150 static inline int arch_atomic_sub_if_positive(int i, atomic_t *v) in arch_atomic_sub_if_positive() argument
157 "1: ll.w %1, %2 # atomic_sub_if_positive\n" in arch_atomic_sub_if_positive()
160 " bltz %0, 2f \n" in arch_atomic_sub_if_positive()
161 " sc.w %1, %2 \n" in arch_atomic_sub_if_positive()
163 "2: \n" in arch_atomic_sub_if_positive()
165 : "=&r" (result), "=&r" (temp), "+ZC" (v->counter) in arch_atomic_sub_if_positive()
169 "1: ll.w %1, %2 # atomic_sub_if_positive\n" in arch_atomic_sub_if_positive()
172 " bltz %0, 2f \n" in arch_atomic_sub_if_positive()
173 " sc.w %1, %2 \n" in arch_atomic_sub_if_positive()
175 "2: \n" in arch_atomic_sub_if_positive()
177 : "=&r" (result), "=&r" (temp), "+ZC" (v->counter) in arch_atomic_sub_if_positive()
184 #define arch_atomic_cmpxchg(v, o, n) (arch_cmpxchg(&((v)->counter), (o), (n))) argument
185 #define arch_atomic_xchg(v, new) (arch_xchg(&((v)->counter), (new))) argument
189 * @v: pointer of type atomic_t
191 #define arch_atomic_dec_if_positive(v) arch_atomic_sub_if_positive(1, v) argument
199 * @v: pointer of type atomic64_t
202 #define arch_atomic64_read(v) READ_ONCE((v)->counter) argument
206 * @v: pointer of type atomic64_t
209 #define arch_atomic64_set(v, i) WRITE_ONCE((v)->counter, (i)) argument
212 static inline void arch_atomic64_##op(long i, atomic64_t *v) \
216 : "+ZB" (v->counter) \
222 static inline long arch_atomic64_##op##_return_relaxed(long i, atomic64_t *v) \
226 "am"#asm_op"_db.d " " %1, %2, %0 \n" \
227 : "+ZB" (v->counter), "=&r" (result) \
235 static inline long arch_atomic64_fetch_##op##_relaxed(long i, atomic64_t *v) \
240 "am"#asm_op"_db.d " " %1, %2, %0 \n" \
241 : "+ZB" (v->counter), "=&r" (result) \
280 static inline long arch_atomic64_fetch_add_unless(atomic64_t *v, long a, long u) in ATOMIC64_OPS()
290 " b 2f\n" in ATOMIC64_OPS()
293 "2:\n" in ATOMIC64_OPS()
295 [c] "=ZB" (v->counter) in ATOMIC64_OPS()
306 * @v: pointer of type atomic64_t
308 * Atomically test @v and subtract @i if @v is greater or equal than @i.
309 * The function returns the old value of @v minus @i.
311 static inline long arch_atomic64_sub_if_positive(long i, atomic64_t *v) in arch_atomic64_sub_if_positive() argument
318 "1: ll.d %1, %2 # atomic64_sub_if_positive \n" in arch_atomic64_sub_if_positive()
321 " bltz %0, 2f \n" in arch_atomic64_sub_if_positive()
322 " sc.d %1, %2 \n" in arch_atomic64_sub_if_positive()
324 "2: \n" in arch_atomic64_sub_if_positive()
326 : "=&r" (result), "=&r" (temp), "+ZC" (v->counter) in arch_atomic64_sub_if_positive()
330 "1: ll.d %1, %2 # atomic64_sub_if_positive \n" in arch_atomic64_sub_if_positive()
333 " bltz %0, 2f \n" in arch_atomic64_sub_if_positive()
334 " sc.d %1, %2 \n" in arch_atomic64_sub_if_positive()
336 "2: \n" in arch_atomic64_sub_if_positive()
338 : "=&r" (result), "=&r" (temp), "+ZC" (v->counter) in arch_atomic64_sub_if_positive()
345 #define arch_atomic64_cmpxchg(v, o, n) \ argument
346 ((__typeof__((v)->counter))arch_cmpxchg(&((v)->counter), (o), (n)))
347 #define arch_atomic64_xchg(v, new) (arch_xchg(&((v)->counter), (new))) argument
351 * @v: pointer of type atomic64_t
353 #define arch_atomic64_dec_if_positive(v) arch_atomic64_sub_if_positive(1, v) argument