30 static inline void rte_mb(
void);
39 static inline void rte_wmb(
void);
48 static inline void rte_rmb(
void);
160 #define rte_compiler_barrier() do { \
161 asm volatile ("" : : : "memory"); \
185 #ifdef RTE_FORCE_INTRINSICS
189 return __sync_bool_compare_and_swap(dst, exp, src);
208 static inline uint16_t
211 #ifdef RTE_FORCE_INTRINSICS
212 static inline uint16_t
215 #if defined(__clang__)
216 return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
218 return __atomic_exchange_2(dst, val, __ATOMIC_SEQ_CST);
233 #define RTE_ATOMIC16_INIT(val) { (val) }
255 static inline int16_t
286 __sync_fetch_and_add(&v->
cnt, inc);
300 __sync_fetch_and_sub(&v->
cnt, dec);
312 #ifdef RTE_FORCE_INTRINSICS
329 #ifdef RTE_FORCE_INTRINSICS
350 static inline int16_t
353 return __sync_add_and_fetch(&v->
cnt, inc);
370 static inline int16_t
373 return __sync_sub_and_fetch(&v->
cnt, dec);
389 #ifdef RTE_FORCE_INTRINSICS
392 return __sync_add_and_fetch(&v->
cnt, 1) == 0;
409 #ifdef RTE_FORCE_INTRINSICS
412 return __sync_sub_and_fetch(&v->
cnt, 1) == 0;
429 #ifdef RTE_FORCE_INTRINSICS
468 #ifdef RTE_FORCE_INTRINSICS
472 return __sync_bool_compare_and_swap(dst, exp, src);
491 static inline uint32_t
494 #ifdef RTE_FORCE_INTRINSICS
495 static inline uint32_t
498 #if defined(__clang__)
499 return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
501 return __atomic_exchange_4(dst, val, __ATOMIC_SEQ_CST);
516 #define RTE_ATOMIC32_INIT(val) { (val) }
538 static inline int32_t
569 __sync_fetch_and_add(&v->
cnt, inc);
583 __sync_fetch_and_sub(&v->
cnt, dec);
595 #ifdef RTE_FORCE_INTRINSICS
612 #ifdef RTE_FORCE_INTRINSICS
633 static inline int32_t
636 return __sync_add_and_fetch(&v->
cnt, inc);
653 static inline int32_t
656 return __sync_sub_and_fetch(&v->
cnt, dec);
672 #ifdef RTE_FORCE_INTRINSICS
675 return __sync_add_and_fetch(&v->
cnt, 1) == 0;
692 #ifdef RTE_FORCE_INTRINSICS
695 return __sync_sub_and_fetch(&v->
cnt, 1) == 0;
712 #ifdef RTE_FORCE_INTRINSICS
750 #ifdef RTE_FORCE_INTRINSICS
754 return __sync_bool_compare_and_swap(dst, exp, src);
773 static inline uint64_t
776 #ifdef RTE_FORCE_INTRINSICS
777 static inline uint64_t
780 #if defined(__clang__)
781 return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
783 return __atomic_exchange_8(dst, val, __ATOMIC_SEQ_CST);
798 #define RTE_ATOMIC64_INIT(val) { (val) }
809 #ifdef RTE_FORCE_INTRINSICS
819 while (success == 0) {
836 static inline int64_t
839 #ifdef RTE_FORCE_INTRINSICS
840 static inline int64_t
849 while (success == 0) {
871 #ifdef RTE_FORCE_INTRINSICS
881 while (success == 0) {
901 #ifdef RTE_FORCE_INTRINSICS
905 __sync_fetch_and_add(&v->
cnt, inc);
920 #ifdef RTE_FORCE_INTRINSICS
924 __sync_fetch_and_sub(&v->
cnt, dec);
937 #ifdef RTE_FORCE_INTRINSICS
954 #ifdef RTE_FORCE_INTRINSICS
975 static inline int64_t
978 #ifdef RTE_FORCE_INTRINSICS
979 static inline int64_t
982 return __sync_add_and_fetch(&v->
cnt, inc);
999 static inline int64_t
1002 #ifdef RTE_FORCE_INTRINSICS
1003 static inline int64_t
1006 return __sync_sub_and_fetch(&v->
cnt, dec);
1023 #ifdef RTE_FORCE_INTRINSICS
1043 #ifdef RTE_FORCE_INTRINSICS
1063 #ifdef RTE_FORCE_INTRINSICS
1078 #ifdef RTE_FORCE_INTRINSICS