diff options
author | marcel <marcel@FreeBSD.org> | 2007-07-30 22:07:01 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2007-07-30 22:07:01 +0000 |
commit | 68c4f43232aab80af3844b1263a69455eb94f40b (patch) | |
tree | ed883d97f7a5b0ecb08ca6f644c80350dfe96636 /sys/ia64/include | |
parent | 35be05311259522727bb84611255f4c49d569cda (diff) | |
download | FreeBSD-src-68c4f43232aab80af3844b1263a69455eb94f40b.zip FreeBSD-src-68c4f43232aab80af3844b1263a69455eb94f40b.tar.gz |
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)
Diffstat (limited to 'sys/ia64/include')
-rw-r--r-- | sys/ia64/include/atomic.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/ia64/include/atomic.h b/sys/ia64/include/atomic.h index f660180..3ff0521 100644 --- a/sys/ia64/include/atomic.h +++ b/sys/ia64/include/atomic.h @@ -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) |