svn commit: r214318 - stable/8/sys/i386/include

Julian Elischer julian at FreeBSD.org
Mon Oct 25 06:33:20 UTC 2010


Author: julian
Date: Mon Oct 25 06:33:19 2010
New Revision: 214318
URL: http://svn.freebsd.org/changeset/base/214318

Log:
  MFC of 196811
  Slight cleanup to pcpu macros to better match amd64 and to improve readability
  of the output.

Modified:
  stable/8/sys/i386/include/pcpu.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/i386/include/pcpu.h
==============================================================================
--- stable/8/sys/i386/include/pcpu.h	Mon Oct 25 06:28:19 2010	(r214317)
+++ stable/8/sys/i386/include/pcpu.h	Mon Oct 25 06:33:19 2010	(r214318)
@@ -137,7 +137,7 @@ extern struct pcpu *pcpup;
 #define	__PCPU_GET(name) __extension__ ({				\
 	__pcpu_type(name) __res;					\
 	struct __s {							\
-		u_char	__b[MIN(sizeof(__pcpu_type(name)), 4)];		\
+		u_char	__b[MIN(sizeof(__res), 4)];		\
 	} __s;								\
 									\
 	if (sizeof(__res) == 1 || sizeof(__res) == 2 ||			\
@@ -159,7 +159,7 @@ extern struct pcpu *pcpup;
 #define	__PCPU_ADD(name, val) do {					\
 	__pcpu_type(name) __val;					\
 	struct __s {							\
-		u_char	__b[MIN(sizeof(__pcpu_type(name)), 4)];		\
+		u_char	__b[MIN(sizeof(__val), 4)];		\
 	} __s;								\
 									\
 	__val = (val);							\
@@ -199,10 +199,10 @@ extern struct pcpu *pcpup;
 /*
  * Sets the value of the per-cpu variable name to value val.
  */
-#define	__PCPU_SET(name, val) {						\
+#define	__PCPU_SET(name, val) do {					\
 	__pcpu_type(name) __val;					\
 	struct __s {							\
-		u_char	__b[MIN(sizeof(__pcpu_type(name)), 4)];		\
+		u_char	__b[MIN(sizeof(__val), 4)];			\
 	} __s;								\
 									\
 	__val = (val);							\
@@ -215,7 +215,7 @@ extern struct pcpu *pcpup;
 	} else {							\
 		*__PCPU_PTR(name) = __val;				\
 	}								\
-}
+} while (0)
 
 #define	PCPU_GET(member)	__PCPU_GET(pc_ ## member)
 #define	PCPU_ADD(member, val)	__PCPU_ADD(pc_ ## member, val)


More information about the svn-src-stable-8 mailing list