20 #ifdef HAVE_MBARRIER_H
23 #define pg_compiler_barrier_impl() __compiler_barrier()
25 #ifndef pg_memory_barrier_impl
31 # define pg_memory_barrier_impl() __machine_rw_barrier()
33 #ifndef pg_read_barrier_impl
34 # define pg_read_barrier_impl() __machine_r_barrier()
36 #ifndef pg_write_barrier_impl
37 # define pg_write_barrier_impl() __machine_w_barrier()
47 #define PG_HAVE_ATOMIC_U32_SUPPORT
53 #define PG_HAVE_ATOMIC_U64_SUPPORT
70 #define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32
78 current = atomic_cas_32(&ptr->
value, *expected,
newval);
79 ret = current == *expected;
84 #define PG_HAVE_ATOMIC_EXCHANGE_U32
91 #define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U64
94 uint64 *expected, uint64
newval)
100 current = atomic_cas_64(&ptr->
value, *expected,
newval);
101 ret = current == *expected;
106 #define PG_HAVE_ATOMIC_EXCHANGE_U64
static bool pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 *expected, uint32 newval)
struct pg_atomic_uint32 pg_atomic_uint32
bool pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 *expected, uint64 newval)
#define AssertPointerAlignment(ptr, bndr)
struct pg_atomic_uint64 pg_atomic_uint64
struct pg_attribute_aligned(8) pg_atomic_uint64
static uint32 pg_atomic_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 newval)