Lines Matching full:target
29 * This routine performs an atomic compare-and-set on @a target. If the current
30 * value of @a target equals @a old_value, @a target is set to @a new_value.
31 * If the current value of @a target does not equal @a old_value, @a target
34 * @param target Address of atomic variable.
39 static inline int atomic_cas(atomic_t *target, atomic_val_t old_value, in atomic_cas() argument
42 return __atomic_compare_exchange_n(target, &old_value, new_value, in atomic_cas()
51 * This routine performs an atomic addition on @a target.
53 * @param target Address of atomic variable.
56 * @return Previous value of @a target.
58 static inline atomic_val_t atomic_add(atomic_t *target, atomic_val_t value) in atomic_add() argument
60 return __atomic_fetch_add(target, value, __ATOMIC_SEQ_CST); in atomic_add()
67 * This routine performs an atomic subtraction on @a target.
69 * @param target Address of atomic variable.
72 * @return Previous value of @a target.
75 static inline atomic_val_t atomic_sub(atomic_t *target, atomic_val_t value) in atomic_sub() argument
77 return __atomic_fetch_sub(target, value, __ATOMIC_SEQ_CST); in atomic_sub()
84 * This routine performs an atomic increment by 1 on @a target.
86 * @param target Address of atomic variable.
88 * @return Previous value of @a target.
91 static inline atomic_val_t atomic_inc(atomic_t *target) in atomic_inc() argument
93 return atomic_add(target, 1); in atomic_inc()
100 * This routine performs an atomic decrement by 1 on @a target.
102 * @param target Address of atomic variable.
104 * @return Previous value of @a target.
107 static inline atomic_val_t atomic_dec(atomic_t *target) in atomic_dec() argument
109 return atomic_sub(target, 1); in atomic_dec()
116 * This routine performs an atomic read on @a target.
118 * @param target Address of atomic variable.
120 * @return Value of @a target.
123 static inline atomic_val_t atomic_get(const atomic_t *target) in atomic_get() argument
125 return __atomic_load_n(target, __ATOMIC_SEQ_CST); in atomic_get()
132 * This routine atomically sets @a target to @a value and returns
133 * the previous value of @a target.
135 * @param target Address of atomic variable.
136 * @param value Value to write to @a target.
138 * @return Previous value of @a target.
141 static inline atomic_val_t atomic_set(atomic_t *target, atomic_val_t value) in atomic_set() argument
147 return __atomic_exchange_n(target, value, __ATOMIC_SEQ_CST); in atomic_set()
154 * This routine atomically sets @a target to zero and returns its previous
155 * value. (Hence, it is equivalent to atomic_set(target, 0).)
157 * @param target Address of atomic variable.
159 * @return Previous value of @a target.
162 static inline atomic_val_t atomic_clear(atomic_t *target) in atomic_clear() argument
164 return atomic_set(target, 0); in atomic_clear()
171 * This routine atomically sets @a target to the bitwise inclusive OR of
172 * @a target and @a value.
174 * @param target Address of atomic variable.
177 * @return Previous value of @a target.
180 static inline atomic_val_t atomic_or(atomic_t *target, atomic_val_t value) in atomic_or() argument
182 return __atomic_fetch_or(target, value, __ATOMIC_SEQ_CST); in atomic_or()
189 * This routine atomically sets @a target to the bitwise exclusive OR (XOR) of
190 * @a target and @a value.
192 * @param target Address of atomic variable.
195 * @return Previous value of @a target.
198 static inline atomic_val_t atomic_xor(atomic_t *target, atomic_val_t value) in atomic_xor() argument
200 return __atomic_fetch_xor(target, value, __ATOMIC_SEQ_CST); in atomic_xor()
207 * This routine atomically sets @a target to the bitwise AND of @a target
210 * @param target Address of atomic variable.
213 * @return Previous value of @a target.
216 static inline atomic_val_t atomic_and(atomic_t *target, atomic_val_t value) in atomic_and() argument
218 return __atomic_fetch_and(target, value, __ATOMIC_SEQ_CST); in atomic_and()
225 * This routine atomically sets @a target to the bitwise NAND of @a target
226 * and @a value. (This operation is equivalent to target = ~(target & value).)
228 * @param target Address of atomic variable.
231 * @return Previous value of @a target.
234 static inline atomic_val_t atomic_nand(atomic_t *target, atomic_val_t value) in atomic_nand() argument
236 return __atomic_fetch_nand(target, value, __ATOMIC_SEQ_CST); in atomic_nand()
280 * This routine tests whether bit number @a bit of @a target is set or not.
281 * The target may be a single atomic variable or an array of them.
283 * @param target Address of atomic variable or array.
289 atomic_test_bit(const atomic_t *target, int bit) in atomic_test_bit() argument
291 atomic_val_t val = atomic_get(ATOMIC_ELEM(target, bit)); in atomic_test_bit()
299 * Atomically clear bit number @a bit of @a target and return its old value.
300 * The target may be a single atomic variable or an array of them.
302 * @param target Address of atomic variable or array.
308 atomic_test_and_clear_bit(atomic_t *target, int bit) in atomic_test_and_clear_bit() argument
313 old = atomic_and(ATOMIC_ELEM(target, bit), ~mask); in atomic_test_and_clear_bit()
321 * Atomically set bit number @a bit of @a target and return its old value.
322 * The target may be a single atomic variable or an array of them.
324 * @param target Address of atomic variable or array.
330 atomic_test_and_set_bit(atomic_t *target, int bit) in atomic_test_and_set_bit() argument
335 old = atomic_or(ATOMIC_ELEM(target, bit), mask); in atomic_test_and_set_bit()
343 * Atomically clear bit number @a bit of @a target.
344 * The target may be a single atomic variable or an array of them.
346 * @param target Address of atomic variable or array.
352 atomic_clear_bit(atomic_t *target, int bit) in atomic_clear_bit() argument
356 atomic_and(ATOMIC_ELEM(target, bit), ~mask); in atomic_clear_bit()
362 * Atomically set bit number @a bit of @a target.
363 * The target may be a single atomic variable or an array of them.
365 * @param target Address of atomic variable or array.
371 atomic_set_bit(atomic_t *target, int bit) in atomic_set_bit() argument
375 atomic_or(ATOMIC_ELEM(target, bit), mask); in atomic_set_bit()