Lines Matching full:target

117  * Atomically get a value and then test whether bit number @a bit of @a target is set or not.
118 * The target may be a single atomic variable or an array of them.
122 * @param target Address of atomic variable or array.
127 static inline bool atomic_test_bit(const atomic_t *target, int bit) in atomic_test_bit() argument
129 atomic_val_t val = atomic_get(ATOMIC_ELEM(target, bit)); in atomic_test_bit()
137 * Atomically clear bit number @a bit of @a target and return its old value.
138 * The target may be a single atomic variable or an array of them.
142 * @param target Address of atomic variable or array.
147 static inline bool atomic_test_and_clear_bit(atomic_t *target, int bit) in atomic_test_and_clear_bit() argument
152 old = atomic_and(ATOMIC_ELEM(target, bit), ~mask); in atomic_test_and_clear_bit()
160 * Atomically set bit number @a bit of @a target and return its old value.
161 * The target may be a single atomic variable or an array of them.
165 * @param target Address of atomic variable or array.
170 static inline bool atomic_test_and_set_bit(atomic_t *target, int bit) in atomic_test_and_set_bit() argument
175 old = atomic_or(ATOMIC_ELEM(target, bit), mask); in atomic_test_and_set_bit()
183 * Atomically clear bit number @a bit of @a target.
184 * The target may be a single atomic variable or an array of them.
188 * @param target Address of atomic variable or array.
191 static inline void atomic_clear_bit(atomic_t *target, int bit) in atomic_clear_bit() argument
195 (void)atomic_and(ATOMIC_ELEM(target, bit), ~mask); in atomic_clear_bit()
201 * Atomically set bit number @a bit of @a target.
202 * The target may be a single atomic variable or an array of them.
206 * @param target Address of atomic variable or array.
209 static inline void atomic_set_bit(atomic_t *target, int bit) in atomic_set_bit() argument
213 (void)atomic_or(ATOMIC_ELEM(target, bit), mask); in atomic_set_bit()
219 * Atomically set bit number @a bit of @a target to value @a val.
220 * The target may be a single atomic variable or an array of them.
224 * @param target Address of atomic variable or array.
228 static inline void atomic_set_bit_to(atomic_t *target, int bit, bool val) in atomic_set_bit_to() argument
233 (void)atomic_or(ATOMIC_ELEM(target, bit), mask); in atomic_set_bit_to()
235 (void)atomic_and(ATOMIC_ELEM(target, bit), ~mask); in atomic_set_bit_to()
242 * This routine performs an atomic compare-and-set on @a target. If the current
243 * value of @a target equals @a old_value, @a target is set to @a new_value.
244 * If the current value of @a target does not equal @a old_value, @a target
249 * @param target Address of atomic variable.
254 bool atomic_cas(atomic_t *target, atomic_val_t old_value, atomic_val_t new_value);
259 * This routine performs an atomic compare-and-set on @a target. If the current
260 * value of @a target equals @a old_value, @a target is set to @a new_value.
261 * If the current value of @a target does not equal @a old_value, @a target
266 * @param target Address of atomic variable.
271 bool atomic_ptr_cas(atomic_ptr_t *target, atomic_ptr_val_t old_value,
277 * This routine performs an atomic addition on @a target.
281 * @param target Address of atomic variable.
284 * @return Previous value of @a target.
286 atomic_val_t atomic_add(atomic_t *target, atomic_val_t value);
291 * This routine performs an atomic subtraction on @a target.
295 * @param target Address of atomic variable.
298 * @return Previous value of @a target.
300 atomic_val_t atomic_sub(atomic_t *target, atomic_val_t value);
305 * This routine performs an atomic increment by 1 on @a target.
309 * @param target Address of atomic variable.
311 * @return Previous value of @a target.
313 atomic_val_t atomic_inc(atomic_t *target);
318 * This routine performs an atomic decrement by 1 on @a target.
322 * @param target Address of atomic variable.
324 * @return Previous value of @a target.
326 atomic_val_t atomic_dec(atomic_t *target);
331 * This routine performs an atomic read on @a target.
335 * @param target Address of atomic variable.
337 * @return Value of @a target.
339 atomic_val_t atomic_get(const atomic_t *target);
344 * This routine performs an atomic read on @a target.
348 * @param target Address of pointer variable.
350 * @return Value of @a target.
352 atomic_ptr_val_t atomic_ptr_get(const atomic_ptr_t *target);
357 * This routine atomically sets @a target to @a value and returns
358 * the previous value of @a target.
362 * @param target Address of atomic variable.
363 * @param value Value to write to @a target.
365 * @return Previous value of @a target.
367 atomic_val_t atomic_set(atomic_t *target, atomic_val_t value);
372 * This routine atomically sets @a target to @a value and returns
373 * the previous value of @a target.
377 * @param target Address of atomic variable.
378 * @param value Value to write to @a target.
380 * @return Previous value of @a target.
382 atomic_ptr_val_t atomic_ptr_set(atomic_ptr_t *target, atomic_ptr_val_t value);
387 * This routine atomically sets @a target to zero and returns its previous
388 * value. (Hence, it is equivalent to atomic_set(target, 0).)
392 * @param target Address of atomic variable.
394 * @return Previous value of @a target.
396 atomic_val_t atomic_clear(atomic_t *target);
401 * This routine atomically sets @a target to zero and returns its previous
402 * value. (Hence, it is equivalent to atomic_set(target, 0).)
406 * @param target Address of atomic variable.
408 * @return Previous value of @a target.
410 atomic_ptr_val_t atomic_ptr_clear(atomic_ptr_t *target);
415 * This routine atomically sets @a target to the bitwise inclusive OR of
416 * @a target and @a value.
420 * @param target Address of atomic variable.
423 * @return Previous value of @a target.
425 atomic_val_t atomic_or(atomic_t *target, atomic_val_t value);
432 * This routine atomically sets @a target to the bitwise exclusive OR (XOR) of
433 * @a target and @a value.
435 * @param target Address of atomic variable.
438 * @return Previous value of @a target.
440 atomic_val_t atomic_xor(atomic_t *target, atomic_val_t value);
445 * This routine atomically sets @a target to the bitwise AND of @a target
450 * @param target Address of atomic variable.
453 * @return Previous value of @a target.
455 atomic_val_t atomic_and(atomic_t *target, atomic_val_t value);
460 * This routine atomically sets @a target to the bitwise NAND of @a target
461 * and @a value. (This operation is equivalent to target = ~(target & value).)
465 * @param target Address of atomic variable.
468 * @return Previous value of @a target.
470 atomic_val_t atomic_nand(atomic_t *target, atomic_val_t value);