kern_module.c (185635) | kern_module.c (185642) |
---|---|
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 --- 13 unchanged lines hidden (view full) --- 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 "opt_compat.h" 28 29#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 --- 13 unchanged lines hidden (view full) --- 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 "opt_compat.h" 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/kern/kern_module.c 185635 2008-12-05 13:40:25Z jhb $"); | 30__FBSDID("$FreeBSD: head/sys/kern/kern_module.c 185642 2008-12-05 16:47:30Z jhb $"); |
31 32#include <sys/param.h> 33#include <sys/kernel.h> 34#include <sys/systm.h> 35#include <sys/eventhandler.h> 36#include <sys/malloc.h> 37#include <sys/sysproto.h> 38#include <sys/sysent.h> --- 86 unchanged lines hidden (view full) --- 125 if (error) { 126 MOD_EVENT(mod, MOD_UNLOAD); 127 MOD_XLOCK; 128 module_release(mod); 129 MOD_XUNLOCK; 130 printf("module_register_init: MOD_LOAD (%s, %p, %p) error" 131 " %d\n", data->name, (void *)data->evhand, data->priv, 132 error); | 31 32#include <sys/param.h> 33#include <sys/kernel.h> 34#include <sys/systm.h> 35#include <sys/eventhandler.h> 36#include <sys/malloc.h> 37#include <sys/sysproto.h> 38#include <sys/sysent.h> --- 86 unchanged lines hidden (view full) --- 125 if (error) { 126 MOD_EVENT(mod, MOD_UNLOAD); 127 MOD_XLOCK; 128 module_release(mod); 129 MOD_XUNLOCK; 130 printf("module_register_init: MOD_LOAD (%s, %p, %p) error" 131 " %d\n", data->name, (void *)data->evhand, data->priv, 132 error); |
133 } else { 134 MOD_XLOCK; 135 if (mod->file) { 136 /* 137 * Once a module is succesfully loaded, move 138 * it to the head of the module list for this 139 * linker file. This resorts the list so that 140 * when the kernel linker iterates over the 141 * modules to unload them, it will unload them 142 * in the reverse order they were loaded. 143 */ 144 TAILQ_REMOVE(&mod->file->modules, mod, flink); 145 TAILQ_INSERT_HEAD(&mod->file->modules, mod, flink); 146 } 147 MOD_XUNLOCK; |
|
133 } 134 mtx_unlock(&Giant); 135} 136 137int 138module_register(const moduledata_t *data, linker_file_t container) 139{ 140 size_t namelen; --- 369 unchanged lines hidden --- | 148 } 149 mtx_unlock(&Giant); 150} 151 152int 153module_register(const moduledata_t *data, linker_file_t container) 154{ 155 size_t namelen; --- 369 unchanged lines hidden --- |