Skip to content
Snippets Groups Projects
Commit 71be883c authored by Glauber Costa's avatar Glauber Costa
Browse files

bsd: provide correct number of ncpus

As the comment states itself, mp_ncpus should be the number of CPUs
in the system, not the maximum number of CPUs. We can currently grab
that from the smp_processors variable.

I have audited the code for current users, though, and found two places
in which it is used as the maximum number of cpus. Those are changed to
MAXCPU
parent c7c456e9
No related branches found
No related tags found
No related merge requests found
......@@ -252,11 +252,8 @@ static __inline void splx(intrmask_t ipl) { return; }
/* must match max_cpus in include/sched.hh */
#define MAXCPU (sizeof(unsigned long) * 8)
/*
* This should the number of actual, not possible CPUs, but we can't get at
* that information for now.
*/
#define mp_ncpus MAXCPU
extern unsigned smp_processors;
#define mp_ncpus smp_processors
/*
* OSv: Copied from kern_time.c
......
......@@ -43,8 +43,8 @@
#define CPU curcpu
#define minclsyspri PRIBIO
#define maxclsyspri PVM
#define max_ncpus mp_ncpus
#define boot_max_ncpus mp_ncpus
#define max_ncpus MAXCPU
#define boot_max_ncpus MAXCPU
#define TS_RUN 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment