Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Feb 2003 13:52:04 -0800 (PST)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 25113 for review
Message-ID:  <200302132152.h1DLq4PS006786@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=25113

Change 25113 by jmallett@jmallett_dalek on 2003/02/13 13:51:32

	Pointer atomics.

Affected files ...

.. //depot/projects/mips/sys/mips/include/atomic.h#10 edit

Differences ...

==== //depot/projects/mips/sys/mips/include/atomic.h#10 (text+ko) ====

@@ -130,6 +130,8 @@
 	return res;
 }
 
+#undef ATOMIC_OP
+
 /*
  * Long atomic operations, hardware calls this double.
  */
@@ -189,4 +191,53 @@
 	return res;
 }
 
+#undef ATOMIC_DOP
+
+/*
+ * Pointer atomic operations, just wrappers for long.
+ */
+#define	ATOMIC_POP(op)							\
+static __inline void							\
+atomic_ ## op ## _ptr(void *p, uintptr_t val)				\
+{									\
+	atomic_ ## op ## _long(p, val);					\
+}									\
+static __inline void							\
+atomic_ ## op ## _acq_ptr(void *p, uintptr_t val)			\
+{									\
+	atomic_ ## op ## _acq_long(p, val);				\
+}									\
+static __inline void							\
+atomic_ ## op ## _rel_ptr(void *p, uintptr_t val)			\
+{									\
+	atomic_ ## op ## _rel_long(p, val);				\
+}
+
+ATOMIC_POP(add)
+ATOMIC_POP(clear)
+ATOMIC_POP(set)
+ATOMIC_POP(subtract)
+
+static __inline void *
+atomic_load_acq_ptr(void *p)
+{
+	return (void *)atomic_load_acq_long(p);
+}
+
+static __inline void
+atomic_store_rel_ptr(void *p, void *val)
+{
+	atomic_store_rel_long(p, (u_long)val);
+}
+
+#undef ATOMIC_POP
+
+/*
+ * Clean up after the membar stuff.
+ */
+#undef ATOMIC_ACQ_OP
+#undef ATOMIC_REL_OP
+#undef ATOMIC_ACQ_LOAD
+#undef ATOMIC_REL_STORE
+
 #endif /* !_MACHINE_ATOMIC_H_ */

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200302132152.h1DLq4PS006786>