summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco S Hyman <marc@cvs.openbsd.org>2004-06-08 18:09:32 +0000
committerMarco S Hyman <marc@cvs.openbsd.org>2004-06-08 18:09:32 +0000
commitdb2cc4bf42ecb8d09ee4141a77fd802c7a8c63b4 (patch)
tree0ecf12211976b8fe3931c1510e8cdae64ab6adaa
parentccb7ab6c3e18598f0f22a10e67c229e2dd8dd71b (diff)
pull ncpus support from smp tree into main branch.
remove alpha specific definition of ncpus. OK (and tested on alpha) deraadt@
-rw-r--r--sys/arch/alpha/alpha/machdep.c7
-rw-r--r--sys/arch/alpha/alpha/mainbus.c3
-rw-r--r--sys/kern/init_main.c3
-rw-r--r--sys/kern/kern_sysctl.c4
-rw-r--r--sys/sys/systm.h3
5 files changed, 9 insertions, 11 deletions
diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c
index cbe22050ad6..3501a26890a 100644
--- a/sys/arch/alpha/alpha/machdep.c
+++ b/sys/arch/alpha/alpha/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.86 2004/03/10 23:02:53 tom Exp $ */
+/* $OpenBSD: machdep.c,v 1.87 2004/06/08 18:09:31 marc Exp $ */
/* $NetBSD: machdep.c,v 1.210 2000/06/01 17:12:38 thorpej Exp $ */
/*-
@@ -191,9 +191,6 @@ struct user *proc0paddr;
/* Number of machine cycles per microsecond */
u_int64_t cycles_per_usec;
-/* number of cpus in the box. really! */
-int ncpus;
-
struct bootinfo_kernel bootinfo;
/* For built-in TCDS */
@@ -760,7 +757,7 @@ nobootinfo:
* Figure out the number of cpus in the box, from RPB fields.
* Really. We mean it.
*/
- for (i = 0; i < hwrpb->rpb_pcs_cnt; i++) {
+ for (ncpus = 0, i = 0; i < hwrpb->rpb_pcs_cnt; i++) {
struct pcs *pcsp;
pcsp = LOCATE_PCS(hwrpb, i);
diff --git a/sys/arch/alpha/alpha/mainbus.c b/sys/arch/alpha/alpha/mainbus.c
index ed2715f4487..dd9dc6011a4 100644
--- a/sys/arch/alpha/alpha/mainbus.c
+++ b/sys/arch/alpha/alpha/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.11 2002/03/14 01:26:26 millert Exp $ */
+/* $OpenBSD: mainbus.c,v 1.12 2004/06/08 18:09:31 marc Exp $ */
/* $NetBSD: mainbus.c,v 1.27 1998/06/24 01:10:35 ross Exp $ */
/*
@@ -76,7 +76,6 @@ mbattach(parent, self, aux)
struct mainbus_attach_args ma;
struct pcs *pcsp;
int i, cpuattachcnt;
- extern int ncpus;
mainbus_found = 1;
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index f7d1e76fccf..2ab539d8b8a 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_main.c,v 1.113 2004/04/01 00:27:51 tedu Exp $ */
+/* $OpenBSD: init_main.c,v 1.114 2004/06/08 18:09:31 marc Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
@@ -123,6 +123,7 @@ struct vnode *rootvp, *swapdev_vp;
int boothowto;
struct timeval boottime;
struct timeval runtime;
+int ncpus = 1;
#if !defined(NO_PROPOLICE)
long __guard[8];
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 68c513b1815..52d16c9d176 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.109 2004/05/27 08:19:59 tedu Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.110 2004/06/08 18:09:31 marc Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -536,7 +536,7 @@ hw_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
case HW_MODEL:
return (sysctl_rdstring(oldp, oldlenp, newp, cpu_model));
case HW_NCPU:
- return (sysctl_rdint(oldp, oldlenp, newp, 1)); /* XXX */
+ return (sysctl_rdint(oldp, oldlenp, newp, ncpus));
case HW_BYTEORDER:
return (sysctl_rdint(oldp, oldlenp, newp, BYTE_ORDER));
case HW_PHYSMEM:
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index 51002fd67f4..40f921050c3 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: systm.h,v 1.60 2004/01/05 00:16:56 espie Exp $ */
+/* $OpenBSD: systm.h,v 1.61 2004/06/08 18:09:31 marc Exp $ */
/* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */
/*-
@@ -79,6 +79,7 @@ extern const char osversion[];
extern const char osrelease[];
extern int cold; /* cold start flag initialized in locore */
+extern int ncpus; /* number of CPUs */
extern int nblkdev; /* number of entries in bdevsw */
extern int nchrdev; /* number of entries in cdevsw */