diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-04-19 17:53:40 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-04-19 17:53:40 +0000 |
commit | 90fdb320e64210bdbea1cbe460e0fd5a61de71ad (patch) | |
tree | d58d3e0e09bd2abce80e0a9ed2d88472969ba063 /sys/kern | |
parent | c9eacd92073efd8ad00f150bc65934fcd0b10192 (diff) |
Count number of cpus found (potentially not attached) and store that
in sysctl hw.ncpufound; ok miod kettenis
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/init_main.c | 3 | ||||
-rw-r--r-- | sys/kern/kern_sysctl.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index b65ebbc9393..ba5887bdc6f 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.158 2009/03/05 19:52:24 kettenis Exp $ */ +/* $OpenBSD: init_main.c,v 1.159 2009/04/19 17:53:38 deraadt Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -125,6 +125,7 @@ struct vnode *rootvp, *swapdev_vp; int boothowto; struct timeval boottime; int ncpus = 1; +int ncpusfound = 1; /* number of cpus we find */ __volatile int start_init_exec; /* semaphore for start_init() */ #if !defined(NO_PROPOLICE) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index c9bbbf61653..322816d1090 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.168 2009/01/21 21:02:40 miod Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.169 2009/04/19 17:53:38 deraadt Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -564,6 +564,8 @@ hw_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, return (sysctl_rdstring(oldp, oldlenp, newp, cpu_model)); case HW_NCPU: return (sysctl_rdint(oldp, oldlenp, newp, ncpus)); + case HW_NCPUFOUND: + return (sysctl_rdint(oldp, oldlenp, newp, ncpusfound)); case HW_BYTEORDER: return (sysctl_rdint(oldp, oldlenp, newp, BYTE_ORDER)); case HW_PHYSMEM: |