5 #include <arch/smp/atomic.h>
8 typedef struct { int counter; } atomic_t;
9 #define ATOMIC_INIT(i) { (i) }
12 * atomic_read - read atomic variable
13 * @v: pointer of type atomic_t
15 * Atomically reads the value of @v. Note that the guaranteed
16 * useful range of an atomic_t is only 24 bits.
18 #define atomic_read(v) ((v)->counter)
21 * atomic_set - set atomic variable
22 * @v: pointer of type atomic_t
25 * Atomically sets the value of @v to @i. Note that the guaranteed
26 * useful range of an atomic_t is only 24 bits.
28 #define atomic_set(v,i) (((v)->counter) = (i))
32 * atomic_inc - increment atomic variable
33 * @v: pointer of type atomic_t
35 * Atomically increments @v by 1. Note that the guaranteed
36 * useful range of an atomic_t is only 24 bits.
38 #define atomic_inc(v) (((v)->counter)++)
42 * atomic_dec - decrement atomic variable
43 * @v: pointer of type atomic_t
45 * Atomically decrements @v by 1. Note that the guaranteed
46 * useful range of an atomic_t is only 24 bits.
48 #define atomic_dec(v) (((v)->counter)--)
51 #endif /* CONFIG_SMP */
53 #endif /* SMP_ATOMIC_H */