Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Dec 2007 05:55:23 GMT
From:      John Birrell <jb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 131647 for review
Message-ID:  <200712260555.lBQ5tNqP064794@repoman.freebsd.org>

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

Change 131647 by jb@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 */



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