• Home
  • Raw
  • Download

Lines Matching +full:2 +full:v

43  * @v: pointer of type atomic_t
45 * Atomically reads the value of @v.
47 #define atomic_read(v) READ_ONCE((v)->counter) argument
51 * @v: pointer of type atomic_t
54 * Atomically sets the value of @v to @i.
56 #define atomic_set(v, i) WRITE_ONCE((v)->counter, (i)) argument
59 static __inline__ void atomic_##op(int i, atomic_t * v) \
63 : "+ZB" (v->counter) \
69 static __inline__ int atomic_##op##_return##suffix(int i, atomic_t * v) \
74 "am"#asm_op#mb".w" " %1, %2, %0 \n" \
75 : "+ZB" (v->counter), "=&r" (result) \
83 static __inline__ int atomic_fetch_##op##suffix(int i, atomic_t * v) \
88 "am"#asm_op#mb".w" " %1, %2, %0 \n" \
89 : "+ZB" (v->counter), "=&r" (result) \
152 static __inline__ int atomic_fetch_add_unless(atomic_t *v, int a, int u) in ATOMIC_OPS()
162 " b 2f\n" in ATOMIC_OPS()
165 "2:\n" in ATOMIC_OPS()
167 [c]"=ZB" (v->counter) in ATOMIC_OPS()
178 * @v: pointer of type atomic_t
180 * Atomically test @v and subtract @i if @v is greater or equal than @i.
181 * The function returns the old value of @v minus @i.
183 static __inline__ int atomic_sub_if_positive(int i, atomic_t * v) in atomic_sub_if_positive() argument
190 "1: ll.w %1, %2 # atomic_sub_if_positive\n" in atomic_sub_if_positive()
193 " blt %0, $zero, 2f \n" in atomic_sub_if_positive()
194 " sc.w %1, %2 \n" in atomic_sub_if_positive()
196 "2: \n" in atomic_sub_if_positive()
198 : "=&r" (result), "=&r" (temp), "+ZC" (v->counter) in atomic_sub_if_positive()
202 "1: ll.w %1, %2 # atomic_sub_if_positive\n" in atomic_sub_if_positive()
205 " blt %0, $zero, 2f \n" in atomic_sub_if_positive()
206 " sc.w %1, %2 \n" in atomic_sub_if_positive()
208 "2: \n" in atomic_sub_if_positive()
210 : "=&r" (result), "=&r" (temp), "+ZC" (v->counter) in atomic_sub_if_positive()
217 #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n))) argument
218 #define atomic_xchg(v, new) (xchg(&((v)->counter), (new))) argument
222 * @v: pointer of type atomic_t
224 #define atomic_dec_if_positive(v) atomic_sub_if_positive(1, v) argument
232 * @v: pointer of type atomic64_t
235 #define atomic64_read(v) READ_ONCE((v)->counter) argument
239 * @v: pointer of type atomic64_t
242 #define atomic64_set(v, i) WRITE_ONCE((v)->counter, (i)) argument
245 static __inline__ void atomic64_##op(long i, atomic64_t * v) \
249 : "+ZB" (v->counter) \
255 static __inline__ long atomic64_##op##_return##suffix(long i, atomic64_t * v) \
259 "am"#asm_op#mb".d " " %1, %2, %0 \n" \
260 : "+ZB" (v->counter), "=&r" (result) \
268 static __inline__ long atomic64_fetch_##op##suffix(long i, atomic64_t * v) \
273 "am"#asm_op#mb".d " " %1, %2, %0 \n" \
274 : "+ZB" (v->counter), "=&r" (result) \
337 static __inline__ long atomic64_fetch_add_unless(atomic64_t *v, long a, long u) in ATOMIC64_OPS()
347 " b 2f\n" in ATOMIC64_OPS()
350 "2:\n" in ATOMIC64_OPS()
352 [c] "=ZB" (v->counter) in ATOMIC64_OPS()
364 * @v: pointer of type atomic64_t
366 * Atomically test @v and subtract @i if @v is greater or equal than @i.
367 * The function returns the old value of @v minus @i.
369 static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v) in atomic64_sub_if_positive() argument
376 "1: ll.d %1, %2 # atomic64_sub_if_positive \n" in atomic64_sub_if_positive()
379 " blt %0, $zero, 2f \n" in atomic64_sub_if_positive()
380 " sc.d %1, %2 \n" in atomic64_sub_if_positive()
382 "2: \n" in atomic64_sub_if_positive()
384 : "=&r" (result), "=&r" (temp), "+ZC" (v->counter) in atomic64_sub_if_positive()
388 "1: ll.d %1, %2 # atomic64_sub_if_positive \n" in atomic64_sub_if_positive()
391 " blt %0, $zero, 2f \n" in atomic64_sub_if_positive()
392 " sc.d %1, %2 \n" in atomic64_sub_if_positive()
394 "2: \n" in atomic64_sub_if_positive()
396 : "=&r" (result), "=&r" (temp), "+ZC" (v->counter) in atomic64_sub_if_positive()
403 #define atomic64_cmpxchg(v, o, n) \ argument
404 ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
405 #define atomic64_xchg(v, new) (xchg(&((v)->counter), (new))) argument
409 * @v: pointer of type atomic64_t
411 #define atomic64_dec_if_positive(v) atomic64_sub_if_positive(1, v) argument