From da083c2ba9388275c4e68ca6d33d2955f577ccbc Mon Sep 17 00:00:00 2001 From: dfr Date: Fri, 26 Jan 2001 17:52:34 +0000 Subject: [PATCH] Initialise proc0.p_heldmtx and proc0.p_contested and call mtx_enter(&Giant, MTX_DEF) after Giant is initialised. Reviewed by: jhb --- sys/ia64/ia64/machdep.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 4b7b50e79c7a..97f96cac7f13 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -579,19 +579,24 @@ ia64_init() proc0.p_md.md_tf = (struct trapframe *)(proc0.p_addr->u_pcb.pcb_sp + 16); - PCPU_SET(curproc, &proc0); - /* * Record all cpus in a list. */ SLIST_INIT(&cpuhead); SLIST_INSERT_HEAD(&cpuhead, GLOBALP, gd_allcpu); + /* Setup curproc so that mutexes work */ + PCPU_SET(curproc, &proc0); + + LIST_INIT(&proc0.p_heldmtx); + LIST_INIT(&proc0.p_contested); + /* * Initialise mutexes. */ mtx_init(&Giant, "Giant", MTX_DEF | MTX_RECURSE); mtx_init(&sched_lock, "sched lock", MTX_SPIN | MTX_RECURSE); + mtx_enter(&Giant, MTX_DEF); #if 0 /*