kern_module.c (116182) | kern_module.c (132117) |
---|---|
1/*- 2 * Copyright (c) 1997 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/kern/kern_module.c 116182 2003-06-11 00:56:59Z obrien $"); | 28__FBSDID("$FreeBSD: head/sys/kern/kern_module.c 132117 2004-07-13 19:36:59Z phk $"); |
29 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/systm.h> 33#include <sys/eventhandler.h> 34#include <sys/malloc.h> 35#include <sys/sysproto.h> 36#include <sys/sysent.h> --- 173 unchanged lines hidden (view full) --- 210 211 TAILQ_FOREACH(mod, &modules, link) 212 if (mod->id == modid) 213 return(mod); 214 return (NULL); 215} 216 217int | 29 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/systm.h> 33#include <sys/eventhandler.h> 34#include <sys/malloc.h> 35#include <sys/sysproto.h> 36#include <sys/sysent.h> --- 173 unchanged lines hidden (view full) --- 210 211 TAILQ_FOREACH(mod, &modules, link) 212 if (mod->id == modid) 213 return(mod); 214 return (NULL); 215} 216 217int |
218module_unload(module_t mod) | 218module_unload(module_t mod, int flags) |
219{ | 219{ |
220 int error; |
|
220 | 221 |
222 error = MOD_EVENT(mod, MOD_QUIESCE); 223 if (error == EOPNOTSUPP) 224 error = 0; 225 if (flags == LINKER_UNLOAD_NORMAL && error != 0) 226 return (error); |
|
221 return (MOD_EVENT(mod, MOD_UNLOAD)); 222} 223 224int 225module_getid(module_t mod) 226{ 227 228 MOD_LOCK_ASSERT; --- 167 unchanged lines hidden --- | 227 return (MOD_EVENT(mod, MOD_UNLOAD)); 228} 229 230int 231module_getid(module_t mod) 232{ 233 234 MOD_LOCK_ASSERT; --- 167 unchanged lines hidden --- |