diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-01-26 19:01:36 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-01-26 19:01:36 +0100 |
commit | 8d51e7fa1a1dbcbde513c2b756d504c879598907 (patch) | |
tree | 4cd1a3aaab346ac990bc9058e8cc4928258be6ae /sys/src/9/port/portdat.h | |
parent | 60bb408acca3b48b17f9158132849b894ad9f234 (diff) |
kernel: implement portable userinit() and simplify process creation
replace machine specific userinit() by a portable
implemntation that uses kproc() to create the first
process. the initcode text is mapped using kmap(),
so there is no need for machine specific tmpmap()
functions.
initcode stack preparation should be done in init0()
where the stack is mapped and can be accessed directly.
replacing the machine specific userinit() allows some
big simplifications as sysrfork() and kproc() are now
the only callers of newproc() and we can avoid initializing
fields that we know are being initialized by these
callers.
rename autogenerated init.h and reboot.h headers.
the initcode[] and rebootcode[] blobs are now in *.i
files and hex generation was moved to portmkfile. the
machine specific mkfile only needs to specify how to
build rebootcode.out and initcode.out.
Diffstat (limited to 'sys/src/9/port/portdat.h')
-rw-r--r-- | sys/src/9/port/portdat.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/src/9/port/portdat.h b/sys/src/9/port/portdat.h index 830ebd95e..2a1cd3b07 100644 --- a/sys/src/9/port/portdat.h +++ b/sys/src/9/port/portdat.h @@ -661,6 +661,7 @@ struct Proc QLock seglock; /* locked whenever seg[] changes */ ulong pid; ulong noteid; /* Equivalent of note group */ + ulong parentpid; Proc *pidhash; /* next proc in pid hash */ Lock exl; /* Lock count and waitq */ @@ -678,8 +679,6 @@ struct Proc Fgrp *closingfgrp; /* used during teardown */ - ulong parentpid; - int insyscall; ulong time[6]; /* User, Sys, Real; child U, S, R */ @@ -698,6 +697,7 @@ struct Proc Proc *pdbg; /* the debugging process */ ulong procmode; /* proc device default file mode */ int privatemem; /* proc does not let anyone read mem */ + int noswap; /* process is not swappable */ int hang; /* hang at next exec for debug */ int procctl; /* Control for /proc debugging */ uintptr pc; /* DEBUG only */ @@ -710,7 +710,6 @@ struct Proc Proc *palarm; /* Next alarm time */ ulong alarm; /* Time of call */ int newtlb; /* Pager has changed my pte's, I must flush */ - int noswap; /* process is not swappable */ uintptr rendtag; /* Tag for rendezvous */ uintptr rendval; /* Value for rendezvous */ @@ -722,8 +721,8 @@ struct Proc void (*kpfun)(void*); void *kparg; - int scallnr; /* sys call number */ Sargs s; /* syscall arguments */ + int scallnr; /* sys call number */ int nerrlab; Label errlab[NERR]; char *syserrstr; /* last error from a system call, errbuf0 or 1 */ |