Lines Matching full:v
15 * @v: pointer of type atomic64_t
17 * Atomically reads the value of @v.
20 static inline s64 arch_atomic64_read(const atomic64_t *v) in arch_atomic64_read() argument
22 return __READ_ONCE((v)->counter); in arch_atomic64_read()
27 * @v: pointer to type atomic64_t
30 * Atomically sets the value of @v to @i.
32 static inline void arch_atomic64_set(atomic64_t *v, s64 i) in arch_atomic64_set() argument
34 __WRITE_ONCE(v->counter, i); in arch_atomic64_set()
40 * @v: pointer to type atomic64_t
42 * Atomically adds @i to @v.
44 static __always_inline void arch_atomic64_add(s64 i, atomic64_t *v) in arch_atomic64_add() argument
47 : "=m" (v->counter) in arch_atomic64_add()
48 : "er" (i), "m" (v->counter) : "memory"); in arch_atomic64_add()
54 * @v: pointer to type atomic64_t
56 * Atomically subtracts @i from @v.
58 static inline void arch_atomic64_sub(s64 i, atomic64_t *v) in arch_atomic64_sub() argument
61 : "=m" (v->counter) in arch_atomic64_sub()
62 : "er" (i), "m" (v->counter) : "memory"); in arch_atomic64_sub()
68 * @v: pointer to type atomic64_t
70 * Atomically subtracts @i from @v and returns
74 static inline bool arch_atomic64_sub_and_test(s64 i, atomic64_t *v) in arch_atomic64_sub_and_test() argument
76 return GEN_BINARY_RMWcc(LOCK_PREFIX "subq", v->counter, e, "er", i); in arch_atomic64_sub_and_test()
82 * @v: pointer to type atomic64_t
84 * Atomically increments @v by 1.
86 static __always_inline void arch_atomic64_inc(atomic64_t *v) in arch_atomic64_inc() argument
89 : "=m" (v->counter) in arch_atomic64_inc()
90 : "m" (v->counter) : "memory"); in arch_atomic64_inc()
96 * @v: pointer to type atomic64_t
98 * Atomically decrements @v by 1.
100 static __always_inline void arch_atomic64_dec(atomic64_t *v) in arch_atomic64_dec() argument
103 : "=m" (v->counter) in arch_atomic64_dec()
104 : "m" (v->counter) : "memory"); in arch_atomic64_dec()
110 * @v: pointer to type atomic64_t
112 * Atomically decrements @v by 1 and
116 static inline bool arch_atomic64_dec_and_test(atomic64_t *v) in arch_atomic64_dec_and_test() argument
118 return GEN_UNARY_RMWcc(LOCK_PREFIX "decq", v->counter, e); in arch_atomic64_dec_and_test()
124 * @v: pointer to type atomic64_t
126 * Atomically increments @v by 1
130 static inline bool arch_atomic64_inc_and_test(atomic64_t *v) in arch_atomic64_inc_and_test() argument
132 return GEN_UNARY_RMWcc(LOCK_PREFIX "incq", v->counter, e); in arch_atomic64_inc_and_test()
139 * @v: pointer to type atomic64_t
141 * Atomically adds @i to @v and returns true
145 static inline bool arch_atomic64_add_negative(s64 i, atomic64_t *v) in arch_atomic64_add_negative() argument
147 return GEN_BINARY_RMWcc(LOCK_PREFIX "addq", v->counter, s, "er", i); in arch_atomic64_add_negative()
154 * @v: pointer to type atomic64_t
156 * Atomically adds @i to @v and returns @i + @v
158 static __always_inline s64 arch_atomic64_add_return(s64 i, atomic64_t *v) in arch_atomic64_add_return() argument
160 return i + xadd(&v->counter, i); in arch_atomic64_add_return()
164 static inline s64 arch_atomic64_sub_return(s64 i, atomic64_t *v) in arch_atomic64_sub_return() argument
166 return arch_atomic64_add_return(-i, v); in arch_atomic64_sub_return()
170 static inline s64 arch_atomic64_fetch_add(s64 i, atomic64_t *v) in arch_atomic64_fetch_add() argument
172 return xadd(&v->counter, i); in arch_atomic64_fetch_add()
176 static inline s64 arch_atomic64_fetch_sub(s64 i, atomic64_t *v) in arch_atomic64_fetch_sub() argument
178 return xadd(&v->counter, -i); in arch_atomic64_fetch_sub()
182 static inline s64 arch_atomic64_cmpxchg(atomic64_t *v, s64 old, s64 new) in arch_atomic64_cmpxchg() argument
184 return arch_cmpxchg(&v->counter, old, new); in arch_atomic64_cmpxchg()
188 static __always_inline bool arch_atomic64_try_cmpxchg(atomic64_t *v, s64 *old, s64 new) in arch_atomic64_try_cmpxchg() argument
190 return try_cmpxchg(&v->counter, old, new); in arch_atomic64_try_cmpxchg()
194 static inline s64 arch_atomic64_xchg(atomic64_t *v, s64 new) in arch_atomic64_xchg() argument
196 return arch_xchg(&v->counter, new); in arch_atomic64_xchg()
200 static inline void arch_atomic64_and(s64 i, atomic64_t *v) in arch_atomic64_and() argument
203 : "+m" (v->counter) in arch_atomic64_and()
208 static inline s64 arch_atomic64_fetch_and(s64 i, atomic64_t *v) in arch_atomic64_fetch_and() argument
210 s64 val = arch_atomic64_read(v); in arch_atomic64_fetch_and()
213 } while (!arch_atomic64_try_cmpxchg(v, &val, val & i)); in arch_atomic64_fetch_and()
218 static inline void arch_atomic64_or(s64 i, atomic64_t *v) in arch_atomic64_or() argument
221 : "+m" (v->counter) in arch_atomic64_or()
226 static inline s64 arch_atomic64_fetch_or(s64 i, atomic64_t *v) in arch_atomic64_fetch_or() argument
228 s64 val = arch_atomic64_read(v); in arch_atomic64_fetch_or()
231 } while (!arch_atomic64_try_cmpxchg(v, &val, val | i)); in arch_atomic64_fetch_or()
236 static inline void arch_atomic64_xor(s64 i, atomic64_t *v) in arch_atomic64_xor() argument
239 : "+m" (v->counter) in arch_atomic64_xor()
244 static inline s64 arch_atomic64_fetch_xor(s64 i, atomic64_t *v) in arch_atomic64_fetch_xor() argument
246 s64 val = arch_atomic64_read(v); in arch_atomic64_fetch_xor()
249 } while (!arch_atomic64_try_cmpxchg(v, &val, val ^ i)); in arch_atomic64_fetch_xor()