Lines Matching +full:sc +full:- +full:resource

3  * resource counting etc..
22 #include <asm/cpu-features.h>
29 return READ_ONCE(v->counter); \
34 WRITE_ONCE(v->counter, i); \
44 #define ATOMIC_OP(pfx, op, type, c_op, asm_op, ll, sc) \ argument
53 v->counter c_op i; \
64 " " #sc " %0, %1 \n" \
67 : "=&r" (temp), "+" GCC_OFF_SMALL_ASM() (v->counter) \
71 #define ATOMIC_OP_RETURN(pfx, op, type, c_op, asm_op, ll, sc) \ argument
81 result = v->counter; \
83 v->counter = result; \
94 " " #sc " %0, %2 \n" \
99 "+" GCC_OFF_SMALL_ASM() (v->counter) \
105 #define ATOMIC_FETCH_OP(pfx, op, type, c_op, asm_op, ll, sc) \ argument
115 result = v->counter; \
116 v->counter c_op i; \
127 " " #sc " %0, %2 \n" \
132 "+" GCC_OFF_SMALL_ASM() (v->counter) \
139 #define ATOMIC_OPS(pfx, op, type, c_op, asm_op, ll, sc) \ argument
140 ATOMIC_OP(pfx, op, type, c_op, asm_op, ll, sc) \
141 ATOMIC_OP_RETURN(pfx, op, type, c_op, asm_op, ll, sc) \
142 ATOMIC_FETCH_OP(pfx, op, type, c_op, asm_op, ll, sc)
144 ATOMIC_OPS(atomic, add, int, +=, addu, ll, sc)
145 ATOMIC_OPS(atomic, sub, int, -=, subu, ll, sc)
154 ATOMIC_OPS(atomic64, sub, s64, -=, dsubu, lld, scd)
162 #define ATOMIC_OPS(pfx, op, type, c_op, asm_op, ll, sc) \ argument
163 ATOMIC_OP(pfx, op, type, c_op, asm_op, ll, sc) \
164 ATOMIC_FETCH_OP(pfx, op, type, c_op, asm_op, ll, sc)
166 ATOMIC_OPS(atomic, and, int, &=, and, ll, sc)
167 ATOMIC_OPS(atomic, or, int, |=, or, ll, sc)
168 ATOMIC_OPS(atomic, xor, int, ^=, xor, ll, sc)
189 * atomic_sub_if_positive - conditionally subtract integer from atomic variable
196 #define ATOMIC_SIP_OP(pfx, type, op, ll, sc) \ argument
207 result = v->counter; \
208 result -= i; \
210 v->counter = result; \
227 " " #sc " %1, %2 \n" \
232 "+" GCC_OFF_SMALL_ASM() (v->counter) \
239 * bltz that can branch to code outside of the LL/SC loop. As \
248 ATOMIC_SIP_OP(atomic, int, subu, ll, sc)