40 #include "../../rtt-config.h" 41 #ifndef __ORO_ARCH_x86_64__ 42 #define __ORO_ARCH_x86_64__ 44 #ifndef CONFIG_FORCE_UP 45 #define ORO_LOCK "lock ; " 52 #define ORO_ATOMIC_SETUP oro_atomic_set 53 #define ORO_ATOMIC_CLEANUP(v) 55 #define oro_atomic_read(v) ((v)->counter) 57 #define oro_atomic_set(v,i) (((v)->counter) = (i)) 97 :
"ir" (i),
"m" (v->
counter) :
"memory");
103 __asm__ __volatile__(
111 __asm__ __volatile__(
117 #define oro_atomic_inc_return(v) (oro_atomic_add_return(v, 1)) 118 #define oro_atomic_dec_return(v) (oro_atomic_sub_return(v, 1)) 124 __asm__ __volatile__(
135 __asm__ __volatile__(
146 __asm__ __volatile__(
149 :
"ir" (i),
"m" (v->
counter) :
"memory");
153 #ifndef CONFIG_FORCE_UP 154 #define ORO_LOCK_PREFIX "lock ; " 156 #define ORO_LOCK_PREFIX "" 160 #define oro__xg(x) ((struct oro__xchg_dummy *)(x)) 162 static inline unsigned long __oro_cmpxchg(
volatile void *ptr,
unsigned long old,
163 unsigned long _new,
int size)
170 :
"q"(_new),
"m"(*
oro__xg(ptr)),
"0"(old)
176 :
"q"(_new),
"m"(*
oro__xg(ptr)),
"0"(old)
182 :
"q"(_new),
"m"(*
oro__xg(ptr)),
"0"(old)
188 :
"q"(_new),
"m"(*
oro__xg(ptr)),
"0"(old)
196 #define oro_cmpxchg(ptr,o,n)\ 197 ((__typeof__(*(ptr)))__oro_cmpxchg((ptr),(unsigned long)(o),\ 198 (unsigned long)(n),sizeof(*(ptr)))) 200 #undef ORO_LOCK_PREFIX
static __inline__ int oro_atomic_add_negative(int i, oro_atomic_t *v)
static __inline__ void oro_atomic_inc(oro_atomic_t *v)
static __inline__ void oro_atomic_add(oro_atomic_t *v, int i)
static __inline__ int oro_atomic_sub_return(oro_atomic_t *v, int i)
static unsigned long __oro_cmpxchg(volatile void *ptr, unsigned long old, unsigned long _new, int size)
static __inline__ int oro_atomic_inc_and_test(oro_atomic_t *v)
static __inline__ int oro_atomic_add_return(oro_atomic_t *v, int i)
static __inline__ int oro_atomic_dec_and_test(oro_atomic_t *v)
static __inline__ int oro_atomic_sub_and_test(oro_atomic_t *v, int i)
struct oro_atomic_t_interface oro_atomic_t
static __inline__ void oro_atomic_dec(oro_atomic_t *v)
static __inline__ void oro_atomic_sub(oro_atomic_t *v, int i)