Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Mar 2005 16:26:47 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 74188 for review
Message-ID:  <200503311626.j2VGQl6t041943@repoman.freebsd.org>

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

Change 74188 by jhb@jhb_slimer on 2005/03/31 16:26:25

	Put back some memory clobbers to narrow down why I now get panics.
	Still have a few more archs to go.

Affected files ...

.. //depot/projects/smpng/sys/alpha/include/atomic.h#19 edit
.. //depot/projects/smpng/sys/amd64/include/atomic.h#13 edit
.. //depot/projects/smpng/sys/arm/include/atomic.h#8 edit
.. //depot/projects/smpng/sys/i386/include/atomic.h#29 edit

Differences ...

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

@@ -61,7 +61,8 @@
 		"stl_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
 		: "=&r" (temp), "=m" (*p)
-		: "r" (v), "m" (*p));
+		: "r" (v), "m" (*p)
+		: "memory");
 #endif
 }
 
@@ -76,7 +77,8 @@
 		"stl_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
 		: "=&r" (temp), "=m" (*p)
-		: "r" (v), "m" (*p));
+		: "r" (v), "m" (*p)
+		: "memory");
 #endif
 }
 
@@ -91,7 +93,8 @@
 		"stl_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
 		: "=&r" (temp), "=m" (*p)
-		: "r" (v), "m" (*p));
+		: "r" (v), "m" (*p)
+		: "memory");
 #endif
 }
 
@@ -106,7 +109,8 @@
 		"stl_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
 		: "=&r" (temp), "=m" (*p)
-		: "r" (v), "m" (*p));
+		: "r" (v), "m" (*p)
+		: "memory");
 #endif
 }
 
@@ -122,7 +126,8 @@
 		"stl_c %1,%2\n\t"	/* attempt to store */
 		"beq %1,1b\n"		/* if the store failed, spin */
 		: "=&r"(result), "=&r"(temp), "=m" (*addr)
-		: "m" (*addr));
+		: "m" (*addr)
+		: "memory");
 #endif
 
 	return result;
@@ -139,7 +144,8 @@
 		"stq_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
 		: "=&r" (temp), "=m" (*p)
-		: "r" (v), "m" (*p));
+		: "r" (v), "m" (*p)
+		: "memory");
 #endif
 }
 
@@ -154,7 +160,8 @@
 		"stq_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
 		: "=&r" (temp), "=m" (*p)
-		: "r" (v), "m" (*p));
+		: "r" (v), "m" (*p)
+		: "memory");
 #endif
 }
 
@@ -169,7 +176,8 @@
 		"stq_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
 		: "=&r" (temp), "=m" (*p)
-		: "r" (v), "m" (*p));
+		: "r" (v), "m" (*p)
+		: "memory");
 #endif
 }
 
@@ -184,7 +192,8 @@
 		"stq_c %0, %1\n\t"		/* attempt to store */
 		"beq %0, 1b\n"			/* spin if failed */
 		: "=&r" (temp), "=m" (*p)
-		: "r" (v), "m" (*p));
+		: "r" (v), "m" (*p)
+		: "memory");
 #endif
 }
 
@@ -200,7 +209,8 @@
 		"stq_c %1,%2\n\t"	/* attempt to store */
 		"beq %1,1b\n"		/* if the store failed, spin */
 		: "=&r"(result), "=&r"(temp), "+m" (*addr)
-		: "m" (*addr));
+		: "m" (*addr)
+		: "memory");
 #endif
 
 	return result;
@@ -264,8 +274,6 @@
 	*p = v;						\
 }
 
-ATOMIC_STORE_LOAD(8)
-ATOMIC_STORE_LOAD(16)
 ATOMIC_STORE_LOAD(32)
 ATOMIC_STORE_LOAD(64)
 
@@ -291,7 +299,8 @@
 		"beq %0, 1b\n\t"		/* if it failed, spin */
 		"2:\n"
 		: "=&r" (ret), "=m" (*p)
