Move the call to pmap_bootstrap to after the initialisation of thread0.

This allows us to use mutexes in pmap safely. Also initialise fpcurthread
for cpu0 so that ia64_fpstate_check doesn't barf during boot.
This commit is contained in:
dfr 2002-03-14 09:20:07 +00:00
parent 1fde57f8aa
commit 8af7d2dfbb

View File

@ -670,11 +670,6 @@ ia64_init(u_int64_t arg1, u_int64_t arg2)
pcpu_init(pcpup, 0, PAGE_SIZE);
ia64_set_k4((u_int64_t) pcpup);
/*
* Initialize the virtual memory system.
*/
pmap_bootstrap();
/*
* Initialize the rest of proc 0's PCB.
*
@ -691,6 +686,9 @@ ia64_init(u_int64_t arg1, u_int64_t arg2)
/* Setup curproc so that mutexes work */
PCPU_SET(curthread, &thread0);
/* We pretend to own FP state so that ia64_fpstate_check() works */
PCPU_SET(fpcurthread, &thread0);
LIST_INIT(&thread0.td_contested);
/*
@ -701,6 +699,11 @@ ia64_init(u_int64_t arg1, u_int64_t arg2)
mtx_init(&proc0.p_mtx, "process lock", MTX_DEF);
mtx_lock(&Giant);
/*
* Initialize the virtual memory system.
*/
pmap_bootstrap();
/*
* Initialize debuggers, and break into them if appropriate.
*/
@ -1301,7 +1304,7 @@ ia64_fpstate_check(struct thread *td)
{
if ((td->td_frame->tf_cr_ipsr & IA64_PSR_DFH) == 0)
if (td != PCPU_GET(fpcurthread))
panic("ia64_check_fpcurthread: bogus");
panic("ia64_fpstate_check: bogus");
}
/*