* Atomically set a bit in memory. */
| 124 | * Atomically set a bit in memory. |
| 125 | */ |
| 126 | static __rte_always_inline void |
| 127 | vhost_set_bit(unsigned int nr, volatile uint8_t *addr) |
| 128 | { |
| 129 | #if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION < 70100) |
| 130 | /* |
| 131 | * __sync_ built-ins are deprecated, but rte_atomic_ ones |
| 132 | * are sub-optimized in older GCC versions. |
| 133 | */ |
| 134 | __sync_fetch_and_or_1(addr, (1U << nr)); |
| 135 | #else |
| 136 | rte_atomic_fetch_or_explicit((volatile uint8_t __rte_atomic *)addr, (1U << nr), |
| 137 | rte_memory_order_relaxed); |
| 138 | #endif |
| 139 | } |
| 140 | |
| 141 | static __rte_always_inline void |
| 142 | vhost_log_page(uint8_t *log_base, uint64_t page) |