16 #include <rte_compat.h> 30 static inline void rte_mb(
void);
38 static inline void rte_wmb(
void);
46 static inline void rte_rmb(
void);
149 #define rte_compiler_barrier() do { \ 150 asm volatile ("" : : : "memory"); \ 179 #ifdef RTE_FORCE_INTRINSICS 183 return __sync_bool_compare_and_swap(dst, exp, src);
202 static inline uint16_t
205 #ifdef RTE_FORCE_INTRINSICS 206 static inline uint16_t
209 return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
223 #define RTE_ATOMIC16_INIT(val) { (val) } 245 static inline int16_t
276 __atomic_fetch_add(&v->
cnt, inc, __ATOMIC_SEQ_CST);
290 __atomic_fetch_sub(&v->
cnt, dec, __ATOMIC_SEQ_CST);
302 #ifdef RTE_FORCE_INTRINSICS 319 #ifdef RTE_FORCE_INTRINSICS 340 static inline int16_t
343 return __atomic_fetch_add(&v->
cnt, inc, __ATOMIC_SEQ_CST) + inc;
360 static inline int16_t
363 return __atomic_fetch_sub(&v->
cnt, dec, __ATOMIC_SEQ_CST) - dec;
379 #ifdef RTE_FORCE_INTRINSICS 382 return __atomic_fetch_add(&v->
cnt, 1, __ATOMIC_SEQ_CST) + 1 == 0;
399 #ifdef RTE_FORCE_INTRINSICS 402 return __atomic_fetch_sub(&v->
cnt, 1, __ATOMIC_SEQ_CST) - 1 == 0;
419 #ifdef RTE_FORCE_INTRINSICS 458 #ifdef RTE_FORCE_INTRINSICS 462 return __sync_bool_compare_and_swap(dst, exp, src);
481 static inline uint32_t
484 #ifdef RTE_FORCE_INTRINSICS 485 static inline uint32_t
488 return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
502 #define RTE_ATOMIC32_INIT(val) { (val) } 524 static inline int32_t
555 __atomic_fetch_add(&v->
cnt, inc, __ATOMIC_SEQ_CST);
569 __atomic_fetch_sub(&v->
cnt, dec, __ATOMIC_SEQ_CST);
581 #ifdef RTE_FORCE_INTRINSICS 598 #ifdef RTE_FORCE_INTRINSICS 619 static inline int32_t
622 return __atomic_fetch_add(&v->
cnt, inc, __ATOMIC_SEQ_CST) + inc;
639 static inline int32_t
642 return __atomic_fetch_sub(&v->
cnt, dec, __ATOMIC_SEQ_CST) - dec;
658 #ifdef RTE_FORCE_INTRINSICS 661 return __atomic_fetch_add(&v->
cnt, 1, __ATOMIC_SEQ_CST) + 1 == 0;
678 #ifdef RTE_FORCE_INTRINSICS 681 return __atomic_fetch_sub(&v->
cnt, 1, __ATOMIC_SEQ_CST) - 1 == 0;
698 #ifdef RTE_FORCE_INTRINSICS 736 #ifdef RTE_FORCE_INTRINSICS 740 return __sync_bool_compare_and_swap(dst, exp, src);
759 static inline uint64_t
762 #ifdef RTE_FORCE_INTRINSICS 763 static inline uint64_t
766 return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
780 #define RTE_ATOMIC64_INIT(val) { (val) } 791 #ifdef RTE_FORCE_INTRINSICS 801 while (success == 0) {
818 static inline int64_t
821 #ifdef RTE_FORCE_INTRINSICS 822 static inline int64_t
831 while (success == 0) {
853 #ifdef RTE_FORCE_INTRINSICS 863 while (success == 0) {
883 #ifdef RTE_FORCE_INTRINSICS 887 __atomic_fetch_add(&v->
cnt, inc, __ATOMIC_SEQ_CST);
902 #ifdef RTE_FORCE_INTRINSICS 906 __atomic_fetch_sub(&v->
cnt, dec, __ATOMIC_SEQ_CST);
919 #ifdef RTE_FORCE_INTRINSICS 936 #ifdef RTE_FORCE_INTRINSICS 957 static inline int64_t
960 #ifdef RTE_FORCE_INTRINSICS 961 static inline int64_t
964 return __atomic_fetch_add(&v->
cnt, inc, __ATOMIC_SEQ_CST) + inc;
981 static inline int64_t
984 #ifdef RTE_FORCE_INTRINSICS 985 static inline int64_t
988 return __atomic_fetch_sub(&v->
cnt, dec, __ATOMIC_SEQ_CST) - dec;
1005 #ifdef RTE_FORCE_INTRINSICS 1025 #ifdef RTE_FORCE_INTRINSICS 1045 #ifdef RTE_FORCE_INTRINSICS 1060 #ifdef RTE_FORCE_INTRINSICS 1078 __extension__ __int128 int128;
1128 const rte_int128_t *src,
static void rte_atomic32_inc(rte_atomic32_t *v)
static int64_t rte_atomic64_sub_return(rte_atomic64_t *v, int64_t dec)
static void rte_smp_rmb(void)
static int rte_atomic32_cmpset(volatile uint32_t *dst, uint32_t exp, uint32_t src)
static int16_t rte_atomic16_read(const rte_atomic16_t *v)
static void rte_wmb(void)
static void rte_atomic32_add(rte_atomic32_t *v, int32_t inc)
static int rte_atomic16_dec_and_test(rte_atomic16_t *v)
static int64_t rte_atomic64_read(rte_atomic64_t *v)
static int16_t rte_atomic16_sub_return(rte_atomic16_t *v, int16_t dec)
static void rte_atomic32_sub(rte_atomic32_t *v, int32_t dec)
static void rte_atomic32_dec(rte_atomic32_t *v)
static int rte_atomic32_inc_and_test(rte_atomic32_t *v)
static void rte_io_mb(void)
static void rte_atomic64_inc(rte_atomic64_t *v)
static void rte_atomic32_set(rte_atomic32_t *v, int32_t new_value)
static int32_t rte_atomic32_add_return(rte_atomic32_t *v, int32_t inc)
static void rte_atomic16_add(rte_atomic16_t *v, int16_t inc)
static void rte_atomic32_init(rte_atomic32_t *v)
static void rte_atomic16_clear(rte_atomic16_t *v)
static int rte_atomic16_test_and_set(rte_atomic16_t *v)
static int rte_atomic64_cmpset(volatile uint64_t *dst, uint64_t exp, uint64_t src)
static void rte_atomic16_sub(rte_atomic16_t *v, int16_t dec)
static void rte_atomic16_set(rte_atomic16_t *v, int16_t new_value)
static void rte_io_wmb(void)
static void rte_atomic64_clear(rte_atomic64_t *v)
static int16_t rte_atomic16_add_return(rte_atomic16_t *v, int16_t inc)
static int rte_atomic64_dec_and_test(rte_atomic64_t *v)
static void rte_smp_wmb(void)
static int64_t rte_atomic64_add_return(rte_atomic64_t *v, int64_t inc)
static void rte_rmb(void)
static void rte_atomic32_clear(rte_atomic32_t *v)
static void rte_atomic16_inc(rte_atomic16_t *v)
static int rte_atomic16_inc_and_test(rte_atomic16_t *v)
static void rte_atomic_thread_fence(int memorder)
static int rte_atomic16_cmpset(volatile uint16_t *dst, uint16_t exp, uint16_t src)
static int rte_atomic64_inc_and_test(rte_atomic64_t *v)
static int32_t rte_atomic32_sub_return(rte_atomic32_t *v, int32_t dec)
static void rte_atomic64_sub(rte_atomic64_t *v, int64_t dec)
static uint16_t rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val)
static int rte_atomic32_test_and_set(rte_atomic32_t *v)
static void rte_smp_mb(void)
static uint32_t rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val)
static void rte_atomic16_dec(rte_atomic16_t *v)
static void rte_atomic64_init(rte_atomic64_t *v)
static void rte_atomic64_dec(rte_atomic64_t *v)
static void rte_atomic16_init(rte_atomic16_t *v)
static int rte_atomic64_test_and_set(rte_atomic64_t *v)
static uint64_t rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val)
static int32_t rte_atomic32_read(const rte_atomic32_t *v)
static __rte_experimental int rte_atomic128_cmp_exchange(rte_int128_t *dst, rte_int128_t *exp, const rte_int128_t *src, unsigned int weak, int success, int failure)
static void rte_atomic64_set(rte_atomic64_t *v, int64_t new_value)
static int rte_atomic32_dec_and_test(rte_atomic32_t *v)
static void rte_atomic64_add(rte_atomic64_t *v, int64_t inc)
static void rte_io_rmb(void)