kern_linker.c (df8abd0bb91dd5686111bc0d6ac9f65aa3e66af9) kern_linker.c (9c8b8baa38c9a8135d7602f127cb0c735010837d)
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

--- 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 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 * $Id: kern_linker.c,v 1.32 1999/05/08 13:01:56 peter Exp $
26 * $Id: kern_linker.c,v 1.33 1999/06/30 15:33:35 peter Exp $
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>

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

91
92static void
93linker_file_sysinit(linker_file_t lf)
94{
95 struct linker_set* sysinits;
96 struct sysinit** sipp;
97 struct sysinit** xipp;
98 struct sysinit* save;
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>

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

91
92static void
93linker_file_sysinit(linker_file_t lf)
94{
95 struct linker_set* sysinits;
96 struct sysinit** sipp;
97 struct sysinit** xipp;
98 struct sysinit* save;
99 struct proc *p2;
100 const moduledata_t *moddata;
101 int error;
102
103 KLD_DPF(FILE, ("linker_file_sysinit: calling SYSINITs for %s\n",
104 lf->filename));
105
106 sysinits = (struct linker_set*)
107 linker_file_lookup_symbol(lf, "sysinit_set", 0);

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

144 /*
145 * Traverse the (now) ordered list of system initialization tasks.
146 * Perform each task, and continue on to the next task.
147 */
148 for (sipp = (struct sysinit **)sysinits->ls_items; *sipp; sipp++) {
149 if ((*sipp)->subsystem == SI_SUB_DUMMY)
150 continue; /* skip dummy task(s)*/
151
99 const moduledata_t *moddata;
100 int error;
101
102 KLD_DPF(FILE, ("linker_file_sysinit: calling SYSINITs for %s\n",
103 lf->filename));
104
105 sysinits = (struct linker_set*)
106 linker_file_lookup_symbol(lf, "sysinit_set", 0);

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

143 /*
144 * Traverse the (now) ordered list of system initialization tasks.
145 * Perform each task, and continue on to the next task.
146 */
147 for (sipp = (struct sysinit **)sysinits->ls_items; *sipp; sipp++) {
148 if ((*sipp)->subsystem == SI_SUB_DUMMY)
149 continue; /* skip dummy task(s)*/
150
152 switch ((*sipp)->type) {
153 case SI_TYPE_DEFAULT:
154 /* no special processing*/
155 (*((*sipp)->func))((*sipp)->udata);
156 break;
157
158 case SI_TYPE_KTHREAD:
159 /* kernel thread*/
160 if (fork1(&proc0, RFFDG|RFPROC|RFMEM, &p2))
161 panic("fork kernel thread");
162 cpu_set_fork_handler(p2, (*sipp)->func, (*sipp)->udata);
163 break;
164
165 case SI_TYPE_KPROCESS:
166 /* kernel thread*/
167 if (fork1(&proc0, RFFDG|RFPROC, &p2))
168 panic("fork kernel process");
169 cpu_set_fork_handler(p2, (*sipp)->func, (*sipp)->udata);
170 break;
171
172 default:
173 panic ("linker_file_sysinit: unrecognized init type");
174 }
151 /* Call function */
152 (*((*sipp)->func))((*sipp)->udata);
175 }
176}
177
178static void
179linker_file_sysuninit(linker_file_t lf)
180{
181 struct linker_set* sysuninits;
182 struct sysinit** sipp;

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

216 /*
217 * Traverse the (now) ordered list of system initialization tasks.
218 * Perform each task, and continue on to the next task.
219 */
220 for (sipp = (struct sysinit **)sysuninits->ls_items; *sipp; sipp++) {
221 if ((*sipp)->subsystem == SI_SUB_DUMMY)
222 continue; /* skip dummy task(s)*/
223
153 }
154}
155
156static void
157linker_file_sysuninit(linker_file_t lf)
158{
159 struct linker_set* sysuninits;
160 struct sysinit** sipp;

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

194 /*
195 * Traverse the (now) ordered list of system initialization tasks.
196 * Perform each task, and continue on to the next task.
197 */
198 for (sipp = (struct sysinit **)sysuninits->ls_items; *sipp; sipp++) {
199 if ((*sipp)->subsystem == SI_SUB_DUMMY)
200 continue; /* skip dummy task(s)*/
201
224 switch ((*sipp)->type) {
225 case SI_TYPE_DEFAULT:
226 /* no special processing*/
227 (*((*sipp)->func))((*sipp)->udata);
228 break;
229
230 default:
231 panic("linker_file_sysuninit: unrecognized uninit type");
232 }
202 /* Call function */
203 (*((*sipp)->func))((*sipp)->udata);
233 }
234}
235
236static void
237linker_file_register_sysctls(linker_file_t lf)
238{
239 struct linker_set* sysctls;
240

--- 825 unchanged lines hidden ---
204 }
205}
206
207static void
208linker_file_register_sysctls(linker_file_t lf)
209{
210 struct linker_set* sysctls;
211

--- 825 unchanged lines hidden ---