Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Mar 2005 18:12:33 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 73984 for review
Message-ID:  <200503281812.j2SICXpv061621@repoman.freebsd.org>

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

Change 73984 by jhb@jhb_slimer on 2005/03/28 18:11:33

	Fix everyone but arm to make atomic_*_ptr() operator on a pointer
	rather than a void.  This is more consistent with the rest of the
	interface.

Affected files ...

.. //depot/projects/smpng/sys/alpha/include/atomic.h#14 edit
.. //depot/projects/smpng/sys/amd64/include/atomic.h#10 edit
.. //depot/projects/smpng/sys/i386/include/atomic.h#26 edit
.. //depot/projects/smpng/sys/ia64/include/atomic.h#5 edit
.. //depot/projects/smpng/sys/powerpc/include/atomic.h#8 edit

Differences ...

==== //depot/projects/smpng/sys/alpha/include/atomic.h#14 (text+ko) ====

@@ -381,7 +381,7 @@
 #define	atomic_cmpset_long	atomic_cmpset_64
 
 static __inline int
-atomic_cmpset_ptr(volatile void *dst, void *exp, void *src)
+atomic_cmpset_ptr(volatile void **dst, void *exp, void *src)
 {
 
         return (atomic_cmpset_long((volatile u_long *)dst, (u_long)exp,
@@ -430,7 +430,7 @@
 #define	atomic_cmpset_rel_long	atomic_cmpset_rel_64
 
 static __inline int
-atomic_cmpset_acq_ptr(volatile void *dst, void *exp, void *src)
+atomic_cmpset_acq_ptr(volatile void **dst, void *exp, void *src)
 {
 
         return (atomic_cmpset_acq_long((volatile u_long *)dst, (u_long)exp,
@@ -438,7 +438,7 @@
 }
 
 static __inline int
-atomic_cmpset_rel_ptr(volatile void *dst, void *exp, void *src)
+atomic_cmpset_rel_ptr(volatile void **dst, void *exp, void *src)
 {
 
         return (atomic_cmpset_rel_long((volatile u_long *)dst, (u_long)exp,
@@ -446,32 +446,32 @@
 }
 
 static __inline void *
-atomic_load_acq_ptr(volatile void *p)
+atomic_load_acq_ptr(volatile void **p)
 {
 	return (void *)atomic_load_acq_long((volatile u_long *)p);
 }
 
 static __inline void
-atomic_store_rel_ptr(volatile void *p, void *v)
+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##_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_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_ptr(volatile void **p, uintptr_t v)	\
 {							\
 	atomic_##NAME##_rel_long((volatile u_long *)p, v);\
 }

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

@@ -322,7 +322,7 @@
 
 #if !defined(WANT_FUNCTIONS)
 static __inline int
-atomic_cmpset_ptr(volatile void *dst, void *exp, void *src)
+atomic_cmpset_ptr(volatile void **dst, void *exp, void *src)
 {
 
 	return (atomic_cmpset_long((volatile u_long *)dst,
@@ -330,7 +330,7 @@
 }
 
 static __inline int
-atomic_cmpset_acq_ptr(volatile void *dst, void *exp, void *src)
+atomic_cmpset_acq_ptr(volatile void **dst, void *exp, void *src)
 {
 
 	return (atomic_cmpset_acq_long((volatile u_long *)dst,
@@ -338,7 +338,7 @@
 }
 
 static __inline int
-atomic_cmpset_rel_ptr(volatile void *dst, void *exp, void *src)
+atomic_cmpset_rel_ptr(volatile void **dst, void *exp, void *src)
 {
 
 	return (atomic_cmpset_rel_long((volatile u_long *)dst,
@@ -346,7 +346,7 @@
 }
 
 static __inline void *
-atomic_load_acq_ptr(volatile void *p)
+atomic_load_acq_ptr(volatile void **p)
 {
 	/*
 	 * The apparently-bogus cast to intptr_t in the following is to
@@ -356,26 +356,26 @@
 }
 
 static __inline void
-atomic_store_rel_ptr(volatile void *p, void *v)
+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##_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_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_ptr(volatile void **p, uintptr_t v)	\
 {							\
 	atomic_##NAME##_rel_long((volatile u_long *)p, v);\
 }

==== //depot/projects/smpng/sys/i386/include/atomic.h#26 (text+ko) ====

@@ -383,7 +383,7 @@
 }
 
 static __inline int
-atomic_cmpset_ptr(volatile void *dst, void *exp, void *src)
+atomic_cmpset_ptr(volatile void **dst, void *exp, void *src)
 {
 
 	return (atomic_cmpset_int((volatile u_int *)dst, (u_int)exp,
@@ -391,7 +391,7 @@
 }
 
 static __inline int
-atomic_cmpset_acq_ptr(volatile void *dst, void *exp, void *src)
+atomic_cmpset_acq_ptr(volatile void **dst, void *exp, void *src)
 {
 
 	return (atomic_cmpset_acq_int((volatile u_int *)dst, (u_int)exp,
@@ -399,7 +399,7 @@
 }
 
 static __inline void *
-atomic_load_acq_ptr(volatile void *p)
+atomic_load_acq_ptr(volatile void **p)
 {
 	/*
 	 * The apparently-bogus cast to intptr_t in the following is to
@@ -409,26 +409,26 @@
 }
 
 static __inline void
-atomic_store_rel_ptr(volatile void *p, void *v)
+atomic_store_rel_ptr(volatile void **p, void *v)
 {
 	atomic_store_rel_int((volatile u_int *)p, (u_int)v);
 }
 
 #define ATOMIC_PTR(NAME)				\
 static __inline void					\
-atomic_##NAME##_ptr(volatile void *p, uintptr_t v)	\
+atomic_##NAME##_ptr(volatile void **p, uintptr_t v)	\
 {							\
 	atomic_##NAME##_int((volatile u_int *)p, v);	\
 }							\
 							\
 static __inline void					\
-atomic_##NAME##_acq_ptr(volatile void *p, uintptr_t v)	\
+atomic_##NAME##_acq_ptr(volatile void **p, uintptr_t v)	\
 {							\
 	atomic_##NAME##_acq_int((volatile u_int *)p, v);\
 }							\
 							\
 static __inline void					\
-atomic_##NAME##_rel_ptr(volatile void *p, uintptr_t v)	\
+atomic_##NAME##_rel_ptr(volatile void **p, uintptr_t v)	\
 {							\
 	atomic_##NAME##_rel_int((volatile u_int *)p, v);\
 }

==== //depot/projects/smpng/sys/ia64/include/atomic.h#5 (text+ko) ====

@@ -301,7 +301,7 @@
 #define	atomic_cmpset_rel_long		atomic_cmpset_rel_64
 
 static __inline int
-atomic_cmpset_acq_ptr(volatile void *dst, void *exp, void *src)
+atomic_cmpset_acq_ptr(volatile void **dst, void *exp, void *src)
 {
 	int ret;
 	ret = atomic_cmpset_acq_long((volatile u_long *)dst, (u_long)exp,
@@ -310,7 +310,7 @@
 }
 
 static __inline int
-atomic_cmpset_rel_ptr(volatile void *dst, void *exp, void *src)
+atomic_cmpset_rel_ptr(volatile void **dst, void *exp, void *src)
 {
 	int ret;
 	ret = atomic_cmpset_rel_long((volatile u_long *)dst, (u_long)exp,
@@ -321,32 +321,32 @@
 #define	atomic_cmpset_ptr		atomic_cmpset_acq_ptr
 
 static __inline void *
-atomic_load_acq_ptr(volatile void *p)
+atomic_load_acq_ptr(volatile void **p)
 {
 	return ((void *)atomic_load_acq_long((volatile u_long *)p));
 }
 
 static __inline void
-atomic_store_rel_ptr(volatile void *p, void *v)
+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##_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_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_ptr(volatile void **p, uintptr_t v)		\
 	{								\
 		atomic_##NAME##_rel_long((volatile u_long *)p, v);	\
 	}

==== //depot/projects/smpng/sys/powerpc/include/atomic.h#8 (text+ko) ====

@@ -406,7 +406,7 @@
 #endif /* 0 */
 
 static __inline int
-atomic_cmpset_ptr(volatile void *dst, void *exp, void *src)
+atomic_cmpset_ptr(volatile void **dst, void *exp, void *src)
 {
 
 	return (atomic_cmpset_32((volatile uint32_t *)dst, (uint32_t)exp,
@@ -437,7 +437,7 @@
 #define	atomic_cmpset_rel_long	atomic_cmpset_rel_32
 
 static __inline int
-atomic_cmpset_acq_ptr(volatile void *dst, void *exp, void *src)
+atomic_cmpset_acq_ptr(volatile void **dst, void *exp, void *src)
 {
 
         return (atomic_cmpset_acq_32((volatile uint32_t *)dst,
@@ -445,7 +445,7 @@
 }
 
 static __inline int
-atomic_cmpset_rel_ptr(volatile void *dst, void *exp, void *src)
+atomic_cmpset_rel_ptr(volatile void **dst, void *exp, void *src)
 {
 
         return (atomic_cmpset_rel_32((volatile uint32_t *)dst,
@@ -453,14 +453,14 @@
 }
 
 static __inline void *
-atomic_load_acq_ptr(volatile void *p)
+atomic_load_acq_ptr(volatile void **p)
 {
 
 	return (void *)atomic_load_acq_32((volatile uint32_t *)p);
 }
 
 static __inline void
-atomic_store_rel_ptr(volatile void *p, void *v)
+atomic_store_rel_ptr(volatile void **p, void *v)
 {
 
 	atomic_store_rel_32((volatile uint32_t *)p, (uint32_t)v);
@@ -468,19 +468,19 @@
 
 #define	ATOMIC_PTR(NAME)					\
 static __inline void						\
-atomic_##NAME##_ptr(volatile void *p, uintptr_t v)		\
+atomic_##NAME##_ptr(volatile void **p, uintptr_t v)		\
 {								\
 	atomic_##NAME##_32((volatile uint32_t *)p, v);	\
 }								\
 								\
 static __inline void						\
-atomic_##NAME##_acq_ptr(volatile void *p, uintptr_t v)		\
+atomic_##NAME##_acq_ptr(volatile void **p, uintptr_t v)		\
 {								\
 	atomic_##NAME##_acq_32((volatile uint32_t *)p, v);	\
 }								\
 								\
 static __inline void						\
-atomic_##NAME##_rel_ptr(volatile void *p, uintptr_t v)		\
+atomic_##NAME##_rel_ptr(volatile void **p, uintptr_t v)		\
 {								\
 	atomic_##NAME##_rel_32((volatile uint32_t *)p, v);	\
 }



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