29 static inline void rte_mb(
void);
37 static inline void rte_wmb(
void);
45 static inline void rte_rmb(
void);
157 #define rte_compiler_barrier() do { \
158 asm volatile ("" : : : "memory"); \
182 #ifdef RTE_FORCE_INTRINSICS
186 return __sync_bool_compare_and_swap(dst, exp, src);
205 static inline uint16_t
208 #ifdef RTE_FORCE_INTRINSICS
209 static inline uint16_t
212 #if defined(__clang__)
213 return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
215 return __atomic_exchange_2(dst, val, __ATOMIC_SEQ_CST);
230 #define RTE_ATOMIC16_INIT(val) { (val) }
252 static inline int16_t
283 __sync_fetch_and_add(&v->
cnt, inc);
297 __sync_fetch_and_sub(&v->
cnt, dec);
309 #ifdef RTE_FORCE_INTRINSICS
326 #ifdef RTE_FORCE_INTRINSICS
347 static inline int16_t
350 return __sync_add_and_fetch(&v->
cnt, inc);
367 static inline int16_t
370 return __sync_sub_and_fetch(&v->
cnt, dec);
386 #ifdef RTE_FORCE_INTRINSICS
389 return __sync_add_and_fetch(&v->
cnt, 1) == 0;
406 #ifdef RTE_FORCE_INTRINSICS
409 return __sync_sub_and_fetch(&v->
cnt, 1) == 0;
426 #ifdef RTE_FORCE_INTRINSICS
465 #ifdef RTE_FORCE_INTRINSICS
469 return __sync_bool_compare_and_swap(dst, exp, src);
488 static inline uint32_t
491 #ifdef RTE_FORCE_INTRINSICS
492 static inline uint32_t
495 #if defined(__clang__)
496 return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
498 return __atomic_exchange_4(dst, val, __ATOMIC_SEQ_CST);
513 #define RTE_ATOMIC32_INIT(val) { (val) }
535 static inline int32_t
566 __sync_fetch_and_add(&v->
cnt, inc);
580 __sync_fetch_and_sub(&v->
cnt, dec);
592 #ifdef RTE_FORCE_INTRINSICS
609 #ifdef RTE_FORCE_INTRINSICS
630 static inline int32_t
633 return __sync_add_and_fetch(&v->
cnt, inc);
650 static inline int32_t
653 return __sync_sub_and_fetch(&v->
cnt, dec);
669 #ifdef RTE_FORCE_INTRINSICS
672 return __sync_add_and_fetch(&v->
cnt, 1) == 0;
689 #ifdef RTE_FORCE_INTRINSICS
692 return __sync_sub_and_fetch(&v->
cnt, 1) == 0;
709 #ifdef RTE_FORCE_INTRINSICS
747 #ifdef RTE_FORCE_INTRINSICS
751 return __sync_bool_compare_and_swap(dst, exp, src);
770 static inline uint64_t
773 #ifdef RTE_FORCE_INTRINSICS
774 static inline uint64_t
777 #if defined(__clang__)
778 return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
780 return __atomic_exchange_8(dst, val, __ATOMIC_SEQ_CST);
795 #define RTE_ATOMIC64_INIT(val) { (val) }
806 #ifdef RTE_FORCE_INTRINSICS
816 while (success == 0) {
833 static inline int64_t
836 #ifdef RTE_FORCE_INTRINSICS
837 static inline int64_t
846 while (success == 0) {
868 #ifdef RTE_FORCE_INTRINSICS
878 while (success == 0) {
898 #ifdef RTE_FORCE_INTRINSICS
902 __sync_fetch_and_add(&v->
cnt, inc);
917 #ifdef RTE_FORCE_INTRINSICS
921 __sync_fetch_and_sub(&v->
cnt, dec);
934 #ifdef RTE_FORCE_INTRINSICS
951 #ifdef RTE_FORCE_INTRINSICS
972 static inline int64_t
975 #ifdef RTE_FORCE_INTRINSICS
976 static inline int64_t
979 return __sync_add_and_fetch(&v->
cnt, inc);
996 static inline int64_t
999 #ifdef RTE_FORCE_INTRINSICS
1000 static inline int64_t
1003 return __sync_sub_and_fetch(&v->
cnt, dec);
1020 #ifdef RTE_FORCE_INTRINSICS
1040 #ifdef RTE_FORCE_INTRINSICS
1060 #ifdef RTE_FORCE_INTRINSICS
1075 #ifdef RTE_FORCE_INTRINSICS
1124 static inline int __rte_experimental
1127 const rte_int128_t *src,