Avoid crashing in early boot when WITNESS is enabled by moving the

mtx_init() for intr_table_lock after the globaldata pointer
initialization.
This commit is contained in:
Thomas Moestl 2002-02-13 16:36:44 +00:00
parent 71ff61ee93
commit 9a60579c15
3 changed files with 12 additions and 4 deletions

View File

@ -79,7 +79,8 @@ extern struct intr_vector intr_vectors[];
void intr_setup(int level, ih_func_t *ihf, int pri, iv_func_t *ivf,
void *iva);
void intr_init(void);
void intr_init1(void);
void intr_init2(void);
int inthand_add(const char *name, int vec, void (*handler)(void *),
void *arg, int flags, void **cookiep);
int inthand_remove(int vec, void *cookie);

View File

@ -159,11 +159,10 @@ intr_stray_vector(void *cookie)
}
void
intr_init()
intr_init1()
{
int i;
mtx_init(&intr_table_lock, "ithread table lock", MTX_SPIN);
/* Mark all interrupts as being stray. */
for (i = 0; i < NPIL; i++)
intr_handlers[i] = intr_stray_level;
@ -176,6 +175,13 @@ intr_init()
intr_handlers[PIL_LOW] = intr_dequeue;
}
void
intr_init2()
{
mtx_init(&intr_table_lock, "ithread table lock", MTX_SPIN);
}
/* Schedule a heavyweight interrupt process. */
static void
sched_ithd(void *cookie)

View File

@ -270,7 +270,7 @@ sparc64_init(caddr_t mdp, u_int *state, u_int mid, u_int bootmid,
/*
* Initialize the interrupt tables.
*/
intr_init();
intr_init1();
/*
* Initialize proc0 stuff (p_contested needs to be done early).
@ -315,6 +315,7 @@ sparc64_init(caddr_t mdp, u_int *state, u_int mid, u_int bootmid,
mtx_init(&sched_lock, "sched lock", MTX_SPIN | MTX_RECURSE);
mtx_init(&Giant, "Giant", MTX_DEF | MTX_RECURSE);
mtx_init(&proc0.p_mtx, "process lock", MTX_DEF);
intr_init2();
mtx_lock(&Giant);
}