atomic.h (f24219b4e90cf70ec4a211b17fbabc725a0ddf3c) atomic.h (7847777a45f9f8bfc8617dbf107bde1ecb59caee)
1/*
2 * Atomic operations that C can't guarantee us. Useful for
3 * resource counting etc..
4 *
5 * But use these as seldom as possible since they are much more slower
6 * than regular operations.
7 *
8 * This file is subject to the terms and conditions of the GNU General Public

--- 751 unchanged lines hidden (view full) ---

760 * @i: integer value to add
761 *
762 * Atomically adds @i to @v and returns true
763 * if the result is negative, or false when
764 * result is greater than or equal to zero.
765 */
766#define atomic64_add_negative(i, v) (atomic64_add_return(i, (v)) < 0)
767
1/*
2 * Atomic operations that C can't guarantee us. Useful for
3 * resource counting etc..
4 *
5 * But use these as seldom as possible since they are much more slower
6 * than regular operations.
7 *
8 * This file is subject to the terms and conditions of the GNU General Public

--- 751 unchanged lines hidden (view full) ---

760 * @i: integer value to add
761 *
762 * Atomically adds @i to @v and returns true
763 * if the result is negative, or false when
764 * result is greater than or equal to zero.
765 */
766#define atomic64_add_negative(i, v) (atomic64_add_return(i, (v)) < 0)
767
768#else /* !CONFIG_64BIT */
769
770#include <asm-generic/atomic64.h>
771
772#endif /* CONFIG_64BIT */
773
774/*
775 * atomic*_return operations are serializing but not the non-*_return
776 * versions.
777 */
778#define smp_mb__before_atomic_dec() smp_mb__before_llsc()
779#define smp_mb__after_atomic_dec() smp_llsc_mb()
780#define smp_mb__before_atomic_inc() smp_mb__before_llsc()
781#define smp_mb__after_atomic_inc() smp_llsc_mb()
782
768#endif /* CONFIG_64BIT */
769
770/*
771 * atomic*_return operations are serializing but not the non-*_return
772 * versions.
773 */
774#define smp_mb__before_atomic_dec() smp_mb__before_llsc()
775#define smp_mb__after_atomic_dec() smp_llsc_mb()
776#define smp_mb__before_atomic_inc() smp_mb__before_llsc()
777#define smp_mb__after_atomic_inc() smp_llsc_mb()
778
783#include <asm-generic/atomic-long.h>
784
785#endif /* _ASM_ATOMIC_H */
779#endif /* _ASM_ATOMIC_H */