new filedesc structure; point p_stats, p_sigacts at p_addr instead of u.
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Tue, 26 Mar 1991 04:29:06 +0000 (20:29 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Tue, 26 Mar 1991 04:29:06 +0000 (20:29 -0800)
SCCS-vsn: sys/kern/init_main.c 7.35

usr/src/sys/kern/init_main.c

index 1374483..b06d88d 100644 (file)
@@ -3,17 +3,18 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)init_main.c 7.34 (Berkeley) %G%
+ *     @(#)init_main.c 7.35 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
-#include "systm.h"
-#include "user.h"
 #include "filedesc.h"
 #include "kernel.h"
 #include "mount.h"
 #include "map.h"
 #include "proc.h"
 #include "filedesc.h"
 #include "kernel.h"
 #include "mount.h"
 #include "map.h"
 #include "proc.h"
+#include "resourcevar.h"
+#include "signalvar.h"
+#include "systm.h"
 #include "vnode.h"
 #include "seg.h"
 #include "conf.h"
 #include "vnode.h"
 #include "seg.h"
 #include "conf.h"
 #include "malloc.h"
 #include "protosw.h"
 #include "reboot.h"
 #include "malloc.h"
 #include "protosw.h"
 #include "reboot.h"
+#include "user.h"
+
 
 #include "machine/cpu.h"
 
 #include "vm/vm.h"
 
 #include "machine/cpu.h"
 
 #include "vm/vm.h"
-#include "vm/vm_param.h"
-#include "vm/vm_map.h"
 
 /*
  * Components of process 0;
 
 /*
  * Components of process 0;
@@ -37,11 +38,10 @@ struct      session session0;
 struct pgrp pgrp0;
 struct proc proc0;
 struct pcred cred0;
 struct pgrp pgrp0;
 struct proc proc0;
 struct pcred cred0;
-struct filedesc filedesc0;
-struct file *fd0[NOEXTENT];
-char   fdflags0[NOEXTENT];
+struct filedesc0 filedesc0;
 struct plimit limit0;
 struct vmspace vmspace0;
 struct plimit limit0;
 struct vmspace vmspace0;
+struct proc *curproc = &proc0;
 struct proc *initproc, *pageproc;
 
 int    cmask = CMASK;
 struct proc *initproc, *pageproc;
 
 int    cmask = CMASK;
@@ -61,7 +61,7 @@ main(firstaddr)
 {
        register int i;
        register struct proc *p;
 {
        register int i;
        register struct proc *p;
-       register struct filedesc *fdp;
+       register struct filedesc0 *fdp;
        int s, rval[2];
 
        /*
        int s, rval[2];
 
        /*
@@ -111,12 +111,12 @@ main(firstaddr)
         * Create the file descriptor table for process 0.
         */
        fdp = &filedesc0;
         * Create the file descriptor table for process 0.
         */
        fdp = &filedesc0;
-       p->p_fd = fdp;
-       fdp->fd_refcnt = 1;
-       fdp->fd_cmask = cmask;
-       fdp->fd_ofiles = fd0;
-       fdp->fd_ofileflags = fdflags0;
-       fdp->fd_nfiles = NOEXTENT;
+       p->p_fd = &fdp->fd_fd;
+       fdp->fd_fd.fd_refcnt = 1;
+       fdp->fd_fd.fd_cmask = cmask;
+       fdp->fd_fd.fd_ofiles = fdp->fd_dfiles;
+       fdp->fd_fd.fd_ofileflags = fdp->fd_dfileflags;
+       fdp->fd_fd.fd_nfiles = NDFILE;
 
        /*
         * Set initial limits
 
        /*
         * Set initial limits
@@ -144,8 +144,8 @@ main(firstaddr)
         * We continue to place resource usage info
         * and signal actions in the user struct so they're pageable.
         */
         * We continue to place resource usage info
         * and signal actions in the user struct so they're pageable.
         */
-       p->p_stats = &u.u_stats;
-       p->p_sigacts = &u.u_sigacts;
+       p->p_stats = &((struct user *)p->p_addr)->u_stats;
+       p->p_sigacts = &((struct user *)p->p_addr)->u_sigacts;
 
        rqinit();
 
 
        rqinit();
 
@@ -215,14 +215,14 @@ main(firstaddr)
                panic("cannot mount root");
        /*
         * Get vnode for '/'.
                panic("cannot mount root");
        /*
         * Get vnode for '/'.
-        * Setup rootdir and fdp->fd_cdir to point to it.
+        * Setup rootdir and fdp->fd_fd.fd_cdir to point to it.
         */
        if (VFS_ROOT(rootfs, &rootdir))
                panic("cannot find root vnode");
         */
        if (VFS_ROOT(rootfs, &rootdir))
                panic("cannot find root vnode");
-       fdp->fd_cdir = rootdir;
-       VREF(fdp->fd_cdir);
+       fdp->fd_fd.fd_cdir = rootdir;
+       VREF(fdp->fd_fd.fd_cdir);
        VOP_UNLOCK(rootdir);
        VOP_UNLOCK(rootdir);
-       fdp->fd_rdir = NULL;
+       fdp->fd_fd.fd_rdir = NULL;
        swapinit();
 
        /*
        swapinit();
 
        /*