summaryrefslogtreecommitdiffstats
path: root/sys/ia64/include/atomic.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-10-25 00:16:38 +0000
committerjhb <jhb@FreeBSD.org>2000-10-25 00:16:38 +0000
commite9ae756e2f97102e16b9bc0bfe77314a239fa0a0 (patch)
tree5d3f29bb17260f105d9c3204a27e1b3c634466eb /sys/ia64/include/atomic.h
parent192f0e978a2d8defa1507190d5211aaaf32e0d71 (diff)
downloadFreeBSD-src-e9ae756e2f97102e16b9bc0bfe77314a239fa0a0.zip
FreeBSD-src-e9ae756e2f97102e16b9bc0bfe77314a239fa0a0.tar.gz
Implement atomic_{set,clear,add,subtract}_{acq_,rel_,}_ptr()
Diffstat (limited to 'sys/ia64/include/atomic.h')
-rw-r--r--sys/ia64/include/atomic.h38
1 files changed, 26 insertions, 12 deletions
diff --git a/sys/ia64/include/atomic.h b/sys/ia64/include/atomic.h
index c01f7d0..4fbe8f5 100644
--- a/sys/ia64/include/atomic.h
+++ b/sys/ia64/include/atomic.h
@@ -266,18 +266,6 @@ IA64_ATOMIC(8, u_int64_t, subtract, 64, -)
#define atomic_add_rel_long atomic_add_rel_64
#define atomic_subtract_rel_long atomic_subtract_rel_64
-static __inline void
-atomic_set_ptr(volatile void *p, u_int64_t v)
-{
- atomic_set_64((volatile u_int64_t *) p, v);
-}
-
-static __inline void
-atomic_clear_ptr(volatile void *p, u_int64_t v)
-{
- atomic_clear_64((volatile u_int64_t *) p, v);
-}
-
/*
* Atomically compare the value stored at *p with cmpval and if the
* two values are equal, update the value of *p with newval. Returns
@@ -349,6 +337,32 @@ atomic_store_rel_ptr(volatile void *p, void *v)
atomic_store_rel_long((volatile u_long *)p, (u_long)v);
}
+#define ATOMIC_PTR(NAME) \
+static __inline void \
+atomic_##NAME##_ptr(volatile void *p, uintptr_t v) \
+{ \
+ atomic_##NAME##_long((volatile u_long *)p, v); \
+} \
+ \
+static __inline void \
+atomic_##NAME##_acq_ptr(volatile void *p, uintptr_t v) \
+{ \
+ atomic_##NAME##_acq_long((volatile u_long *)p, v);\
+} \
+ \
+static __inline void \
+atomic_##NAME##_rel_ptr(volatile void *p, uintptr_t v) \
+{ \
+ atomic_##NAME##_rel_long((volatile u_long *)p, v);\
+}
+
+ATOMIC_PTR(set)
+ATOMIC_PTR(clear)
+ATOMIC_PTR(add)
+ATOMIC_PTR(subtract)
+
+#undef ATOMIC_PTR
+
static __inline u_int32_t
atomic_readandclear_32(volatile u_int32_t* p)
{
OpenPOWER on IntegriCloud