diff options
author | jake <jake@FreeBSD.org> | 2000-12-13 00:17:05 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2000-12-13 00:17:05 +0000 |
commit | a4ad237eaa665b78919b8ff019591629b59df5e9 (patch) | |
tree | 43d22ede99071cd294fded182b591a4a3cb8d414 /sys/i386/ibcs2/ibcs2_sysvec.c | |
parent | 825aa5c1b32389b54f15847261348e090c31b7fc (diff) | |
download | FreeBSD-src-a4ad237eaa665b78919b8ff019591629b59df5e9.zip FreeBSD-src-a4ad237eaa665b78919b8ff019591629b59df5e9.tar.gz |
- Change the allproc_lock to use a macro, ALLPROC_LOCK(how), instead
of explicit calls to lockmgr. Also provides macros for the flags
pased to specify shared, exclusive or release which map to the
lockmgr flags. This is so that the use of lockmgr can be easily
replaced with optimized reader-writer locks.
- Add some locking that I missed the first time.
Diffstat (limited to 'sys/i386/ibcs2/ibcs2_sysvec.c')
-rw-r--r-- | sys/i386/ibcs2/ibcs2_sysvec.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/i386/ibcs2/ibcs2_sysvec.c b/sys/i386/ibcs2/ibcs2_sysvec.c index 3f08212..8eb2987 100644 --- a/sys/i386/ibcs2/ibcs2_sysvec.c +++ b/sys/i386/ibcs2/ibcs2_sysvec.c @@ -32,6 +32,7 @@ #include <sys/param.h> #include <sys/kernel.h> +#include <sys/lock.h> #include <sys/module.h> #include <sys/sysent.h> #include <sys/signalvar.h> @@ -75,18 +76,23 @@ static int ibcs2_modevent(module_t mod, int type, void *unused) { struct proc *p = NULL; + int rval = 0; switch(type) { case MOD_UNLOAD: /* if this was an ELF module we'd use elf_brand_inuse()... */ + ALLPROC_LOCK(AP_SHARED); for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) { - if (p->p_sysent == &ibcs2_svr3_sysvec) - return EBUSY; + if (p->p_sysent == &ibcs2_svr3_sysvec) { + rval = EBUSY; + break; + } } + ALLPROC_LOCK(AP_RELEASE); default: /* do not care */ } - return 0; + return (rval); } static moduledata_t ibcs2_mod = { "ibcs2", |