Add casts to some of the more commonly used pointer-type atomic
operations. We really should be able to make those inline functions, but this would break its use for sx_locks. Approved by: re (blanket)
This commit is contained in:
parent
de75afe64f
commit
c183b0f2c1
@ -138,8 +138,11 @@ ATOMIC_STORE_LOAD(long, 64, "8")
|
||||
|
||||
#undef ATOMIC_STORE_LOAD
|
||||
|
||||
#define atomic_load_acq_ptr atomic_load_acq_64
|
||||
#define atomic_store_rel_ptr atomic_store_rel_64
|
||||
#define atomic_load_acq_ptr(p) \
|
||||
((void *)atomic_load_acq_64((volatile uint64_t *)p))
|
||||
|
||||
#define atomic_store_rel_ptr(p, v) \
|
||||
atomic_store_rel_64((volatile uint64_t *)p, (uint64_t)v)
|
||||
|
||||
#define IA64_ATOMIC(sz, type, name, width, op) \
|
||||
static __inline type \
|
||||
@ -258,6 +261,7 @@ IA64_ATOMIC(8, uint64_t, subtract, 64, -)
|
||||
#define atomic_add_rel_long atomic_add_rel_64
|
||||
#define atomic_subtract_rel_long atomic_subtract_rel_64
|
||||
|
||||
/* XXX Needs casting. */
|
||||
#define atomic_set_ptr atomic_set_64
|
||||
#define atomic_clear_ptr atomic_clear_64
|
||||
#define atomic_add_ptr atomic_add_64
|
||||
@ -311,13 +315,18 @@ atomic_cmpset_rel_64(volatile uint64_t* p, uint64_t cmpval, uint64_t newval)
|
||||
#define atomic_cmpset_64 atomic_cmpset_acq_64
|
||||
#define atomic_cmpset_int atomic_cmpset_32
|
||||
#define atomic_cmpset_long atomic_cmpset_64
|
||||
#define atomic_cmpset_ptr atomic_cmpset_64
|
||||
#define atomic_cmpset_acq_int atomic_cmpset_acq_32
|
||||
#define atomic_cmpset_rel_int atomic_cmpset_rel_32
|
||||
#define atomic_cmpset_acq_long atomic_cmpset_acq_64
|
||||
#define atomic_cmpset_rel_long atomic_cmpset_rel_64
|
||||
#define atomic_cmpset_acq_ptr atomic_cmpset_acq_64
|
||||
#define atomic_cmpset_rel_ptr atomic_cmpset_rel_64
|
||||
|
||||
#define atomic_cmpset_acq_ptr(p, o, n) \
|
||||
(atomic_cmpset_acq_64((volatile uint64_t *)p, (uint64_t)o, (uint64_t)n))
|
||||
|
||||
#define atomic_cmpset_ptr atomic_cmpset_acq_ptr
|
||||
|
||||
#define atomic_cmpset_rel_ptr(p, o, n) \
|
||||
(atomic_cmpset_rel_64((volatile uint64_t *)p, (uint64_t)o, (uint64_t)n))
|
||||
|
||||
static __inline uint32_t
|
||||
atomic_readandclear_32(volatile uint32_t* p)
|
||||
|
Loading…
Reference in New Issue
Block a user