init_main.c (40394) | init_main.c (41931) |
---|---|
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 | 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.98 1998/10/09 23:42:47 peter Exp $ | 42 * $Id: init_main.c,v 1.99 1998/10/15 17:09:19 peter 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> --- 27 unchanged lines hidden (view full) --- 78extern void __main __P((void)); 79extern void main __P((void *framep)); 80 81/* Components of the first process -- never freed. */ 82static struct session session0; 83static struct pgrp pgrp0; 84struct proc proc0; 85static struct pcred cred0; | 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> --- 27 unchanged lines hidden (view full) --- 78extern void __main __P((void)); 79extern void main __P((void *framep)); 80 81/* Components of the first process -- never freed. */ 82static struct session session0; 83static struct pgrp pgrp0; 84struct proc proc0; 85static struct pcred cred0; |
86#ifdef COMPAT_LINUX_THREADS 87static struct procsig procsig0; 88#endif /* COMPAT_LINUX_THREADS */ |
|
86static struct filedesc0 filedesc0; 87static struct plimit limit0; 88static struct vmspace vmspace0; 89struct proc *initproc; 90 91int cmask = CMASK; 92extern struct user *proc0paddr; 93 --- 316 unchanged lines hidden (view full) --- 410 bcopy("swapper", p->p_comm, sizeof ("swapper")); 411 412 /* Create credentials. */ 413 cred0.p_refcnt = 1; 414 p->p_cred = &cred0; 415 p->p_ucred = crget(); 416 p->p_ucred->cr_ngroups = 1; /* group 0 */ 417 | 89static struct filedesc0 filedesc0; 90static struct plimit limit0; 91static struct vmspace vmspace0; 92struct proc *initproc; 93 94int cmask = CMASK; 95extern struct user *proc0paddr; 96 --- 316 unchanged lines hidden (view full) --- 413 bcopy("swapper", p->p_comm, sizeof ("swapper")); 414 415 /* Create credentials. */ 416 cred0.p_refcnt = 1; 417 p->p_cred = &cred0; 418 p->p_ucred = crget(); 419 p->p_ucred->cr_ngroups = 1; /* group 0 */ 420 |
421#ifdef COMPAT_LINUX_THREADS 422 /* Create procsig. */ 423 p->p_procsig = &procsig0; 424 p->p_procsig->ps_refcnt = 2; 425 426#endif /* COMPAT_LINUX_THREADS */ |
|
418 /* Create the file descriptor table. */ 419 fdp = &filedesc0; 420 p->p_fd = &fdp->fd_fd; 421 fdp->fd_fd.fd_refcnt = 1; 422 fdp->fd_fd.fd_cmask = cmask; 423 fdp->fd_fd.fd_ofiles = fdp->fd_dfiles; 424 fdp->fd_fd.fd_ofileflags = fdp->fd_dfileflags; 425 fdp->fd_fd.fd_nfiles = NDFILE; --- 30 unchanged lines hidden (view full) --- 456 /* 457 * proc0 needs to have a coherent frame base in its stack. 458 */ 459 cpu_set_init_frame(p, init_framep); /* XXX! */ 460#endif /* INCOMPAT_LITES2*/ 461#endif 462 463 /* | 427 /* Create the file descriptor table. */ 428 fdp = &filedesc0; 429 p->p_fd = &fdp->fd_fd; 430 fdp->fd_fd.fd_refcnt = 1; 431 fdp->fd_fd.fd_cmask = cmask; 432 fdp->fd_fd.fd_ofiles = fdp->fd_dfiles; 433 fdp->fd_fd.fd_ofileflags = fdp->fd_dfileflags; 434 fdp->fd_fd.fd_nfiles = NDFILE; --- 30 unchanged lines hidden (view full) --- 465 /* 466 * proc0 needs to have a coherent frame base in its stack. 467 */ 468 cpu_set_init_frame(p, init_framep); /* XXX! */ 469#endif /* INCOMPAT_LITES2*/ 470#endif 471 472 /* |
473#ifndef COMPAT_LINUX_THREADS |
|
464 * We continue to place resource usage info and signal 465 * actions in the user struct so they're pageable. 466 */ 467 p->p_stats = &p->p_addr->u_stats; 468 p->p_sigacts = &p->p_addr->u_sigacts; | 474 * We continue to place resource usage info and signal 475 * actions in the user struct so they're pageable. 476 */ 477 p->p_stats = &p->p_addr->u_stats; 478 p->p_sigacts = &p->p_addr->u_sigacts; |
479#else 480 * We continue to place resource usage info in the user struct so 481 * it's pageable. 482 */ 483 p->p_stats = &p->p_addr->u_stats; |
|
469 | 484 |
485 p->p_sigacts = &p->p_procsig->ps_sigacts; 486#endif /* COMPAT_LINUX_THREADS */ 487 |
|
470 /* 471 * Charge root for one process. 472 */ 473 (void)chgproccnt(0, 1); 474 475 /* 476 * Initialize the procfs flags (to 0, of course) 477 */ --- 212 unchanged lines hidden --- | 488 /* 489 * Charge root for one process. 490 */ 491 (void)chgproccnt(0, 1); 492 493 /* 494 * Initialize the procfs flags (to 0, of course) 495 */ --- 212 unchanged lines hidden --- |