Deleted Added
sdiff udiff text old ( 31564 ) new ( 31675 )
full compact
1/*
2 * Copyright (c) 1995 Terrence R. Lambert
3 * All rights reserved.
4 *
5 * Copyright (c) 1982, 1986, 1989, 1991, 1992, 1993
6 * The Regents of the University of California. All rights reserved.
7 * (c) UNIX System Laboratories, Inc.
8 * All or some portions of this file are derived from material licensed

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

34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 * SUCH DAMAGE.
40 *
41 * @(#)init_main.c 8.9 (Berkeley) 1/21/94
42 * $Id: init_main.c,v 1.76 1997/11/25 07:07:41 julian Exp $
43 */
44
45#include "opt_devfs.h"
46
47#include <sys/param.h>
48#include <sys/file.h>
49#include <sys/filedesc.h>
50#include <sys/kernel.h>
51#include <sys/mount.h>
52#include <sys/sysctl.h>
53#include <sys/proc.h>
54#include <sys/resourcevar.h>
55#include <sys/signalvar.h>
56#include <sys/systm.h>
57#include <sys/vnode.h>
58#include <sys/sysent.h>
59#include <sys/reboot.h>
60#include <sys/sysproto.h>
61#include <sys/vmmeter.h>
62
63#include <machine/cpu.h>
64
65#include <vm/vm.h>
66#include <vm/vm_param.h>
67#include <vm/vm_prot.h>
68#include <sys/lock.h>
69#include <vm/pmap.h>

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

189 /*
190 * Traverse the (now) ordered list of system initialization tasks.
191 * Perform each task, and continue on to the next task.
192 *
193 * The last item on the list is expected to be the scheduler,
194 * which will not return.
195 */
196 for( sipp = (struct sysinit **)sysinit_set.ls_items; *sipp; sipp++) {
197 if( (*sipp)->subsystem == SI_SUB_DUMMY)
198 continue; /* skip dummy task(s)*/
199
200 switch( (*sipp)->type) {
201 case SI_TYPE_DEFAULT:
202 /* no special processing*/
203 (*((*sipp)->func))( (*sipp)->udata);
204 break;
205
206 case SI_TYPE_KTHREAD:
207 /* kernel thread*/
208 if (fork(&proc0, NULL))
209 panic("fork kernel process");
210 cpu_set_fork_handler(pfind(proc0.p_retval[0]),
211 (*sipp)->func, (*sipp)->udata);
212 break;
213
214 default:
215 panic( "init_main: unrecognized init type");
216 }

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

502 **** 1) This code returns to startup the system; this is
503 **** abnormal for a kernel thread.
504 **** 2) This code promiscuously uses init_frame
505 ****
506 ***************************************************************************
507 */
508
509static void kthread_init __P((void *dummy));
510SYSINIT_KT(init,SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, kthread_init, NULL)
511
512
513extern void prepare_usermode __P((void));
514static void start_init __P((struct proc *p));
515
516/* ARGSUSED*/
517static void
518kthread_init(dummy)

--- 118 unchanged lines hidden ---