projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new filedesc structure; point p_stats, p_sigacts at p_addr instead of u.
[unix-history]
/
usr
/
src
/
sys
/
kern
/
init_main.c
diff --git
a/usr/src/sys/kern/init_main.c
b/usr/src/sys/kern/init_main.c
index
1374483
..
b06d88d
100644
(file)
--- a/
usr/src/sys/kern/init_main.c
+++ b/
usr/src/sys/kern/init_main.c
@@
-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.3
4
(Berkeley) %G%
+ * @(#)init_main.c 7.3
5
(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"
@@
-22,12
+23,12
@@
#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 filedesc
0
*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();
/*