kernel: introduce devself

Devself provides to each process access to its own structures.

So far it contains four files:

- pid
- ppid
- pipes	used to implement pipe(2)
- segments used to implement segattach, segdetach and segfree
This commit is contained in:
2016-12-11 01:19:51 +01:00
parent f52a185030
commit c6de6b66e9
18 changed files with 480 additions and 315 deletions

View File

@ -680,8 +680,6 @@ enum{
Qnull,
Qosversion,
Qpgrpid,
Qpid,
Qppid,
Qrandom,
Qreboot,
Qswap,
@ -713,8 +711,6 @@ static Dirtab consdir[]={
"null", {Qnull}, 0, 0666,
"osversion", {Qosversion}, 0, 0444,
"pgrpid", {Qpgrpid}, NUMSIZE, 0444,
"pid", {Qpid}, NUMSIZE, 0444,
"ppid", {Qppid}, NUMSIZE, 0444,
"random", {Qrandom}, 0, 0444,
"reboot", {Qreboot}, 0, 0664,
"swap", {Qswap}, 0, 0664,
@ -944,12 +940,6 @@ consread(Chan *c, void *buf, long n, int64_t off)
case Qpgrpid:
return readnum(offset, buf, n, up->pgrp->pgrpid, NUMSIZE);
case Qpid:
return readnum(offset, buf, n, up->pid, NUMSIZE);
case Qppid:
return readnum(offset, buf, n, up->parentpid, NUMSIZE);
case Qtime:
return readtime(offset, buf, n);