summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-10-18 18:27:44 +0000
committerjhb <jhb@FreeBSD.org>2005-10-18 18:27:44 +0000
commit71b612fc9b17c019175bbd48e522b6d5079418d7 (patch)
tree6814b69af829b11ba1058d38f39563ca2a1a0b83 /sys/kern
parentca175bacb2d44223ef5279602b9b808464fcf6f4 (diff)
downloadFreeBSD-src-71b612fc9b17c019175bbd48e522b6d5079418d7.zip
FreeBSD-src-71b612fc9b17c019175bbd48e522b6d5079418d7.tar.gz
Move the initialization of the devmtx into the mutex_init() function
called during early init before cninit(). Tested on: i386, alpha, sparc64 Reviewed by: phk, imp Reported by: Divacky Roman xdivac02 at stud dot fit dot vutbr dot cz MFC after: 1 week
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_conf.c3
-rw-r--r--sys/kern/kern_mutex.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index b400a4e..7b5c6ea 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -57,8 +57,7 @@ static struct cdev *make_dev_credv(struct cdevsw *devsw, int minornr,
void
dev_lock(void)
{
- if (!mtx_initialized(&devmtx))
- mtx_init(&devmtx, "cdev", NULL, MTX_DEF);
+
mtx_lock(&devmtx);
}
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index a0127e7..874540d 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -67,6 +67,8 @@ __FBSDID("$FreeBSD$");
#include <ddb/ddb.h>
+#include <fs/devfs/devfs_int.h>
+
#include <vm/vm.h>
#include <vm/vm_extern.h>
@@ -900,5 +902,6 @@ mutex_init(void)
mtx_init(&Giant, "Giant", NULL, MTX_DEF | MTX_RECURSE);
mtx_init(&sched_lock, "sched lock", NULL, MTX_SPIN | MTX_RECURSE);
mtx_init(&proc0.p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK);
+ mtx_init(&devmtx, "cdev", NULL, MTX_DEF);
mtx_lock(&Giant);
}
OpenPOWER on IntegriCloud