Lines Matching 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
34 : "+m" (l->a.counter) in local_add()
38 static inline void local_sub(long i, local_t *l) in local_sub() argument
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
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 #define local_cmpxchg(l, o, n) \ argument
124 (cmpxchg_local(&((l)->a.counter), (o), (n)))
126 #define local_xchg(l, n) (xchg(&((l)->a.counter), (n))) argument
130 * @l: pointer of type local_t
131 * @a: the amount to add to l...
132 * @u: ...unless l is equal to u.
134 * Atomically adds @a to @l, so long as it was not @u.
135 * Returns non-zero if @l was not @u, and zero otherwise.
137 #define local_add_unless(l, a, u) \ argument
140 c = local_read((l)); \
144 old = local_cmpxchg((l), c, c + (a)); \
151 #define local_inc_not_zero(l) local_add_unless((l), 1, 0) argument
157 #define __local_inc(l) local_inc(l) argument
158 #define __local_dec(l) local_dec(l) argument
159 #define __local_add(i, l) local_add((i), (l)) argument
160 #define __local_sub(i, l) local_sub((i), (l)) argument