Deleted Added
full compact
kern_linker.c (86469) kern_linker.c (86553)
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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 *
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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 * $FreeBSD: head/sys/kern/kern_linker.c 86469 2001-11-16 21:08:40Z iedowse $
26 * $FreeBSD: head/sys/kern/kern_linker.c 86553 2001-11-18 18:19:35Z arr $
27 */
28
29#include "opt_ddb.h"
30
31#include <sys/param.h>
32#include <sys/kernel.h>
33#include <sys/systm.h>
34#include <sys/malloc.h>

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

65
66linker_file_t linker_kernel_file;
67
68static struct lock lock; /* lock for the file list */
69static linker_class_list_t classes;
70static linker_file_list_t linker_files;
71static int next_file_id = 1;
72
27 */
28
29#include "opt_ddb.h"
30
31#include <sys/param.h>
32#include <sys/kernel.h>
33#include <sys/systm.h>
34#include <sys/malloc.h>

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

65
66linker_file_t linker_kernel_file;
67
68static struct lock lock; /* lock for the file list */
69static linker_class_list_t classes;
70static linker_file_list_t linker_files;
71static int next_file_id = 1;
72
73#define LINKER_GET_NEXT_FILE_ID(a) do { \
74 linker_file_t lftmp; \
75 \
76retry: \
77 TAILQ_FOREACH(lftmp, &linker_files, link) { \
78 if (next_file_id == lftmp->id) { \
79 next_file_id++; \
80 goto retry; \
81 } \
82 } \
83 (a) = next_file_id; \
84} while(0)
85
86
73/* XXX wrong name; we're looking at version provision tags here, not modules */
74typedef TAILQ_HEAD(, modlist) modlisthead_t;
75struct modlist {
76 TAILQ_ENTRY(modlist) link; /* chain together all modules */
77 linker_file_t container;
78 const char *name;
79 int version;
80};

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

396 lf = (linker_file_t) kobj_create((kobj_class_t) lc, M_LINKER, M_WAITOK);
397 if (!lf)
398 goto out;
399
400 lf->refs = 1;
401 lf->userrefs = 0;
402 lf->flags = 0;
403 lf->filename = linker_strdup(filename);
87/* XXX wrong name; we're looking at version provision tags here, not modules */
88typedef TAILQ_HEAD(, modlist) modlisthead_t;
89struct modlist {
90 TAILQ_ENTRY(modlist) link; /* chain together all modules */
91 linker_file_t container;
92 const char *name;
93 int version;
94};

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

410 lf = (linker_file_t) kobj_create((kobj_class_t) lc, M_LINKER, M_WAITOK);
411 if (!lf)
412 goto out;
413
414 lf->refs = 1;
415 lf->userrefs = 0;
416 lf->flags = 0;
417 lf->filename = linker_strdup(filename);
404 lf->id = next_file_id++;
418 LINKER_GET_NEXT_FILE_ID(lf->id);
405 lf->ndeps = 0;
406 lf->deps = NULL;
407 STAILQ_INIT(&lf->common);
408 TAILQ_INIT(&lf->modules);
409
410 TAILQ_INSERT_TAIL(&linker_files, lf, link);
411
412out:

--- 1323 unchanged lines hidden ---
419 lf->ndeps = 0;
420 lf->deps = NULL;
421 STAILQ_INIT(&lf->common);
422 TAILQ_INIT(&lf->modules);
423
424 TAILQ_INSERT_TAIL(&linker_files, lf, link);
425
426out:

--- 1323 unchanged lines hidden ---