MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vhost_set_bit

Function vhost_set_bit

dpdk/lib/vhost/vhost.c:126–139  ·  view source on GitHub ↗

* Atomically set a bit in memory. */

Source from the content-addressed store, hash-verified

124 * Atomically set a bit in memory.
125 */
126static __rte_always_inline void
127vhost_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
141static __rte_always_inline void
142vhost_log_page(uint8_t *log_base, uint64_t page)

Callers 1

vhost_log_pageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected