• Home
  • Raw
  • Download

Lines Matching +full:2 +full:v

40  * @v: pointer of type atomic_t
42 * Atomically reads the value of @v.
44 #define atomic_read(v) READ_ONCE((v)->counter) argument
48 * @v: pointer of type atomic_t
51 * Atomically sets the value of @v to @i.
53 #define atomic_set(v, i) WRITE_ONCE((v)->counter, (i)) argument
56 static __inline__ void atomic_##op(int i, atomic_t * v) \
64 " " #asm_op " %0, %2 \n" \
68 : "=&r" (temp), "+" GCC_OFF_SMALL_ASM() (v->counter) \
74 v->counter c_op i; \
80 static __inline__ int atomic_##op##_return_relaxed(int i, atomic_t * v) \
89 "1: ll %1, %2 # atomic_" #op "_return \n" \
91 " sc %0, %2 \n" \
96 "+" GCC_OFF_SMALL_ASM() (v->counter) \
102 result = v->counter; \
104 v->counter = result; \
112 static __inline__ int atomic_fetch_##op##_relaxed(int i, atomic_t * v) \
121 "1: ll %1, %2 # atomic_fetch_" #op " \n" \
123 " sc %0, %2 \n" \
128 "+" GCC_OFF_SMALL_ASM() (v->counter) \
134 result = v->counter; \
135 v->counter c_op i; \
176 * @v: pointer of type atomic_t
178 * Atomically test @v and subtract @i if @v is greater or equal than @i.
179 * The function returns the old value of @v minus @i.
181 static __inline__ int atomic_sub_if_positive(int i, atomic_t * v) in atomic_sub_if_positive() argument
192 "1: ll %1, %2 # atomic_sub_if_positive\n" in atomic_sub_if_positive()
198 " sc %1, %2 \n" in atomic_sub_if_positive()
203 "+" GCC_OFF_SMALL_ASM() (v->counter) in atomic_sub_if_positive()
209 result = v->counter; in atomic_sub_if_positive()
212 v->counter = result; in atomic_sub_if_positive()
221 #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n))) argument
222 #define atomic_xchg(v, new) (xchg(&((v)->counter), (new))) argument
226 * @v: pointer of type atomic_t
228 #define atomic_dec_if_positive(v) atomic_sub_if_positive(1, v) argument
236 * @v: pointer of type atomic64_t
239 #define atomic64_read(v) READ_ONCE((v)->counter) argument
243 * @v: pointer of type atomic64_t
246 #define atomic64_set(v, i) WRITE_ONCE((v)->counter, (i)) argument
249 static __inline__ void atomic64_##op(long i, atomic64_t * v) \
257 " " #asm_op " %0, %2 \n" \
261 : "=&r" (temp), "+" GCC_OFF_SMALL_ASM() (v->counter) \
267 v->counter c_op i; \
273 static __inline__ long atomic64_##op##_return_relaxed(long i, atomic64_t * v) \
282 "1: lld %1, %2 # atomic64_" #op "_return\n" \
284 " scd %0, %2 \n" \
289 "+" GCC_OFF_SMALL_ASM() (v->counter) \
295 result = v->counter; \
297 v->counter = result; \
305 static __inline__ long atomic64_fetch_##op##_relaxed(long i, atomic64_t * v) \
314 "1: lld %1, %2 # atomic64_fetch_" #op "\n" \
316 " scd %0, %2 \n" \
321 "+" GCC_OFF_SMALL_ASM() (v->counter) \
327 result = v->counter; \
328 v->counter c_op i; \
370 * @v: pointer of type atomic64_t
372 * Atomically test @v and subtract @i if @v is greater or equal than @i.
373 * The function returns the old value of @v minus @i.
375 static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v) in atomic64_sub_if_positive() argument
386 "1: lld %1, %2 # atomic64_sub_if_positive\n" in atomic64_sub_if_positive()
390 " scd %1, %2 \n" in atomic64_sub_if_positive()
395 "+" GCC_OFF_SMALL_ASM() (v->counter) in atomic64_sub_if_positive()
401 result = v->counter; in atomic64_sub_if_positive()
404 v->counter = result; in atomic64_sub_if_positive()
413 #define atomic64_cmpxchg(v, o, n) \ argument
414 ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
415 #define atomic64_xchg(v, new) (xchg(&((v)->counter), (new))) argument
419 * @v: pointer of type atomic64_t
421 #define atomic64_dec_if_positive(v) atomic64_sub_if_positive(1, v) argument