Lines Matching +full:1 +full:l

16 #define local_read(l)	atomic_long_read(&(l)->a)  argument
17 #define local_set(l, i) atomic_long_set(&(l)->a, (i)) argument
19 static inline void local_inc(local_t *l) in local_inc() argument
22 : "+m" (l->a.counter)); in local_inc()
25 static inline void local_dec(local_t *l) in local_dec() argument
28 : "+m" (l->a.counter)); in local_dec()
31 static inline void local_add(long i, local_t *l) in local_add() argument
33 asm volatile(_ASM_ADD "%1,%0" in local_add()
34 : "+m" (l->a.counter) in local_add()
38 static inline void local_sub(long i, local_t *l) in local_sub() argument
40 asm volatile(_ASM_SUB "%1,%0" in local_sub()
41 : "+m" (l->a.counter) in local_sub()
48 * @l: pointer to type local_t
50 * Atomically subtracts @i from @l and returns
54 static inline bool local_sub_and_test(long i, local_t *l) in local_sub_and_test() argument
56 return GEN_BINARY_RMWcc(_ASM_SUB, l->a.counter, e, "er", i); in local_sub_and_test()
61 * @l: pointer to type local_t
63 * Atomically decrements @l by 1 and
67 static inline bool local_dec_and_test(local_t *l) in local_dec_and_test() argument
69 return GEN_UNARY_RMWcc(_ASM_DEC, l->a.counter, e); in local_dec_and_test()
74 * @l: pointer to type local_t
76 * Atomically increments @l by 1
80 static inline bool local_inc_and_test(local_t *l) in local_inc_and_test() argument
82 return GEN_UNARY_RMWcc(_ASM_INC, l->a.counter, e); in local_inc_and_test()
88 * @l: pointer to type local_t
90 * Atomically adds @i to @l and returns true
94 static inline bool local_add_negative(long i, local_t *l) in local_add_negative() argument
96 return GEN_BINARY_RMWcc(_ASM_ADD, l->a.counter, s, "er", i); in local_add_negative()
102 * @l: pointer to type local_t
104 * Atomically adds @i to @l and returns @i + @l
106 static inline long local_add_return(long i, local_t *l) in local_add_return() argument
109 asm volatile(_ASM_XADD "%0, %1;" in local_add_return()
110 : "+r" (i), "+m" (l->a.counter) in local_add_return()
115 static inline long local_sub_return(long i, local_t *l) in local_sub_return() argument
117 return local_add_return(-i, l); in local_sub_return()
120 #define local_inc_return(l) (local_add_return(1, l)) argument
121 #define local_dec_return(l) (local_sub_return(1, l)) argument
123 static inline long local_cmpxchg(local_t *l, long old, long new) in local_cmpxchg() argument
125 return cmpxchg_local(&l->a.counter, old, new); in local_cmpxchg()
128 static inline bool local_try_cmpxchg(local_t *l, long *old, long new) in local_try_cmpxchg() argument
130 return try_cmpxchg_local(&l->a.counter, in local_try_cmpxchg()
131 (typeof(l->a.counter) *) old, new); in local_try_cmpxchg()
140 local_xchg(local_t *l, long n) in local_xchg() argument
142 long c = local_read(l); in local_xchg()
144 do { } while (!local_try_cmpxchg(l, &c, n)); in local_xchg()
151 * @l: pointer of type local_t
152 * @a: the amount to add to l...
153 * @u: ...unless l is equal to u.
155 * Atomically adds @a to @l, if @v was not already @u.
159 local_add_unless(local_t *l, long a, long u) in local_add_unless() argument
161 long c = local_read(l); in local_add_unless()
166 } while (!local_try_cmpxchg(l, &c, c + a)); in local_add_unless()
171 #define local_inc_not_zero(l) local_add_unless((l), 1, 0) argument
177 #define __local_inc(l) local_inc(l) argument
178 #define __local_dec(l) local_dec(l) argument
179 #define __local_add(i, l) local_add((i), (l)) argument
180 #define __local_sub(i, l) local_sub((i), (l)) argument