2 #ifndef _LINUX_ATOMIC_H
3 #define _LINUX_ATOMIC_H
4 #include <asm/atomic.h>
15 static inline int atomic_add_unless(
atomic_t *
v,
int a,
int u)
27 #ifndef atomic_inc_not_zero
28 #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
43 #ifndef atomic_inc_not_zero_hint
44 static inline int atomic_inc_not_zero_hint(
atomic_t *
v,
int hint)
63 #ifndef atomic_inc_unless_negative
64 static inline int atomic_inc_unless_negative(
atomic_t *
p)
67 for (v = 0; v >= 0; v =
v1) {
76 #ifndef atomic_dec_unless_positive
77 static inline int atomic_dec_unless_positive(
atomic_t *p)
80 for (v = 0; v <= 0; v =
v1) {
96 #ifndef atomic_dec_if_positive
114 #ifndef CONFIG_ARCH_HAS_ATOMIC_OR
115 static inline void atomic_or(
int i,
atomic_t *v)
128 #ifdef CONFIG_GENERIC_ATOMIC64