diff options
author | scottl <scottl@FreeBSD.org> | 2006-07-09 21:42:58 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2006-07-09 21:42:58 +0000 |
commit | 483a18cd99f95e5b2613d8b293d55d87980de91c (patch) | |
tree | c88f01a915a10c4783f9e2ae0ee7e7f8bc6053ce /sys/kern/subr_hints.c | |
parent | 3e2c62d3198b032c952fbda0c36b0eb1cbe1b74d (diff) | |
download | FreeBSD-src-483a18cd99f95e5b2613d8b293d55d87980de91c.zip FreeBSD-src-483a18cd99f95e5b2613d8b293d55d87980de91c.tar.gz |
Use a sleep mutex instead of an sx lock for the kernel environment. This
allows greater flexibility for drivers that want to query the environment.
Reviewed by: jhb, mux
Diffstat (limited to 'sys/kern/subr_hints.c')
-rw-r--r-- | sys/kern/subr_hints.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/subr_hints.c b/sys/kern/subr_hints.c index eac4f59..a46b938 100644 --- a/sys/kern/subr_hints.c +++ b/sys/kern/subr_hints.c @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/lock.h> -#include <sys/sx.h> +#include <sys/mutex.h> #include <sys/systm.h> #include <sys/bus.h> @@ -72,7 +72,7 @@ res_find(int *line, int *startln, break; case 2: /* fallback mode */ if (dynamic_kenv) { - sx_slock(&kenv_lock); + mtx_lock(&kenv_lock); cp = kenvp[0]; for (i = 0; cp != NULL; cp = kenvp[++i]) { if (!strncmp(cp, "hint.", 5)) { @@ -81,7 +81,7 @@ res_find(int *line, int *startln, break; } } - sx_sunlock(&kenv_lock); + mtx_unlock(&kenv_lock); } else { cp = kern_envp; while (cp) { @@ -114,11 +114,11 @@ res_find(int *line, int *startln, } if (use_kenv) { - sx_slock(&kenv_lock); + mtx_lock(&kenv_lock); i = 0; cp = kenvp[0]; if (cp == NULL) { - sx_sunlock(&kenv_lock); + mtx_unlock(&kenv_lock); return (ENOENT); } } else @@ -165,7 +165,7 @@ res_find(int *line, int *startln, } } if (use_kenv) - sx_sunlock(&kenv_lock); + mtx_unlock(&kenv_lock); if (cp == NULL) return ENOENT; |