Replace the use of gcc builtin __atomic_xxx intrinsics with
corresponding rte_atomic_xxx optional rte stdatomic API.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/dma/skeleton/skeleton_dmadev.c | 5 +++--
drivers/dma/skeleton/skeleton_dmadev.h | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
@@ -142,7 +142,7 @@
else if (desc->op == SKELDMA_OP_FILL)
do_fill(desc);
- __atomic_fetch_add(&hw->completed_count, 1, __ATOMIC_RELEASE);
+ rte_atomic_fetch_add_explicit(&hw->completed_count, 1, rte_memory_order_release);
(void)rte_ring_enqueue(hw->desc_completed, (void *)desc);
}
@@ -335,7 +335,8 @@
RTE_SET_USED(vchan);
*status = RTE_DMA_VCHAN_IDLE;
- if (hw->submitted_count != __atomic_load_n(&hw->completed_count, __ATOMIC_ACQUIRE)
+ if (hw->submitted_count != rte_atomic_load_explicit(&hw->completed_count,
+ rte_memory_order_acquire)
|| hw->zero_req_count == 0)
*status = RTE_DMA_VCHAN_ACTIVE;
return 0;
@@ -81,7 +81,7 @@ struct skeldma_hw {
/* Cache delimiter for cpuwork thread's operation data */
alignas(RTE_CACHE_LINE_SIZE) char cache2;
volatile uint32_t zero_req_count;
- uint64_t completed_count;
+ RTE_ATOMIC(uint64_t) completed_count;
};
#endif /* SKELETON_DMADEV_H */