Lines Matching +full:3 +full:v
30 #define atomic_read(v) READ_ONCE((v)->counter) argument
31 #define atomic64_read(v) READ_ONCE((v)->counter) argument
33 #define atomic_set(v,i) WRITE_ONCE((v)->counter, (i)) argument
34 #define atomic64_set(v,i) WRITE_ONCE((v)->counter, (i)) argument
43 static __inline__ void atomic_##op(int i, atomic_t * v) \
54 :"=&r" (temp), "=m" (v->counter) \
55 :"Ir" (i), "m" (v->counter)); \
59 static inline int atomic_##op##_return_relaxed(int i, atomic_t *v) \
64 " " #asm_op " %0,%3,%2\n" \
65 " " #asm_op " %0,%3,%0\n" \
71 :"=&r" (temp), "=m" (v->counter), "=&r" (result) \
72 :"Ir" (i), "m" (v->counter) : "memory"); \
78 static inline int atomic_fetch_##op##_relaxed(int i, atomic_t *v) \
83 " " #asm_op " %2,%3,%0\n" \
89 :"=&r" (temp), "=m" (v->counter), "=&r" (result) \
90 :"Ir" (i), "m" (v->counter) : "memory"); \
96 static __inline__ void atomic64_##op(long i, atomic64_t * v) \
107 :"=&r" (temp), "=m" (v->counter) \
108 :"Ir" (i), "m" (v->counter)); \
112 static __inline__ long atomic64_##op##_return_relaxed(long i, atomic64_t * v) \
117 " " #asm_op " %0,%3,%2\n" \
118 " " #asm_op " %0,%3,%0\n" \
124 :"=&r" (temp), "=m" (v->counter), "=&r" (result) \
125 :"Ir" (i), "m" (v->counter) : "memory"); \
131 static __inline__ long atomic64_fetch_##op##_relaxed(long i, atomic64_t * v) \
136 " " #asm_op " %2,%3,%0\n" \
142 :"=&r" (temp), "=m" (v->counter), "=&r" (result) \
143 :"Ir" (i), "m" (v->counter) : "memory"); \
202 #define atomic64_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new)) in ATOMIC_OPS() argument
203 #define atomic64_xchg(v, new) (xchg(&((v)->counter), new)) in ATOMIC_OPS() argument
205 #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new)) in ATOMIC_OPS() argument
206 #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) in ATOMIC_OPS() argument
210 * @v: pointer of type atomic_t in ATOMIC_OPS()
211 * @a: the amount to add to v... in ATOMIC_OPS()
212 * @u: ...unless v is equal to u. in ATOMIC_OPS()
214 * Atomically adds @a to @v, so long as it was not @u. in ATOMIC_OPS()
215 * Returns the old value of @v. in ATOMIC_OPS()
217 static __inline__ int atomic_fetch_add_unless(atomic_t *v, int a, int u) in ATOMIC_OPS()
227 " beq %[new],3f\n" in ATOMIC_OPS()
230 "3: br 1b\n" in ATOMIC_OPS()
233 : [mem] "m"(*v), [a] "rI"(a), [u] "rI"((long)u) in ATOMIC_OPS()
242 * @v: pointer of type atomic64_t
243 * @a: the amount to add to v...
244 * @u: ...unless v is equal to u.
246 * Atomically adds @a to @v, so long as it was not @u.
247 * Returns the old value of @v.
249 static __inline__ long atomic64_fetch_add_unless(atomic64_t *v, long a, long u) in atomic64_fetch_add_unless() argument
259 " beq %[new],3f\n" in atomic64_fetch_add_unless()
262 "3: br 1b\n" in atomic64_fetch_add_unless()
265 : [mem] "m"(*v), [a] "rI"(a), [u] "rI"(u) in atomic64_fetch_add_unless()
274 * @v: pointer of type atomic_t
276 * The function returns the old value of *v minus 1, even if
277 * the atomic variable, v, was not decremented.
279 static inline long atomic64_dec_if_positive(atomic64_t *v) in atomic64_dec_if_positive() argument
288 " beq %[tmp],3f\n" in atomic64_dec_if_positive()
291 "3: br 1b\n" in atomic64_dec_if_positive()
294 : [mem] "m"(*v) in atomic64_dec_if_positive()