40 #ifndef __GCC_ORO_ARCH__ 41 #define __GCC_ORO_ARCH__ 43 #include "../../rtt-config.h" 53 #define ORO_ATOMIC_SETUP oro_atomic_set 54 #define ORO_ATOMIC_CLEANUP(a_int) 56 #define oro_atomic_read(a_int) ((a_int)->cnt) 58 #define oro_atomic_set(a_int,n) (((a_int)->cnt) = (n)) 65 (void)__sync_add_and_fetch(&a_int->
cnt, n);
73 return __sync_add_and_fetch(&a_int->
cnt, n);
81 (void)__sync_sub_and_fetch(&a_int->
cnt, n);
89 return __sync_sub_and_fetch(&a_int->
cnt, n);
97 return !(__sync_sub_and_fetch(&a_int->
cnt, n));
105 (void)__sync_fetch_and_add(&a_int->
cnt, 1);
113 return __sync_fetch_and_add(&a_int->
cnt, 1);
121 (void)__sync_fetch_and_sub(&a_int->
cnt, 1);
129 return __sync_fetch_and_sub(&a_int->
cnt, 1);
137 return !(__sync_sub_and_fetch(&a_int->
cnt, 1));
145 return !(__sync_add_and_fetch(&a_int->
cnt, 1));
151 #define oro_cmpxchg(ptr,o,n)\ 152 ((__typeof__(*(ptr)))__sync_val_compare_and_swap((ptr),(o),(n))) 155 #endif // __GCC_ORO_ARCH__ static __inline__ int oro_atomic_inc_return(oro_atomic_t *a_int)
static __inline__ void oro_atomic_dec(oro_atomic_t *a_int)
static __inline__ int oro_atomic_dec_and_test(oro_atomic_t *a_int)
static __inline__ int oro_atomic_sub_return(oro_atomic_t *a_int, int n)
static __inline__ int oro_atomic_inc_and_test(oro_atomic_t *a_int)
static __inline__ void oro_atomic_add(oro_atomic_t *a_int, int n)
static __inline__ void oro_atomic_inc(oro_atomic_t *a_int)
static __inline__ void oro_atomic_sub(oro_atomic_t *a_int, int n)
static __inline__ int oro_atomic_add_return(oro_atomic_t *a_int, int n)
static __inline__ int oro_atomic_dec_return(oro_atomic_t *a_int)
struct oro_atomic_t_interface oro_atomic_t
static __inline__ int oro_atomic_sub_and_test(oro_atomic_t *a_int, int n)