Replace the use of gcc builtin __atomic_xxx intrinsics with
corresponding rte_atomic_xxx optional stdatomic API
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/gpudev/gpudev.c | 6 +++---
lib/gpudev/gpudev_driver.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
@@ -228,7 +228,7 @@ struct rte_gpu *
dev->mpshared->info.numa_node = -1;
dev->mpshared->info.parent = RTE_GPU_ID_NONE;
TAILQ_INIT(&dev->callbacks);
- __atomic_fetch_add(&dev->mpshared->process_refcnt, 1, __ATOMIC_RELAXED);
+ rte_atomic_fetch_add_explicit(&dev->mpshared->process_refcnt, 1, rte_memory_order_relaxed);
gpu_count++;
GPU_LOG(DEBUG, "new device %s (id %d) of total %d",
@@ -277,7 +277,7 @@ struct rte_gpu *
TAILQ_INIT(&dev->callbacks);
dev->mpshared = shared_dev;
- __atomic_fetch_add(&dev->mpshared->process_refcnt, 1, __ATOMIC_RELAXED);
+ rte_atomic_fetch_add_explicit(&dev->mpshared->process_refcnt, 1, rte_memory_order_relaxed);
gpu_count++;
GPU_LOG(DEBUG, "attached device %s (id %d) of total %d",
@@ -340,7 +340,7 @@ struct rte_gpu *
gpu_free_callbacks(dev);
dev->process_state = RTE_GPU_STATE_UNUSED;
- __atomic_fetch_sub(&dev->mpshared->process_refcnt, 1, __ATOMIC_RELAXED);
+ rte_atomic_fetch_sub_explicit(&dev->mpshared->process_refcnt, 1, rte_memory_order_relaxed);
gpu_count--;
return 0;
@@ -69,7 +69,7 @@ struct rte_gpu_mpshared {
/* Device info structure. */
struct rte_gpu_info info;
/* Counter of processes using the device. */
- uint16_t process_refcnt; /* Updated by this library. */
+ RTE_ATOMIC(uint16_t) process_refcnt; /* Updated by this library. */
};
struct rte_gpu {