| plan 9 kernel history: overview | file list | diff list |
1991/0705/port/portdat.h (diff list | history)
| 1991/0614/sys/src/9/port/portdat.h:5,14 – 1991/0705/sys/src/9/port/portdat.h:5,17 (short | long | prev | next) | ||
|
Add Egrp, Fgrp, Image, Palloc, Pte, Segment, Swapalloc. Remove PTE, Seg, Orig.
Add Stopped state and devproc ctl requests. In Proc: change seg to pointer list, add egrp, fgrp, newtlb, procctl. Add LSEG1, LSEG2. Foramt edits. rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | typedef struct Chan Chan; typedef struct Dev Dev; typedef struct Dirtab Dirtab; | |
| 1991/0705 | typedef struct Egrp Egrp; | |
| 1991/0428 | typedef struct Env Env; typedef struct Envp Envp; typedef struct Envval Envval; typedef struct Etherpkt Etherpkt; | |
| 1991/0705 | typedef struct Fgrp Fgrp; typedef struct Image Image; | |
| 1991/0607 | typedef struct IOQ IOQ; typedef struct KIOQ KIOQ; | |
| 1991/0428 | typedef struct List List; | |
| 1991/0614/sys/src/9/port/portdat.h:15,31 – 1991/0705/sys/src/9/port/portdat.h:18,34 | ||
| 1991/0428 | typedef struct Mount Mount; typedef struct Mtab Mtab; typedef struct Note Note; | |
| 1991/0705 | typedef struct Palloc Palloc; | |
| 1991/0428 | typedef struct Pgrp Pgrp; typedef struct Proc Proc; | |
| 1991/0705 | typedef struct Pte Pte; | |
| 1991/0428 | typedef struct Qinfo Qinfo; typedef struct QLock QLock; typedef struct Queue Queue; typedef struct Ref Ref; typedef struct Rendez Rendez; | |
| 1991/0705 | typedef struct Segment Segment; | |
| 1991/0428 | typedef struct Stream Stream; typedef int Devgen(Chan*, Dirtab*, int, int, Dir*); | |
| 1991/0614/sys/src/9/port/portdat.h:177,183 – 1991/0705/sys/src/9/port/portdat.h:180,186 | ||
| 1991/0428 | Lock; Envval *val; char name[NAMELEN]; | |
| 1991/0705 | Env *next; /* in chain of Envs for a egrp */ | |
| 1991/0428 | int pgref; /* # pgrps pointing here */ }; | |
| 1991/0614/sys/src/9/port/portdat.h:259,315 – 1991/0705/sys/src/9/port/portdat.h:262,407 | ||
| 1991/0428 | int flag; /* whether system posted it */ }; | |
| 1991/0607 |
| |
| 1991/0705 | /* Fields for cache control of pages */ #define PG_NOFLUSH 0 #define PG_TXTFLUSH 1 #define PG_DATFLUSH 2 /* Simulated modified and referenced bits */ #define PG_MOD 0x01 #define PG_REF 0x02 | |
| 1991/0428 |
| |
| 1991/0705 | struct Page | |
| 1991/0428 | { | |
| 1991/0705 | ulong pa; /* Physical address in memory */ ulong va; /* Virtual address for user */ ulong daddr; /* Disc address on swap */ ushort ref; /* Reference count */ char lock; /* Software lock */ char modref; /* Simulated modify/reference bits */ char cachectl[MAXMACH]; /* Cache flushing control for putmmu */ Image *image; /* Associated text or swap image */ Page *next; /* Lru free list */ Page *prev; Page *hash; /* Image hash chains */ }; struct Swapalloc { Lock; /* Free map lock */ int free; /* Number of currently free swap pages */ char *swmap; /* Base of swap map in memory */ char *alloc; /* Round robin allocator */ char *top; /* Top of swap map */ Rendez r; /* Pager kproc idle sleep */ }swapalloc; struct Image { Ref; Chan *c; /* Channel associated with running image */ Qid qid; /* Qid for page cache coherence checks */ | |
| 1991/0428 | Qid mqid; | |
| 1991/0607 |
| |
| 1991/0705 | Chan *mchan; ushort type; /* Device type of owning channel */ Segment *s; /* TEXT segment for image if running, may be null */ Image *hash; /* Qid hash chains */ Image *next; /* Free list */ | |
| 1991/0428 | }; | |
| 1991/0705 | struct Pte | |
| 1991/0428 | { | |
| 1991/0705 | union { Pte *next; /* Free list */ Page *pages[PTEPERTAB]; /* Page map for this chunk of pte */ }; | |
| 1991/0428 | }; | |
| 1991/0705 | /* Segment types */ #define SG_TYPE 007 /* Mask type of segment */ #define SG_TEXT 000 #define SG_DATA 001 #define SG_BSS 002 #define SG_STACK 003 #define SG_SHARED 004 #define SG_PHYSICAL 005 /* Segment flags */ #define SG_RONLY 040 /* Segment is read only */ #define HIGHWATER ((conf.npage*5)/100) #define MAXHEADROOM HIGHWATER*2 /* Silly but OK for debug */ #define PG_ONSWAP 1 #define pagedout(s) (((ulong)s)==0 || (((ulong)s)&PG_ONSWAP)) #define swapaddr(s) (((ulong)s)&~PG_ONSWAP) #define onswap(s) (((ulong)s)&PG_ONSWAP) #define SEGMAXSIZE (SEGMAPSIZE*PTEMAPMEM) struct Segment { Ref; QLock lk; ushort steal; /* Page stealer lock */ Segment *next; /* free list pointers */ ushort type; /* segment type */ ulong base; /* virtual base */ ulong top; /* virtual top */ ulong size; /* size in pages */ ulong fstart; /* start address in file for demand load */ ulong flen; /* length of segment in file */ Image *image; /* image in file system attached to this segment */ Page *(*pgalloc)(ulong addr);/* SG_PHYSICAL page allocator */ void (*pgfree)(Page *); /* SG_PHYSICAL page free */ Pte *map[SEGMAPSIZE]; /* segment pte map */ }; | |
| 1991/0428 | struct Pgrp { Ref; /* also used as a lock when mounting */ | |
| 1991/0705 | Pgrp *next; /* free list */ | |
| 1991/0428 | int index; /* index in pgrp table */ ulong pgrpid; char user[NAMELEN]; int nmtab; /* highest active mount table entry, +1 */ | |
| 1991/0705 | }; struct Egrp { Ref; Egrp *next; int nenv; /* highest active env table entry, +1 */ | |
| 1991/0428 | Envp *etab; }; | |
| 1991/0705 | #define NFD 100 struct Fgrp { Ref; Fgrp *next; Chan *fd[NFD]; int maxfd; /* highest fd in use */ }; #define PGHSIZE 512 struct Palloc { Lock; ulong addr; int active; Page *page; /* base of Page structures, indexed by phys page number */ ulong minppn; /* index of first usable page */ Page *head; /* most recently used */ Page *tail; /* least recently used */ ulong freecount; /* how many pages on free list now */ ulong user; /* how many user pages */ Page *hash[PGHSIZE]; Lock hashlock; Rendez r; /* Sleep for free mem */ QLock pwait; /* Queue of procs waiting for memory */ int wanted; /* Do the wakeup at free */ }; | |
| 1991/0514 | enum /* Argument to forkpgrp call */ { FPall = 0, /* Concession to back portablility */ | |
| 1991/0614/sys/src/9/port/portdat.h:324,342 – 1991/0705/sys/src/9/port/portdat.h:416,424 | ||
| 1991/0428 | */ | |
| 1991/0605 | enum { | |
| 1991/0705 | SSEG, TSEG, DSEG, BSEG, ESEG, LSEG, SEG1, SEG2, NSEG | |
| 1991/0605 | }; | |
| 1991/0428 |
| |
| 1991/0606 |
| |
| 1991/0428 |
| |
| 1991/0614/sys/src/9/port/portdat.h:354,362 – 1991/0705/sys/src/9/port/portdat.h:436,454 | ||
| 1991/0428 | Inwait, Wakeme, Broken, | |
| 1991/0705 | Stopped, | |
| 1991/0428 | }; /* | |
| 1991/0705 | * devproc requests */ enum { Proc_stopme = 1, Proc_exitme = 2, }; /* | |
| 1991/0428 | * Proc.time */ enum | |
| 1991/0614/sys/src/9/port/portdat.h:379,385 – 1991/0705/sys/src/9/port/portdat.h:471,477 | ||
| 1991/0428 | QLock *qlock; /* address of qlock being queued for DEBUG */ int state; Page *upage; /* BUG: should be unlinked from page list */ | |
| 1991/0705 | Segment *seg[NSEG]; | |
| 1991/0428 | ulong pid; int nchild; QLock wait; /* exiting children to be waited for */ | |
| 1991/0614/sys/src/9/port/portdat.h:386,392 – 1991/0705/sys/src/9/port/portdat.h:478,488 | ||
| 1991/0428 | Waitmsg waitmsg; /* this is large but must be addressable */ Proc *child; Proc *parent; | |
| 1991/0705 | Pgrp *pgrp; /* Process group for notes and namespace */ Egrp *egrp; /* Environment group */ Fgrp *fgrp; /* File descriptor group */ | |
| 1991/0428 | ulong parentpid; ulong time[6]; /* User, Sys, Real; child U, S, R */ short exiting; | |
| 1991/0614/sys/src/9/port/portdat.h:400,407 – 1991/0705/sys/src/9/port/portdat.h:496,504 | ||
| 1991/0428 | int kp; /* true if a kernel process */ | |
| 1991/0513 | Proc *palarm; /* Next alarm time */ ulong alarm; /* Time of call */ | |
| 1991/0614 |
| |
| 1991/0513 | ||
| 1991/0705 | int hasspin; /* I hold a spin lock */ int newtlb; /* Pager has touched my tables so I must flush */ int procctl; /* Control for /proc debugging */ | |
| 1991/0504 | /* | |
| 1991/0507 | * machine specific MMU goo | |
| 1991/0504 | */ | |
| 1991/0614/sys/src/9/port/portdat.h:408,421 – 1991/0705/sys/src/9/port/portdat.h:505,510 | ||
| 1991/0507 | PMMU; | |
| 1991/0428 | }; | |
| 1991/0614/sys/src/9/port/portdat.h:504,513 – 1991/0705/sys/src/9/port/portdat.h:593,604 | ||
| 1991/0428 | extern char user[NAMELEN]; extern char *errstrtab[]; extern char *statename[]; | |
| 1991/0705 | extern Palloc palloc; extern Image swapimage; | |
| 1991/0428 |
| |
| 1991/0705 | #define CHDIR 0x80000000L #define CHAPPEND 0x40000000L #define CHEXCL 0x20000000L | |
| 1991/0428 | ||