ifndef atomic_cas_* in cddl code in preparation for native implementations

This is a temporary change to not require all architectures to import at once.

Discussed with:	jhb
This commit is contained in:
Mateusz Guzik 2016-12-06 14:08:49 +00:00
parent c417fba9eb
commit ef32958e5d

View File

@ -41,11 +41,15 @@ extern void atomic_add_64(volatile uint64_t *target, int64_t delta);
extern void atomic_dec_64(volatile uint64_t *target);
#endif
#ifndef __sparc64__
#ifndef atomic_cas_32
extern uint32_t atomic_cas_32(volatile uint32_t *target, uint32_t cmp,
uint32_t newval);
#endif
#ifndef atomic_cas_64
extern uint64_t atomic_cas_64(volatile uint64_t *target, uint64_t cmp,
uint64_t newval);
#endif
#endif
extern uint64_t atomic_add_64_nv(volatile uint64_t *target, int64_t delta);
extern uint8_t atomic_or_8_nv(volatile uint8_t *target, uint8_t value);
extern void membar_producer(void);
@ -123,6 +127,7 @@ atomic_dec_64_nv(volatile uint64_t *target)
return (atomic_add_64_nv(target, -1));
}
#ifndef atomic_cas_ptr
#if !defined(COMPAT_32BIT) && defined(__LP64__)
static __inline void *
atomic_cas_ptr(volatile void *target, void *cmp, void *newval)
@ -138,5 +143,6 @@ atomic_cas_ptr(volatile void *target, void *cmp, void *newval)
(uint32_t)cmp, (uint32_t)newval));
}
#endif /* !defined(COMPAT_32BIT) && defined(__LP64__) */
#endif
#endif /* !_OPENSOLARIS_SYS_ATOMIC_H_ */