-		: "r" ((long)(int)cmpval), "r" (newval), "m" (*p));
+		: "r" ((long)(int)cmpval), "r" (newval), "m" (*p)
+		: "memory");
 #endif
 
 	return ret;
@@ -317,7 +326,8 @@
 		"beq %0, 1b\n\t"		/* if it failed, spin */
 		"2:\n"
 		: "=&r" (ret), "=m" (*p)
-		: "r" (cmpval), "r" (newval), "m" (*p));
+		: "r" (cmpval), "r" (newval), "m" (*p)
+		: "memory");
 #endif
 
 	return ret;
@@ -372,8 +382,6 @@
 #define atomic_subtract_char	atomic_subtract_8
 #define atomic_subtract_acq_char	atomic_subtract_acq_8
 #define atomic_subtract_rel_char	atomic_subtract_rel_8
-#define	atomic_load_acq_char	atomic_load_acq_8
-#define	atomic_store_rel_char	atomic_store_rel_8
 
 /* Operations on shorts. */
 #define atomic_set_short	atomic_set_16
@@ -388,8 +396,6 @@
 #define atomic_subtract_short	atomic_subtract_16
 #define atomic_subtract_acq_short	atomic_subtract_acq_16
 #define atomic_subtract_rel_short	atomic_subtract_rel_16
-#define	atomic_load_acq_short	atomic_load_acq_16
-#define	atomic_store_rel_short	atomic_store_rel_16
 
 /* Operations on ints. */
 #define atomic_set_int		atomic_set_32

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

@@ -160,7 +160,8 @@
 	: "+a" (res), 			/* 0 (result) */
 	  "=m" (*dst)			/* 1 */
 	: "r" (src),			/* 2 */
-	  "m" (*dst));			/* 3 */
+	  "m" (*dst)			/* 3 */
+	: "memory");
 
 	return (res);
 }
@@ -180,7 +181,8 @@
 	: "+a" (res),			/* 0 (result) */
 	  "=m" (*dst)			/* 1 */
 	: "r" (src),			/* 2 */
-	  "m" (*dst));			/* 3 */
+	  "m" (*dst)			/* 3 */
+	: "memory");
 
 	return (res);
 }

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

@@ -75,7 +75,9 @@
 __swp(uint32_t val, volatile uint32_t *ptr)
 {
 	__asm __volatile("swp	%0, %2, [%3]"
-	    : "=&r" (val), "=m" (*ptr) : "r" (val) , "r" (ptr), "m" (*ptr));
+	    : "=&r" (val), "=m" (*ptr)
+	    : "r" (val) , "r" (ptr), "m" (*ptr)
+	    : "memory");
 	return (val);
 }
 

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

@@ -143,7 +143,8 @@
 	: "+a" (res),			/* 0 (result) */
 	  "=m" (*dst)			/* 1 */
 	: "r" (src),			/* 2 */
-	  "m" (*dst));			/* 3 */
+	  "m" (*dst)			/* 3 */
+	: "memory");
 
 	return (res);
 }
@@ -165,7 +166,8 @@
 	: "+a" (res),			/* 0 (result) */
 	  "=m" (*dst)			/* 1 */
 	: "r" (src),			/* 2 */
-	  "m" (*dst));			/* 3 */
+	  "m" (*dst)			/* 3 */
+	: "memory");
 
 	return (res);
 }
@@ -294,15 +296,7 @@
 ATOMIC_ACQ(add,		int);
 ATOMIC_ACQ(subtract,	int);
 
-static __inline int
-atomic_cmpset_acq_int(volatile u_int *dst, u_int exp, u_int src)
-{
-	int retval;
-
-	retval = atomic_cmpset_int(dst, exp, src);
-	__asm __volatile("" ::: "memory");
-	return (retval);
-}
+#define	atomic_cmpset_acq_int		atomic_cmpset_int
 
 /* Release variants are identical to the normal ones. */
 #define	atomic_set_rel_char		atomic_set_char



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