Move MAXCPU from machine/smp.h to machine/param.h to fix breakage
with !SMP kernels. Also, replace NCPUS with MAXCPU since they are redundant.
This commit is contained in:
parent
5ef724ac4a
commit
92b123a002
@ -60,9 +60,9 @@ volatile u_int started_cpus;
|
||||
volatile u_int checkstate_probed_cpus;
|
||||
volatile u_int checkstate_need_ast;
|
||||
volatile u_int checkstate_pending_ast;
|
||||
struct proc* checkstate_curproc[NCPUS];
|
||||
int checkstate_cpustate[NCPUS];
|
||||
u_long checkstate_pc[NCPUS];
|
||||
struct proc* checkstate_curproc[MAXCPU];
|
||||
int checkstate_cpustate[MAXCPU];
|
||||
u_long checkstate_pc[MAXCPU];
|
||||
volatile u_int resched_cpus;
|
||||
void (*cpustop_restartfunc) __P((void));
|
||||
int mp_ncpus;
|
||||
@ -71,7 +71,7 @@ int smp_started;
|
||||
int boot_cpu_id;
|
||||
u_int32_t all_cpus;
|
||||
|
||||
static struct globaldata *cpuno_to_globaldata[NCPUS];
|
||||
static struct globaldata *cpuno_to_globaldata[MAXCPU];
|
||||
|
||||
int smp_active = 0; /* are the APs allowed to run? */
|
||||
SYSCTL_INT(_machdep, OID_AUTO, smp_active, CTLFLAG_RW, &smp_active, 0, "");
|
||||
|
@ -326,7 +326,7 @@ vm_offset_t kernel_vm_end;
|
||||
* Data for the ASN allocator
|
||||
*/
|
||||
static int pmap_maxasn;
|
||||
static pmap_t pmap_active[NCPUS];
|
||||
static pmap_t pmap_active[MAXCPU];
|
||||
|
||||
/*
|
||||
* Data for the pv entry allocation mechanism
|
||||
@ -1180,7 +1180,7 @@ pmap_pinit0(pmap)
|
||||
pmap->pm_count = 1;
|
||||
pmap->pm_ptphint = NULL;
|
||||
pmap->pm_active = 0;
|
||||
for (i = 0; i < NCPUS; i++) {
|
||||
for (i = 0; i < MAXCPU; i++) {
|
||||
pmap->pm_asn[i].asn = 0;
|
||||
pmap->pm_asn[i].gen = 0;
|
||||
}
|
||||
@ -1230,7 +1230,7 @@ pmap_pinit(pmap)
|
||||
pmap->pm_count = 1;
|
||||
pmap->pm_ptphint = NULL;
|
||||
pmap->pm_active = 0;
|
||||
for (i = 0; i < NCPUS; i++) {
|
||||
for (i = 0; i < MAXCPU; i++) {
|
||||
pmap->pm_asn[i].asn = 0;
|
||||
pmap->pm_asn[i].gen = 0;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ s_unlock(struct simplelock *lkp)
|
||||
lkp->lock_data = 0;
|
||||
}
|
||||
|
||||
#if !defined(SIMPLELOCK_DEBUG) && NCPUS > 1
|
||||
#if !defined(SIMPLELOCK_DEBUG) && MAXCPU > 1
|
||||
/*
|
||||
* This set of defines turns on the real functions in i386/isa/apic_ipl.s.
|
||||
*/
|
||||
@ -64,7 +64,7 @@ s_unlock(struct simplelock *lkp)
|
||||
#define simple_lock_try(alp) s_lock_try(alp)
|
||||
#define simple_unlock(alp) s_unlock(alp)
|
||||
|
||||
#endif /* !SIMPLELOCK_DEBUG && NCPUS > 1 */
|
||||
#endif /* !SIMPLELOCK_DEBUG && MAXCPU > 1 */
|
||||
|
||||
#define COM_LOCK()
|
||||
#define COM_UNLOCK()
|
||||
|
@ -71,9 +71,9 @@
|
||||
#define OBJFORMAT_DEFAULT "elf"
|
||||
|
||||
#ifdef SMP
|
||||
#define NCPUS 32
|
||||
#define MAXCPU 32
|
||||
#else
|
||||
#define NCPUS 1
|
||||
#define MAXCPU 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -178,7 +178,7 @@ struct pmap {
|
||||
struct {
|
||||
u_int32_t asn:8; /* address space number */
|
||||
u_int32_t gen:24; /* generation number */
|
||||
} pm_asn[NCPUS];
|
||||
} pm_asn[MAXCPU];
|
||||
struct pmap_statistics pm_stats; /* pmap statistics */
|
||||
struct vm_page *pm_ptphint; /* pmap ptp hint */
|
||||
};
|
||||
|
@ -22,16 +22,6 @@
|
||||
# error APIC_IO required for SMP, add "options APIC_IO" to your config file.
|
||||
#endif /* SMP && !APIC_IO */
|
||||
|
||||
/*
|
||||
* Maximum number of CPUs we will use.
|
||||
* In the !SMP case we save ourselves a litle space.
|
||||
*/
|
||||
#if defined(SMP)
|
||||
# define MAXCPU 16
|
||||
#else
|
||||
# define MAXCPU 1
|
||||
#endif /* SMP */
|
||||
|
||||
#if defined(SMP) || defined(APIC_IO)
|
||||
|
||||
#ifndef LOCORE
|
||||
|
@ -130,7 +130,7 @@ extern struct simplelock mpintr_lock;
|
||||
extern struct simplelock mcount_lock;
|
||||
extern struct simplelock panic_lock;
|
||||
|
||||
#if !defined(SIMPLELOCK_DEBUG) && NCPUS > 1
|
||||
#if !defined(SIMPLELOCK_DEBUG) && MAXCPU > 1
|
||||
/*
|
||||
* This set of defines turns on the real functions in i386/isa/apic_ipl.s.
|
||||
*/
|
||||
@ -139,7 +139,7 @@ extern struct simplelock panic_lock;
|
||||
#define simple_lock_try(alp) s_lock_try(alp)
|
||||
#define simple_unlock(alp) s_unlock(alp)
|
||||
|
||||
#endif /* !SIMPLELOCK_DEBUG && NCPUS > 1 */
|
||||
#endif /* !SIMPLELOCK_DEBUG && MAXCPU > 1 */
|
||||
|
||||
#endif /* LOCORE */
|
||||
|
||||
|
@ -65,10 +65,10 @@
|
||||
#define OBJFORMAT_DEFAULT "elf"
|
||||
|
||||
#ifdef SMP
|
||||
#define NCPUS 2
|
||||
#define MAXCPU 16
|
||||
#else
|
||||
#define NCPUS 1
|
||||
#endif
|
||||
#define MAXCPU 1
|
||||
#endif /* SMP */
|
||||
|
||||
/*
|
||||
* Round p (pointer or byte index) up to a correctly-aligned value
|
||||
|
@ -22,16 +22,6 @@
|
||||
# error APIC_IO required for SMP, add "options APIC_IO" to your config file.
|
||||
#endif /* SMP && !APIC_IO */
|
||||
|
||||
/*
|
||||
* Maximum number of CPUs we will use.
|
||||
* In the !SMP case we save ourselves a litle space.
|
||||
*/
|
||||
#if defined(SMP)
|
||||
# define MAXCPU 16
|
||||
#else
|
||||
# define MAXCPU 1
|
||||
#endif /* SMP */
|
||||
|
||||
#if defined(SMP) || defined(APIC_IO)
|
||||
|
||||
#ifndef LOCORE
|
||||
|
@ -545,7 +545,7 @@ lockmgr_printinfo(lkp)
|
||||
printf(" with %d pending", lkp->lk_waitcount);
|
||||
}
|
||||
|
||||
#if defined(SIMPLELOCK_DEBUG) && (NCPUS == 1 || defined(COMPILING_LINT))
|
||||
#if defined(SIMPLELOCK_DEBUG) && (MAXCPU == 1 || defined(COMPILING_LINT))
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
@ -640,4 +640,4 @@ _simple_unlock(alp, id, l)
|
||||
}
|
||||
#elif defined(SIMPLELOCK_DEBUG)
|
||||
#error "SIMPLELOCK_DEBUG is not compatible with SMP!"
|
||||
#endif /* SIMPLELOCK_DEBUG && NCPUS == 1 */
|
||||
#endif /* SIMPLELOCK_DEBUG && MAXCPU == 1 */
|
||||
|
@ -202,13 +202,13 @@ void _simple_lock __P((struct simplelock *alp, const char *, int));
|
||||
#define simple_lock(alp) _simple_lock(alp, __FILE__, __LINE__)
|
||||
void simple_lock_init __P((struct simplelock *alp));
|
||||
#else /* !SIMPLELOCK_DEBUG */
|
||||
#if NCPUS == 1 /* no multiprocessor locking is necessary */
|
||||
#if MAXCPU == 1 /* no multiprocessor locking is necessary */
|
||||
#define NULL_SIMPLELOCKS
|
||||
#define simple_lock_init(alp)
|
||||
#define simple_lock(alp)
|
||||
#define simple_lock_try(alp) (1) /* always succeeds */
|
||||
#define simple_unlock(alp)
|
||||
#endif /* NCPUS == 1 */
|
||||
#endif /* MAXCPU == 1 */
|
||||
#endif /* !SIMPLELOCK_DEBUG */
|
||||
|
||||
#endif /* !_LOCK_H_ */
|
||||
|
@ -202,13 +202,13 @@ void _simple_lock __P((struct simplelock *alp, const char *, int));
|
||||
#define simple_lock(alp) _simple_lock(alp, __FILE__, __LINE__)
|
||||
void simple_lock_init __P((struct simplelock *alp));
|
||||
#else /* !SIMPLELOCK_DEBUG */
|
||||
#if NCPUS == 1 /* no multiprocessor locking is necessary */
|
||||
#if MAXCPU == 1 /* no multiprocessor locking is necessary */
|
||||
#define NULL_SIMPLELOCKS
|
||||
#define simple_lock_init(alp)
|
||||
#define simple_lock(alp)
|
||||
#define simple_lock_try(alp) (1) /* always succeeds */
|
||||
#define simple_unlock(alp)
|
||||
#endif /* NCPUS == 1 */
|
||||
#endif /* MAXCPU == 1 */
|
||||
#endif /* !SIMPLELOCK_DEBUG */
|
||||
|
||||
#endif /* !_LOCK_H_ */
|
||||
|
@ -22,16 +22,6 @@
|
||||
# error APIC_IO required for SMP, add "options APIC_IO" to your config file.
|
||||
#endif /* SMP && !APIC_IO */
|
||||
|
||||
/*
|
||||
* Maximum number of CPUs we will use.
|
||||
* In the !SMP case we save ourselves a litle space.
|
||||
*/
|
||||
#if defined(SMP)
|
||||
# define MAXCPU 16
|
||||
#else
|
||||
# define MAXCPU 1
|
||||
#endif /* SMP */
|
||||
|
||||
#if defined(SMP) || defined(APIC_IO)
|
||||
|
||||
#ifndef LOCORE
|
||||
|
Loading…
Reference in New Issue
Block a user