Store in globaldata our CPU ID#. Provide a lock for panics - only one
CPU can panic at a time. Obtained from:Andrew Gallatin <gallatin@cs.duke.edu>
This commit is contained in:
parent
31a5760aa2
commit
036f9ff7a3
@ -282,6 +282,7 @@ globaldata_init(struct globaldata *globaldata, int cpuno, size_t sz)
|
||||
globaldata->gd_other_cpus = all_cpus & ~(1 << cpuno);
|
||||
globaldata->gd_next_asn = 0;
|
||||
globaldata->gd_current_asngen = 1;
|
||||
globaldata->gd_cpuid = cpuno;
|
||||
cpuno_to_globaldata[cpuno] = globaldata;
|
||||
}
|
||||
|
||||
@ -369,10 +370,14 @@ s_lock_try(struct simplelock *lkp)
|
||||
/* lock around the MP rendezvous */
|
||||
static struct simplelock smp_rv_lock;
|
||||
|
||||
/* only 1 CPU can panic at a time :) */
|
||||
struct simplelock panic_lock;
|
||||
|
||||
static void
|
||||
init_locks(void)
|
||||
{
|
||||
s_lock_init(&smp_rv_lock);
|
||||
s_lock_init(&panic_lock);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -62,6 +62,7 @@ struct globaldata {
|
||||
u_int gd_astpending;
|
||||
SLIST_ENTRY(globaldata) gd_allcpu;
|
||||
int gd_witness_spin_check;
|
||||
u_int gd_cpuid;
|
||||
#ifdef KTR_PERCPU
|
||||
volatile int gd_ktr_idx; /* Index into trace table */
|
||||
char *gd_ktr_buf;
|
||||
|
@ -55,6 +55,8 @@ s_unlock(struct simplelock *lkp)
|
||||
lkp->lock_data = 0;
|
||||
}
|
||||
|
||||
extern struct simplelock panic_lock;
|
||||
|
||||
#if !defined(SIMPLELOCK_DEBUG) && MAXCPU > 1
|
||||
/*
|
||||
* This set of defines turns on the real functions in i386/isa/apic_ipl.s.
|
||||
|
@ -62,6 +62,7 @@ struct globaldata {
|
||||
u_int gd_astpending;
|
||||
SLIST_ENTRY(globaldata) gd_allcpu;
|
||||
int gd_witness_spin_check;
|
||||
u_int gd_cpuid;
|
||||
#ifdef KTR_PERCPU
|
||||
volatile int gd_ktr_idx; /* Index into trace table */
|
||||
char *gd_ktr_buf;
|
||||
|
@ -62,6 +62,7 @@ struct globaldata {
|
||||
u_int gd_astpending;
|
||||
SLIST_ENTRY(globaldata) gd_allcpu;
|
||||
int gd_witness_spin_check;
|
||||
u_int gd_cpuid;
|
||||
#ifdef KTR_PERCPU
|
||||
volatile int gd_ktr_idx; /* Index into trace table */
|
||||
char *gd_ktr_buf;
|
||||
|
@ -62,6 +62,7 @@ struct globaldata {
|
||||
u_int gd_astpending;
|
||||
SLIST_ENTRY(globaldata) gd_allcpu;
|
||||
int gd_witness_spin_check;
|
||||
u_int gd_cpuid;
|
||||
#ifdef KTR_PERCPU
|
||||
volatile int gd_ktr_idx; /* Index into trace table */
|
||||
char *gd_ktr_buf;
|
||||
|
Loading…
Reference in New Issue
Block a user