Lines Matching +full:1 +full:l
19 #define local_read(l) atomic_long_read(&(l)->a) argument
20 #define local_set(l, i) atomic_long_set(&(l)->a, (i)) argument
22 #define local_add(i, l) atomic_long_add((i), (&(l)->a)) argument
23 #define local_sub(i, l) atomic_long_sub((i), (&(l)->a)) argument
24 #define local_inc(l) atomic_long_inc(&(l)->a) argument
25 #define local_dec(l) atomic_long_dec(&(l)->a) argument
30 static __inline__ long local_add_return(long i, local_t * l) in local_add_return() argument
41 "1:" __stringify(LONG_LL) " %1, %2 \n" in local_add_return()
42 __stringify(LONG_ADDU) " %0, %1, %3 \n" in local_add_return()
44 __stringify(SC_BEQZ) " %0, 1b \n" in local_add_return()
45 __stringify(LONG_ADDU) " %0, %1, %3 \n" in local_add_return()
47 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) in local_add_return()
48 : "Ir" (i), "m" (l->a.counter) in local_add_return()
54 result = l->a.counter; in local_add_return()
56 l->a.counter = result; in local_add_return()
63 static __inline__ long local_sub_return(long i, local_t * l) in local_sub_return() argument
74 "1:" __stringify(LONG_LL) " %1, %2 \n" in local_sub_return()
75 __stringify(LONG_SUBU) " %0, %1, %3 \n" in local_sub_return()
76 __stringify(LONG_SUBU) " %0, %1, %3 \n" in local_sub_return()
78 __stringify(SC_BEQZ) " %0, 1b \n" in local_sub_return()
79 __stringify(LONG_SUBU) " %0, %1, %3 \n" in local_sub_return()
81 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) in local_sub_return()
82 : "Ir" (i), "m" (l->a.counter) in local_sub_return()
88 result = l->a.counter; in local_sub_return()
90 l->a.counter = result; in local_sub_return()
97 static __inline__ long local_cmpxchg(local_t *l, long old, long new) in local_cmpxchg() argument
99 return cmpxchg_local(&l->a.counter, old, new); in local_cmpxchg()
102 static __inline__ bool local_try_cmpxchg(local_t *l, long *old, long new) in local_try_cmpxchg() argument
104 return try_cmpxchg_local(&l->a.counter, in local_try_cmpxchg()
105 (typeof(l->a.counter) *) old, new); in local_try_cmpxchg()
108 #define local_xchg(l, n) (atomic_long_xchg((&(l)->a), (n))) argument
112 * @l: pointer of type local_t
113 * @a: the amount to add to l...
114 * @u: ...unless l is equal to u.
116 * Atomically adds @a to @l, if @v was not already @u.
120 local_add_unless(local_t *l, long a, long u) in local_add_unless() argument
122 long c = local_read(l); in local_add_unless()
127 } while (!local_try_cmpxchg(l, &c, c + a)); in local_add_unless()
132 #define local_inc_not_zero(l) local_add_unless((l), 1, 0) argument
134 #define local_dec_return(l) local_sub_return(1, (l)) argument
135 #define local_inc_return(l) local_add_return(1, (l)) argument
140 * @l: pointer of type local_t
142 * Atomically subtracts @i from @l and returns
146 #define local_sub_and_test(i, l) (local_sub_return((i), (l)) == 0) argument
150 * @l: pointer of type local_t
152 * Atomically increments @l by 1
156 #define local_inc_and_test(l) (local_inc_return(l) == 0) argument
159 * local_dec_and_test - decrement by 1 and test
160 * @l: pointer of type local_t
162 * Atomically decrements @l by 1 and
166 #define local_dec_and_test(l) (local_sub_return(1, (l)) == 0) argument
170 * @l: pointer of type local_t
173 * Atomically adds @i to @l and returns true
177 #define local_add_negative(i, l) (local_add_return(i, (l)) < 0) argument
184 #define __local_inc(l) ((l)->a.counter++) argument
185 #define __local_dec(l) ((l)->a.counter++) argument
186 #define __local_add(i, l) ((l)->a.counter+=(i)) argument
187 #define __local_sub(i, l) ((l)->a.counter-=(i)) argument