16 #ifndef UV_ATOMIC_OPS_H_
17 #define UV_ATOMIC_OPS_H_
21 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
25 UV_UNUSED(
static int cmpxchgi(
int* ptr,
int oldval,
int newval));
31 UV_UNUSED(
static int cmpxchgi(
int* ptr,
int oldval,
int newval)) {
32 #if defined(__i386__) || defined(__x86_64__)
34 __asm__ __volatile__ (
"lock; cmpxchg %2, %1;"
35 :
"=a" (
out),
"+m" (*(
volatile int*) ptr)
36 :
"r" (newval),
"0" (oldval)
39 #elif defined(__MVS__)
41 if (__plo_CSST(ptr, (
unsigned int*) &oldval, newval,
42 (
unsigned int*) ptr, *ptr, &op4))
46 #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
47 return atomic_cas_uint((uint_t *)ptr, (uint_t)oldval, (uint_t)newval);
49 return __sync_val_compare_and_swap(ptr, oldval, newval);
54 #if defined(__i386__) || defined(__x86_64__)
55 __asm__ __volatile__ (
"rep; nop");
56 #elif (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__)
57 __asm__
volatile(
"yield");
UV_UNUSED(static int cmpxchgi(int *ptr, int oldval, int newval))
const lzma_allocator const uint8_t size_t uint8_t * out