Deleted Added
full compact
kern_linker.c (144443) kern_linker.c (146730)
1/*-
2 * Copyright (c) 1997-2000 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-2000 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_linker.c 144443 2005-03-31 22:49:31Z jhb $");
28__FBSDID("$FreeBSD: head/sys/kern/kern_linker.c 146730 2005-05-28 22:29:44Z pjd $");
29
30#include "opt_ddb.h"
31#include "opt_mac.h"
32
33#include <sys/param.h>
34#include <sys/kernel.h>
35#include <sys/systm.h>
36#include <sys/malloc.h>

--- 258 unchanged lines hidden (view full) ---

295 }
296 for (mdp = start; mdp < stop; mdp++) {
297 if ((*mdp)->md_type != MDT_MODULE)
298 continue;
299 moddata = (*mdp)->md_data;
300 KLD_DPF(FILE, ("Registering module %s in %s\n",
301 moddata->name, lf->filename));
302 error = module_register(moddata, lf);
29
30#include "opt_ddb.h"
31#include "opt_mac.h"
32
33#include <sys/param.h>
34#include <sys/kernel.h>
35#include <sys/systm.h>
36#include <sys/malloc.h>

--- 258 unchanged lines hidden (view full) ---

295 }
296 for (mdp = start; mdp < stop; mdp++) {
297 if ((*mdp)->md_type != MDT_MODULE)
298 continue;
299 moddata = (*mdp)->md_data;
300 KLD_DPF(FILE, ("Registering module %s in %s\n",
301 moddata->name, lf->filename));
302 error = module_register(moddata, lf);
303 if (error)
303 if (error) {
304 printf("Module %s failed to register: %d\n",
305 moddata->name, error);
304 printf("Module %s failed to register: %d\n",
305 moddata->name, error);
306 return (error);
307 }
306 }
307 return (0);
308}
309
310static void
311linker_init_kernel_modules(void)
312{
313

--- 35 unchanged lines hidden (view full) ---

349 error = LINKER_LOAD_FILE(lc, filename, &lf);
350 /*
351 * If we got something other than ENOENT, then it exists but
352 * we cannot load it for some other reason.
353 */
354 if (error != ENOENT)
355 foundfile = 1;
356 if (lf) {
308 }
309 return (0);
310}
311
312static void
313linker_init_kernel_modules(void)
314{
315

--- 35 unchanged lines hidden (view full) ---

351 error = LINKER_LOAD_FILE(lc, filename, &lf);
352 /*
353 * If we got something other than ENOENT, then it exists but
354 * we cannot load it for some other reason.
355 */
356 if (error != ENOENT)
357 foundfile = 1;
358 if (lf) {
357 linker_file_register_modules(lf);
359 error = linker_file_register_modules(lf);
360 if (error == EEXIST) {
361 linker_file_unload(lf, LINKER_UNLOAD_FORCE);
362 goto out;
363 }
358 linker_file_register_sysctls(lf);
359 linker_file_sysinit(lf);
360 lf->flags |= LINKER_FILE_LINKED;
361 *result = lf;
362 error = 0;
363 goto out;
364 }
365 }

--- 1482 unchanged lines hidden ---
364 linker_file_register_sysctls(lf);
365 linker_file_sysinit(lf);
366 lf->flags |= LINKER_FILE_LINKED;
367 *result = lf;
368 error = 0;
369 goto out;
370 }
371 }

--- 1482 unchanged lines hidden ---