33 #ifndef __ARCH_arm_ORO_ATOMIC__ 34 #define __ARCH_arm_ORO_ATOMIC__ 36 #define oro_localirq_save_hw_notrace(x) \ 39 (void) (&temp == &x); \ 40 __asm__ __volatile__( \ 41 "mrs %0, cpsr @ oro_localirq_save_hw\n" \ 42 " orr %1, %0, #128\n" \ 44 : "=r" (x), "=r" (temp) \ 48 #define oro_localirq_save_hw(flags) oro_localirq_save_hw_notrace(flags) 50 #define oro_localirq_restore_hw_notrace(x) \ 51 __asm__ __volatile__( \ 52 "msr cpsr_c, %0 @ oro_localirq_restore_hw\n" \ 56 #define oro_localirq_restore_hw(flags) oro_localirq_restore_hw_notrace(flags) 60 #define ORO_ATOMIC_INIT(i) { (i) } 62 #define oro_atomic_read(v) ((v)->counter) 64 #define oro_atomic_set(v,i) (((v)->counter) = (i)) 114 #define oro_atomic_xchg(v, new) (xchg(&((v)->counter), new)) 125 #define oro_atomic_inc_not_zero(v) oro_atomic_add_unless((v), 1, 0) 127 #define oro_atomic_add(i, v) (void) oro_atomic_add_return(i, v) 128 #define oro_atomic_inc(v) (void) oro_atomic_add_return(1, v) 129 #define oro_atomic_sub(i, v) (void) oro_atomic_sub_return(i, v) 130 #define oro_atomic_dec(v) (void) oro_atomic_sub_return(1, v) 132 #define oro_atomic_inc_and_test(v) (oro_atomic_add_return(1, v) == 0) 133 #define oro_atomic_dec_and_test(v) (oro_atomic_sub_return(1, v) == 0) 134 #define oro_atomic_inc_return(v) (oro_atomic_add_return(1, v)) 135 #define oro_atomic_dec_return(v) (oro_atomic_sub_return(1, v)) 136 #define oro_atomic_sub_and_test(i, v) (oro_atomic_sub_return(i, v) == 0) 138 #define oro_atomic_add_negative(i,v) (oro_atomic_add_return(i, v) < 0) 141 #define smp_mb__before_oro_atomic_dec() barrier() 142 #define smp_mb__after_oro_atomic_dec() barrier() 143 #define smp_mb__before_oro_atomic_inc() barrier() 144 #define smp_mb__after_oro_atomic_inc() barrier() 146 #endif // __ARCH_arm_ORO_atomic__ #define oro_localirq_save_hw(flags)
#define oro_localirq_restore_hw(flags)
static void oro_atomic_clear_mask(unsigned long mask, unsigned long *addr)
static int oro_atomic_sub_return(int i, oro_atomic_t *v)
volatile long oro_atomic_t
static int oro_atomic_add_unless(oro_atomic_t *v, int a, int u)
static int oro_atomic_add_return(int i, oro_atomic_t *v)
static int oro_atomic_cmpxchg(oro_atomic_t *v, int old, int a)
#define oro_atomic_read(v)