Add a 'maxcpus' global.

This commit is contained in:
ad 2008-03-15 14:55:22 +00:00
parent a22d8d4abb
commit 3bd2b6fba5
2 changed files with 10 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.c,v 1.53 2007/12/26 16:01:35 ad Exp $ */
/* $NetBSD: param.c,v 1.54 2008/03/15 14:55:22 ad Exp $ */
/*
* Copyright (c) 1980, 1986, 1989 Regents of the University of California.
@ -37,13 +37,14 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: param.c,v 1.53 2007/12/26 16:01:35 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: param.c,v 1.54 2008/03/15 14:55:22 ad Exp $");
#include "opt_hz.h"
#include "opt_rtc_offset.h"
#include "opt_sysv.h"
#include "opt_sysvparam.h"
#include "opt_nmbclusters.h"
#include "opt_multiprocessor.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -110,6 +111,11 @@ int maxproc = NPROC;
int desiredvnodes = NVNODE;
u_int maxfiles = MAXFILES;
int fscale = FSCALE; /* kernel uses `FSCALE', user uses `fscale' */
#ifdef MULTIPROCESSOR
u_int maxcpus = MAXCPUS;
#else
u_int maxcpus = 1;
#endif
/*
* Various mbuf-related parameters. These can also be changed at run-time

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.15 2008/01/15 14:50:07 joerg Exp $ */
/* $NetBSD: cpu.h,v 1.16 2008/03/15 14:55:22 ad Exp $ */
/*-
* Copyright (c) 2007 YAMAMOTO Takashi,
@ -68,6 +68,7 @@ int cpu_setonline(struct cpu_info *, bool);
bool cpu_intr_p(void);
extern kmutex_t cpu_lock;
extern u_int maxcpus;
static inline u_int
cpu_index(struct cpu_info *ci)