PERFORCE change 131647 for review

John Birrell jb at FreeBSD.org
Tue Dec 25 21:55:24 PST 2007


http://perforce.freebsd.org/chv.cgi?CH=131647

Change 131647 by jb at jb_freebsd1 on 2007/12/26 05:54:49

	Define SMP_MAXCPU for use in kernel modules which have to dimension
	things based on the maximum number of CPUs that _could_ be in the
	kernel. The MAXCPU definition is only useful for things compiled
	into the kernel itself. At module build time, the state of the SMP
	configuration isn't known and modules are supposed to be able to
	load into UP and SMP kernels (which is why the atomic functions 
	aren't inlined in modules).

Affected files ...

.. //depot/projects/dtrace/src/sys/amd64/include/param.h#4 edit
.. //depot/projects/dtrace/src/sys/arm/include/param.h#4 edit
.. //depot/projects/dtrace/src/sys/i386/include/param.h#4 edit
.. //depot/projects/dtrace/src/sys/ia64/include/param.h#4 edit
.. //depot/projects/dtrace/src/sys/powerpc/include/param.h#4 edit
.. //depot/projects/dtrace/src/sys/sparc64/include/param.h#5 edit
.. //depot/projects/dtrace/src/sys/sun4v/include/param.h#5 edit

Differences ...

==== //depot/projects/dtrace/src/sys/amd64/include/param.h#4 (text+ko) ====

@@ -79,8 +79,13 @@
 #define	MACHINE_ARCH	"amd64"
 #endif
 
+/*
+ * SMP_MAXCPU - maximum number of CPUs in the kernel. Use this in kernel
+ * modules to allow for both SMP and !SMP cases.
+ */
+#define SMP_MAXCPU	16
 #ifdef SMP
-#define MAXCPU		16
+#define MAXCPU		SMP_MAXCPU
 #else
 #define MAXCPU		1
 #endif

==== //depot/projects/dtrace/src/sys/arm/include/param.h#4 (text+ko) ====

@@ -72,8 +72,13 @@
 #endif
 #define	MID_MACHINE	MID_ARM6 
 
+/*
+ * SMP_MAXCPU - maximum number of CPUs in the kernel. Use this in kernel
+ * modules to allow for both SMP and !SMP cases.
+ */
+#define	SMP_MAXCPU	2
 #ifdef SMP
-#define	MAXCPU		2
+#define MAXCPU		SMP_MAXCPU
 #else
 #define	MAXCPU		1
 #endif /* SMP */

==== //depot/projects/dtrace/src/sys/i386/include/param.h#4 (text+ko) ====

@@ -65,8 +65,13 @@
 #endif
 #define MID_MACHINE	MID_I386
 
+/*
+ * SMP_MAXCPU - maximum number of CPUs in the kernel. Use this in kernel
+ * modules to allow for both SMP and !SMP cases.
+ */
+#define SMP_MAXCPU	16
 #ifdef SMP
-#define MAXCPU		16
+#define MAXCPU		SMP_MAXCPU
 #else
 #define MAXCPU		1
 #endif /* SMP */

==== //depot/projects/dtrace/src/sys/ia64/include/param.h#4 (text+ko) ====

@@ -78,8 +78,13 @@
 #define	MACHINE_ARCH	"ia64"
 #endif
 
+/*
+ * SMP_MAXCPU - maximum number of CPUs in the kernel. Use this in kernel
+ * modules to allow for both SMP and !SMP cases.
+ */
+#define	SMP_MAXCPU	4
 #ifdef SMP
-#define	MAXCPU		4
+#define MAXCPU		SMP_MAXCPU
 #else
 #define MAXCPU		1
 #endif

==== //depot/projects/dtrace/src/sys/powerpc/include/param.h#4 (text+ko) ====

@@ -67,8 +67,13 @@
 #endif
 #define	MID_MACHINE	MID_POWERPC
 
+/*
+ * SMP_MAXCPU - maximum number of CPUs in the kernel. Use this in kernel
+ * modules to allow for both SMP and !SMP cases.
+ */
+#define	SMP_MAXCPU	2
 #ifdef SMP
-#define	MAXCPU		2
+#define MAXCPU		SMP_MAXCPU
 #else
 #define	MAXCPU		1
 #endif /* SMP */

==== //depot/projects/dtrace/src/sys/sparc64/include/param.h#5 (text+ko) ====

@@ -59,8 +59,13 @@
 #endif
 #define MID_MACHINE	MID_SPARC64
 
+/*
+ * SMP_MAXCPU - maximum number of CPUs in the kernel. Use this in kernel
+ * modules to allow for both SMP and !SMP cases.
+ */
+#define SMP_MAXCPU	16
 #ifdef SMP
-#define MAXCPU		16
+#define MAXCPU		SMP_MAXCPU
 #else
 #define MAXCPU		1
 #endif /* SMP */

==== //depot/projects/dtrace/src/sys/sun4v/include/param.h#5 (text+ko) ====

@@ -59,8 +59,13 @@
 #endif
 #define MID_MACHINE	MID_SPARC64
 
+/*
+ * SMP_MAXCPU - maximum number of CPUs in the kernel. Use this in kernel
+ * modules to allow for both SMP and !SMP cases.
+ */
+#define SMP_MAXCPU	32
 #ifdef SMP
-#define MAXCPU		32
+#define MAXCPU		SMP_MAXCPU
 #else
 #define MAXCPU		1
 #endif /* SMP */


More information about the p4-projects mailing list