Go to the documentation of this file.
12 #define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) }
13 #define local_read(l) atomic_long_read(&(l)->a)
14 #define local_set(l,i) atomic_long_set(&(l)->a, (i))
15 #define local_inc(l) atomic_long_inc(&(l)->a)
16 #define local_dec(l) atomic_long_dec(&(l)->a)
17 #define local_add(i,l) atomic_long_add((i),(&(l)->a))
18 #define local_sub(i,l) atomic_long_sub((i),(&(l)->a))
32 :
"=&r" (temp),
"=m" (l->
a.
counter),
"=&r" (result)
33 :
"Ir" (i),
"m" (l->
a.
counter) :
"memory");
49 :
"=&r" (temp),
"=m" (l->
a.
counter),
"=&r" (result)
50 :
"Ir" (i),
"m" (l->
a.
counter) :
"memory");
54 #define local_cmpxchg(l, o, n) \
55 (cmpxchg_local(&((l)->a.counter), (o), (n)))
56 #define local_xchg(l, n) (xchg_local(&((l)->a.counter), (n)))
67 #define local_add_unless(l, a, u) \
72 if (unlikely(c == (u))) \
74 old = local_cmpxchg((l), c, c + (a)); \
75 if (likely(old == c)) \
81 #define local_inc_not_zero(l) local_add_unless((l), 1, 0)
83 #define local_add_negative(a, l) (local_add_return((a), (l)) < 0)
85 #define local_dec_return(l) local_sub_return(1,(l))
87 #define local_inc_return(l) local_add_return(1,(l))
89 #define local_sub_and_test(i,l) (local_sub_return((i), (l)) == 0)
91 #define local_inc_and_test(l) (local_add_return(1, (l)) == 0)
93 #define local_dec_and_test(l) (local_sub_return(1, (l)) == 0)
96 #define __local_inc(l) ((l)->a.counter++)
97 #define __local_dec(l) ((l)->a.counter++)
98 #define __local_add(i,l) ((l)->a.counter+=(i))
99 #define __local_sub(i,l) ((l)->a.counter-=(i))