summaryrefslogtreecommitdiffstats
path: root/sys/i386
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/i386
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/i386')
-rw-r--r--sys/i386/i386/machdep.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 485a69e..ffb2094 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -210,8 +210,6 @@ static struct trapframe proc0_tf;
static struct pcpu __pcpu;
#endif
-struct mtx sched_lock;
-struct mtx Giant;
struct mtx icu_lock;
static void
@@ -1693,12 +1691,8 @@ init386(first)
pcpu_init(pc, 0, sizeof(struct pcpu));
PCPU_SET(prvspace, pc);
-
- /* setup curproc so that mutexes work */
PCPU_SET(curthread, &thread0);
- LIST_INIT(&thread0.td_contested);
-
/*
* Initialize mutexes.
*
@@ -1707,12 +1701,9 @@ init386(first)
* must be able to get the icu lock, so it can't be
* under witness.
*/
- 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);
+ mutex_init();
mtx_init(&clock_lock, "clk", MTX_SPIN | MTX_RECURSE);
mtx_init(&icu_lock, "icu", MTX_SPIN | MTX_NOWITNESS);
- mtx_lock(&Giant);
/* make ldt memory segments */
/*
OpenPOWER on IntegriCloud