From 8af7d2dfbb275885d37a3c14c0a56dfedfb20a57 Mon Sep 17 00:00:00 2001 From: dfr Date: Thu, 14 Mar 2002 09:20:07 +0000 Subject: [PATCH] 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. --- sys/ia64/ia64/machdep.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 45006ab55393..00de2c869425 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -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"); } /*