summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-04-02 22:19:16 +0000
committerjhb <jhb@FreeBSD.org>2002-04-02 22:19:16 +0000
commit9d3d63fcbcfccaf091b15608a262de78b5912c8a (patch)
treea511bf3088c2455af875faa67fac4fc49ade8493 /sys/ia64
parent26f5df0f6761c5fad4b517e8c0c4b46da408361b (diff)
downloadFreeBSD-src-9d3d63fcbcfccaf091b15608a262de78b5912c8a.zip
FreeBSD-src-9d3d63fcbcfccaf091b15608a262de78b5912c8a.tar.gz
- Move the MI mutexes sched_lock and Giant from being declared in the
various machdep.c's to being declared in kern_mutex.c. - Add a new function mutex_init() used to perform early initialization needed for mutexes such as setting up thread0's contested lock list and initializing MI mutexes. Change the various MD startup routines to call this function instead of duplicating all the code themselves. Tested on: alpha, i386
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/ia64/machdep.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c
index 2fffbc5..d1b68e7 100644
--- a/sys/ia64/ia64/machdep.c
+++ b/sys/ia64/ia64/machdep.c
@@ -96,9 +96,6 @@ u_int64_t va_bootinfo;
struct bootinfo bootinfo;
int bootinfo_error; /* XXX temporary ad-hoc error mask to help debugging */
-struct mtx sched_lock;
-struct mtx Giant;
-
extern char kstack[];
struct user *proc0uarea;
vm_offset_t proc0kstack;
@@ -688,6 +685,10 @@ ia64_init(u_int64_t arg1, u_int64_t arg2)
pcpu_init(pcpup, 0, PAGE_SIZE);
pcpup->pc_current_pmap = kernel_pmap;
ia64_set_k4((u_int64_t) pcpup);
+ PCPU_SET(curthread, &thread0);
+
+ /* We pretend to own FP state so that ia64_fpstate_check() works */
+ PCPU_SET(fpcurthread, &thread0);
/*
* Initialize the rest of proc 0's PCB.
@@ -702,21 +703,7 @@ ia64_init(u_int64_t arg1, u_int64_t arg2)
thread0.td_pcb->pcb_sp = (u_int64_t)thread0.td_frame - 16;
thread0.td_pcb->pcb_bspstore = (u_int64_t)proc0kstack;
- /* 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);
-
- /*
- * Initialise mutexes.
- */
- mtx_init(&Giant, "Giant", MTX_DEF | MTX_RECURSE);
- mtx_init(&sched_lock, "sched lock", MTX_SPIN | MTX_RECURSE);
- mtx_init(&proc0.p_mtx, "process lock", MTX_DEF|MTX_DUPOK);
- mtx_lock(&Giant);
+ mutex_init();
/*
* Initialize the virtual memory system.
OpenPOWER on IntegriCloud