Go to the documentation of this file.
3 #ifndef __ASM_CRIS_ATOMIC__
4 #define __ASM_CRIS_ATOMIC__
6 #include <linux/compiler.h>
7 #include <linux/types.h>
8 #include <asm/cmpxchg.h>
9 #include <arch/atomic.h>
16 #define ATOMIC_INIT(i) { (i) }
18 #define atomic_read(v) (*(volatile int *)&(v)->counter)
19 #define atomic_set(v,i) (((v)->counter) = (i))
49 #define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
139 #define atomic_xchg(v, new) (xchg(&((v)->counter), new))
141 static inline int __atomic_add_unless(
atomic_t *v,
int a,
int u)
155 #define smp_mb__before_atomic_dec() barrier()
156 #define smp_mb__after_atomic_dec() barrier()
157 #define smp_mb__before_atomic_inc() barrier()
158 #define smp_mb__after_atomic_inc() barrier()