diff options
author | John Baldwin <jhb@FreeBSD.org> | 2008-12-05 13:40:25 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2008-12-05 13:40:25 +0000 |
commit | b4824b48b4829bfcf7fe3f57ea01e854ce0c9ab4 (patch) | |
tree | a8522c6b0e4d16f7f55489f7822e5cbf7405ddf4 /sys/kern/kern_module.c | |
parent | 482b7172da61346880df580e23d3af7860281366 (diff) |
Notes
Diffstat (limited to 'sys/kern/kern_module.c')
-rw-r--r-- | sys/kern/kern_module.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/sys/kern/kern_module.c b/sys/kern/kern_module.c index e2c02b8d9274..fef7f87652fb 100644 --- a/sys/kern/kern_module.c +++ b/sys/kern/kern_module.c @@ -196,9 +196,7 @@ module_release(module_t mod) TAILQ_REMOVE(&modules, mod, link); if (mod->file) TAILQ_REMOVE(&mod->file->modules, mod, flink); - MOD_XUNLOCK; free(mod, M_MODULE); - MOD_XLOCK; } } @@ -232,16 +230,25 @@ module_lookupbyid(int modid) } int -module_unload(module_t mod, int flags) +module_quiesce(module_t mod) { int error; mtx_lock(&Giant); error = MOD_EVENT(mod, MOD_QUIESCE); + mtx_unlock(&Giant); if (error == EOPNOTSUPP || error == EINVAL) error = 0; - if (error == 0 || flags == LINKER_UNLOAD_FORCE) - error = MOD_EVENT(mod, MOD_UNLOAD); + return (error); +} + +int +module_unload(module_t mod) +{ + int error; + + mtx_lock(&Giant); + error = MOD_EVENT(mod, MOD_UNLOAD); mtx_unlock(&Giant); return (error); } @@ -262,6 +269,14 @@ module_getfnext(module_t mod) return (TAILQ_NEXT(mod, flink)); } +const char * +module_getname(module_t mod) +{ + + MOD_LOCK_ASSERT; + return (mod->name); +} + void module_setspecific(module_t mod, modspecific_t *datap) { |