Deleted Added
full compact
kern_linker.c (134364) kern_linker.c (144443)
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 134364 2004-08-27 01:20:26Z iedowse $");
28__FBSDID("$FreeBSD: head/sys/kern/kern_linker.c 144443 2005-03-31 22:49:31Z jhb $");
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>

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

136
137SYSINIT(linker_class, SI_SUB_KLD, SI_ORDER_ANY, linker_stop_class_add, NULL)
138
139int
140linker_add_class(linker_class_t lc)
141{
142
143 /*
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>

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

136
137SYSINIT(linker_class, SI_SUB_KLD, SI_ORDER_ANY, linker_stop_class_add, NULL)
138
139int
140linker_add_class(linker_class_t lc)
141{
142
143 /*
144 * We disallow any class registration passt SI_ORDER_ANY
145 * of SI_SUB_KLD.
144 * We disallow any class registration past SI_ORDER_ANY
145 * of SI_SUB_KLD. We bump the reference count to keep the
146 * ops from being freed.
146 */
147 if (linker_no_more_classes == 1)
148 return (EPERM);
149 kobj_class_compile((kobj_class_t) lc);
147 */
148 if (linker_no_more_classes == 1)
149 return (EPERM);
150 kobj_class_compile((kobj_class_t) lc);
150 ((kobj_class_t)lc)->refs++; /* prevent ops being freed */
151 ((kobj_class_t)lc)->refs++; /* XXX: kobj_mtx */
151 TAILQ_INSERT_TAIL(&classes, lc, link);
152 return (0);
153}
154
155static void
156linker_file_sysinit(linker_file_t lf)
157{
158 struct sysinit **start, **stop, **sipp, **xipp, *save;

--- 1688 unchanged lines hidden ---
152 TAILQ_INSERT_TAIL(&classes, lc, link);
153 return (0);
154}
155
156static void
157linker_file_sysinit(linker_file_t lf)
158{
159 struct sysinit **start, **stop, **sipp, **xipp, *save;

--- 1688 unchanged lines hidden ---