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/bus/vmbus/rte_vmbus_reg.h | 2 +-
drivers/bus/vmbus/vmbus_channel.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
@@ -28,7 +28,7 @@ struct vmbus_message {
*/
struct vmbus_mon_trig {
- uint32_t pending;
+ RTE_ATOMIC(uint32_t) pending;
uint32_t armed;
} __rte_packed;
@@ -19,16 +19,16 @@
#include "private.h"
static inline void
-vmbus_sync_set_bit(volatile uint32_t *addr, uint32_t mask)
+vmbus_sync_set_bit(volatile RTE_ATOMIC(uint32_t) *addr, uint32_t mask)
{
- /* Use GCC builtin which atomic does atomic OR operation */
- __atomic_fetch_or(addr, mask, __ATOMIC_SEQ_CST);
+ rte_atomic_fetch_or_explicit(addr, mask, rte_memory_order_seq_cst);
}
static inline void
vmbus_set_monitor(const struct vmbus_channel *channel, uint32_t monitor_id)
{
- uint32_t *monitor_addr, monitor_mask;
+ RTE_ATOMIC(uint32_t) *monitor_addr;
+ uint32_t monitor_mask;
unsigned int trigger_index;
trigger_index = monitor_id / HV_MON_TRIG_LEN;