| plan 9 kernel history: overview | file list | diff list |
2000/1215/port/portdat.h (diff list | history)
| 1991/0428/sys/src/9/port/portdat.h:409,414 – 1991/0502/sys/src/9/port/portdat.h:409,415 (short | long) | ||
|
Add Stream.forcedelim.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | Queue *procq; /* write queue at process end */ Queue *devq; /* read queue at device end */ Block *err; /* error message from down stream */ | |
| 1991/0502 | int forcedelim; /* force a delimiter before the next message */ | |
| 1991/0428 | }; /* | |
| 1991/0502/sys/src/9/port/portdat.h:347,354 – 1991/0504/sys/src/9/port/portdat.h:347,358 (short | long) | ||
|
Change MMU goo to struct. Comment edit.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | int wokeup; /* whether sleep was interrupted */ ulong pc; /* DEBUG only */ int kp; /* true if a kernel process */ | |
| 1991/0504 | /* * MMU goo. which of the fillowing fields gets used depends on the * processor. */ struct { int pidonmach[MAXMACH]; | |
| 1991/0428 | MMU *mmu; int nmmuseg; /* number of segments active in mmu */ }; | |
| 1991/0504/sys/src/9/port/portdat.h:348,361 – 1991/0507/sys/src/9/port/portdat.h:348,356 (short | long) | ||
|
Change MMU goo to PMMU.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | ulong pc; /* DEBUG only */ int kp; /* true if a kernel process */ | |
| 1991/0504 | /* | |
| 1991/0507 | * machine specific MMU goo | |
| 1991/0504 | */ | |
| 1991/0428 |
| |
| 1991/0507 | PMMU; | |
| 1991/0428 | }; struct PTE | |
| 1991/0507/sys/src/9/port/portdat.h:1,4 – 1991/0513/sys/src/9/port/portdat.h:1,5 (short | long) | ||
|
Add Alarms. In Proc, add palarm, alarm.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | typedef struct Alarm Alarm; | |
| 1991/0513 | typedef struct Alarms Alarms; | |
| 1991/0428 | typedef struct Block Block; typedef struct Blist Blist; typedef struct Chan Chan; | |
| 1991/0507/sys/src/9/port/portdat.h:62,67 – 1991/0513/sys/src/9/port/portdat.h:63,74 | ||
| 1991/0428 | void *arg; }; | |
| 1991/0513 | struct Alarms { QLock; Proc *head; }; | |
| 1991/0428 | /* Block.flags */ #define S_DELIM 0x80 #define S_CLASS 0x07 | |
| 1991/0507/sys/src/9/port/portdat.h:347,352 – 1991/0513/sys/src/9/port/portdat.h:354,362 | ||
| 1991/0428 | int wokeup; /* whether sleep was interrupted */ ulong pc; /* DEBUG only */ int kp; /* true if a kernel process */ | |
| 1991/0513 | Proc *palarm; /* Next alarm time */ ulong alarm; /* Time of call */ | |
| 1991/0504 | /* | |
| 1991/0507 | * machine specific MMU goo | |
| 1991/0504 | */ | |
| 1991/0513/sys/src/9/port/portdat.h:273,278 – 1991/0514/sys/src/9/port/portdat.h:273,287 (short | long) | ||
|
Add FP states.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | Envp *etab; }; | |
| 1991/0514 | enum /* Argument to forkpgrp call */ { FPall = 0, /* Concession to back portablility */ FPnote = 1, FPnamespc = 2, FPenv = 4, FPclear = 8, }; | |
| 1991/0428 | /* * process memory segments */ | |
| 1991/0514/sys/src/9/port/portdat.h:283,295 – 1991/0605/sys/src/9/port/portdat.h:283,294 (short | long) | ||
|
Change segments to enum. Add LSEG, NSEG.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0514 | }; | |
| 1991/0428 | /* | |
| 1991/0605 | * process memory segments - NSEG always last ! | |
| 1991/0428 | */ | |
| 1991/0605 | enum { SSEG, TSEG, DSEG, BSEG, ESEG, LSEG, NSEG }; | |
| 1991/0428 | struct Seg { | |
| 1991/0605/sys/src/9/port/portdat.h:297,303 – 1991/0606/sys/src/9/port/portdat.h:297,304 (short | long) | ||
|
Add Seg.endseg. Remove Proc.bssend.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | ulong minva; /* va of 0th pte (not necessarily Seg->o->va) */ ulong maxva; /* va of last pte */ PTE *mod; /* list of modified pte's */ | |
| 1991/0606 | ulong endseg; /* segments end */ ulong pad[2]; /**/ | |
| 1991/0428 | }; /* | |
| 1991/0605/sys/src/9/port/portdat.h:343,349 – 1991/0606/sys/src/9/port/portdat.h:344,349 | ||
| 1991/0428 | int state; Page *upage; /* BUG: should be unlinked from page list */ Seg seg[NSEG]; | |
| 1991/0606/sys/src/9/port/portdat.h:9,14 – 1991/0607/sys/src/9/port/portdat.h:9,16 (short | long) | ||
|
Add IOQ, KIOQ, OISMEM, OSHARED. In Orig, add freepg, allocpg. Remove Seg.pad.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | typedef struct Envp Envp; typedef struct Envval Envval; typedef struct Etherpkt Etherpkt; | |
| 1991/0607 | typedef struct IOQ IOQ; typedef struct KIOQ KIOQ; | |
| 1991/0428 | typedef struct List List; typedef struct Mount Mount; typedef struct Mtab Mtab; | |
| 1991/0606/sys/src/9/port/portdat.h:199,204 – 1991/0607/sys/src/9/port/portdat.h:201,237 | ||
| 1991/0428 | #define ETHERMAXTU 1514 /* maximum transmit size */ #define ETHERHDRSIZE 14 /* size of an ethernet header */ | |
| 1991/0607 | /* * character based IO (mouse, keyboard, console screen) */ #define NQ 4096 struct IOQ { Lock; uchar buf[NQ]; uchar *in; uchar *out; int state; Rendez r; union{ void (*puts)(IOQ*, void*, int); /* output */ int (*putc)(IOQ*, int); /* input */ }; void *ptr; }; struct KIOQ { QLock; IOQ; int repeat; int c; int count; }; extern IOQ lineq; extern IOQ printq; extern IOQ mouseq; extern KIOQ kbdq; | |
| 1991/0428 | struct Mount { Ref; /* also used as a lock when playing lists */ | |
| 1991/0606/sys/src/9/port/portdat.h:229,234 – 1991/0607/sys/src/9/port/portdat.h:262,269 | ||
| 1991/0428 | #define OWRPERM 0x01 /* write permission */ #define OPURE 0x02 /* original data mustn't be written */ #define OCACHED 0x04 /* cached; don't discard on exit */ | |
| 1991/0607 | #define OISMEM 0x08 /* origin contains real memory */ #define OSHARED 0x10 /* origin does not copy on ref/wr */ | |
| 1991/0428 | struct Orig { | |
| 1991/0606/sys/src/9/port/portdat.h:247,252 – 1991/0607/sys/src/9/port/portdat.h:282,289 | ||
| 1991/0428 | Qid mqid; ulong minca; /* base of region in chan */ ulong maxca; /* end of region in chan */ | |
| 1991/0607 | void (*freepg)(Page*, int); /* how to free pages for this origin */ Page (*allocpg)(int, Orig*, ulong); | |
| 1991/0428 | }; struct Page | |
| 1991/0606/sys/src/9/port/portdat.h:298,304 – 1991/0607/sys/src/9/port/portdat.h:335,340 | ||
| 1991/0428 | ulong maxva; /* va of last pte */ PTE *mod; /* list of modified pte's */ | |
| 1991/0606 | ulong endseg; /* segments end */ | |
| 1991/0428 | }; /* | |
| 1991/0607/sys/src/9/port/portdat.h:400,405 – 1991/0614/sys/src/9/port/portdat.h:400,406 (short | long) | ||
|
Add Proc.hasspin. Add MAXSYSARG. (Note authfd!)
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | int kp; /* true if a kernel process */ | |
| 1991/0513 | Proc *palarm; /* Next alarm time */ ulong alarm; /* Time of call */ | |
| 1991/0614 | int hasspin; | |
| 1991/0513 | ||
| 1991/0504 | /* | |
| 1991/0507 | * machine specific MMU goo | |
| 1991/0607/sys/src/9/port/portdat.h:491,496 – 1991/0614/sys/src/9/port/portdat.h:492,498 | ||
| 1991/0428 | Streambhi= 32, /* block count high water mark */ }; | |
| 1991/0614 | #define MAXSYSARG 6 /* for mount(fd, mpt, flag, arg, srv, authfd) */ | |
| 1991/0428 | #define PRINTSIZE 256 #define NUMSIZE 12 /* size of formatted number */ | |
| 1991/0614/sys/src/9/port/portdat.h:5,14 – 1991/0705/sys/src/9/port/portdat.h:5,17 (short | long) | ||
|
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 | ||
| 1991/0705/sys/src/9/port/portdat.h:348,353 – 1991/0706/sys/src/9/port/portdat.h:348,354 (short | long) | ||
|
Add Segment.flushme.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0705 | ulong size; /* size in pages */ ulong fstart; /* start address in file for demand load */ ulong flen; /* length of segment in file */ | |
| 1991/0706 | int flushme; /* maintain consistent icache for this segment */ | |
| 1991/0705 | 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 */ | |
| 1991/0706/sys/src/9/port/portdat.h:63,69 – 1991/0724/sys/src/9/port/portdat.h:63,69 (short | long) | ||
|
Format edit, remove blank lines.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | List; Lock; int busy; | |
| 1991/0724 | long dt; /* may underflow in clock(); must be signed */ | |
| 1991/0428 | void (*f)(void*); void *arg; }; | |
| 1991/0706/sys/src/9/port/portdat.h:86,95 – 1991/0724/sys/src/9/port/portdat.h:86,95 | ||
| 1991/0428 | struct Block { Block *next; | |
| 1991/0724 | uchar *rptr; /* first unconsumed byte */ uchar *wptr; /* first empty byte */ uchar *lim; /* 1 past the end of the buffer */ uchar *base; /* start of the buffer */ | |
| 1991/0428 | uchar flags; uchar type; }; | |
| 1991/0706/sys/src/9/port/portdat.h:96,105 – 1991/0724/sys/src/9/port/portdat.h:96,105 | ||
| 1991/0428 | struct Blist { Lock; | |
| 1991/0724 | Block *first; /* first data block */ Block *last; /* last data block */ long len; /* length of list in bytes */ int nb; /* number of blocks in list */ | |
| 1991/0428 | }; /* | |
| 1991/0706/sys/src/9/port/portdat.h:107,127 – 1991/0724/sys/src/9/port/portdat.h:107,127 | ||
| 1991/0428 | */ enum { | |
| 1991/0724 | Aaccess, /* as in access, stat */ Atodir, /* as in chdir */ Aopen, /* for i/o */ Amount, /* to be mounted upon */ Acreate, /* file is to be created */ | |
| 1991/0428 | }; /* * Chan.flags */ | |
| 1991/0724 | #define COPEN 1 /* for i/o */ #define CMOUNT 2 /* is result of a mount/bind */ #define CCREATE 4 /* permits creation if CMOUNT */ #define CCEXEC 8 /* close on exec */ #define CFREE 16 /* not in use */ | |
| 1991/0428 | struct Chan { | |
| 1991/0706/sys/src/9/port/portdat.h:200,208 – 1991/0724/sys/src/9/port/portdat.h:200,208 | ||
| 1991/0428 | uchar data[1500]; uchar crc[4]; }; | |
| 1991/0724 | #define ETHERMINTU 60 /* minimum transmit size */ #define ETHERMAXTU 1514 /* maximum transmit size */ #define ETHERHDRSIZE 14 /* size of an ethernet header */ | |
| 1991/0428 | ||
| 1991/0607 | /* * character based IO (mouse, keyboard, console screen) | |
| 1991/0706/sys/src/9/port/portdat.h:287,298 – 1991/0724/sys/src/9/port/portdat.h:287,298 | ||
| 1991/0705 | struct Swapalloc { | |
| 1991/0724 | 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 */ | |
| 1991/0705 | }swapalloc; struct Image | |
| 1991/0706/sys/src/9/port/portdat.h:390,406 – 1991/0724/sys/src/9/port/portdat.h:390,406 | ||
| 1991/0705 | Lock; ulong addr; int active; | |
| 1991/0724 | Page *page; /* base of Page structures */ 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 */ | |
| 1991/0705 | Page *hash[PGHSIZE]; Lock hashlock; | |
| 1991/0724 | Rendez r; /* Sleep for free mem */ QLock pwait; /* Queue of procs waiting for memory */ int wanted; /* Do the wakeup at free */ | |
| 1991/0705 | }; | |
| 1991/0514 | enum /* Argument to forkpgrp call */ | |
| 1991/0706/sys/src/9/port/portdat.h:523,559 – 1991/0724/sys/src/9/port/portdat.h:523,559 | ||
| 1991/0428 | /* * Queue.flag */ | |
| 1991/0724 | #define QHUNGUP 0x1 /* flag bit meaning the stream has been hung up */ | |
| 1991/0428 | #define QINUSE 0x2 | |
| 1991/0724 | #define QHIWAT 0x4 /* queue has gone past the high water mark */ | |
| 1991/0428 | #define QDEBUG 0x8 struct Queue { Blist; int flag; | |
| 1991/0724 | Qinfo *info; /* line discipline definition */ Queue *other; /* opposite direction, same line discipline */ Queue *next; /* next queue in the stream */ | |
| 1991/0428 | void (*put)(Queue*, Block*); | |
| 1991/0724 | QLock rlock; /* mutex for processes sleeping at r */ Rendez r; /* standard place to wait for flow control */ Rendez *rp; /* where flow control wakeups go to */ void *ptr; /* private info for the queue */ | |
| 1991/0428 | }; struct Stream { | |
| 1991/0502 |
| |
| 1991/0724 | QLock; /* structure lock */ short inuse; /* number of processes in stream */ short opens; /* number of processes with stream open */ ushort hread; /* number of reads after hangup */ ushort type; /* correlation with Chan */ ushort dev; /* ... */ ushort id; /* ... */ QLock rdlock; /* read lock */ Queue *procq; /* write queue at process end */ Queue *devq; /* read queue at device end */ Block *err; /* error message from down stream */ int forcedelim; /* force a delimiter before the next message */ | |
| 1991/0428 | }; /* | |
| 1991/0706/sys/src/9/port/portdat.h:578,590 – 1991/0724/sys/src/9/port/portdat.h:578,590 | ||
| 1991/0428 | Sdataqid = Shighqid, Sctlqid = Sdataqid-1, Slowqid = Sctlqid, | |
| 1991/0724 | Streamhi= (9*1024), /* byte count high water mark */ Streambhi= 32, /* block count high water mark */ | |
| 1991/0428 | }; | |
| 1991/0614 |
| |
| 1991/0724 | #define MAXSYSARG 6 /* for mount(fd, mpt, flag, arg, srv, authfd) */ | |
| 1991/0428 | #define PRINTSIZE 256 | |
| 1991/0724 | #define NUMSIZE 12 /* size of formatted number */ | |
| 1991/0428 | extern FPsave initfp; extern Conf conf; | |
| 1991/0706/sys/src/9/port/portdat.h:600,605 – 1991/0724/sys/src/9/port/portdat.h:600,602 | ||
| 1991/0705 | #define CHDIR 0x80000000L #define CHAPPEND 0x40000000L #define CHEXCL 0x20000000L | |
| 1991/0428 | ||
| 1991/0724/sys/src/9/port/portdat.h:70,76 – 1991/0727/sys/src/9/port/portdat.h:70,76 (short | long) | ||
|
Change Alarms QLock to Lock. In Proc: add notepending, remove wokeup.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | ||
| 1991/0513 | struct Alarms { | |
| 1991/0727 | Lock; | |
| 1991/0513 | Proc *head; }; | |
| 1991/0724/sys/src/9/port/portdat.h:492,498 – 1991/0727/sys/src/9/port/portdat.h:492,498 | ||
| 1991/0428 | Lock debug; /* to access debugging elements of User */ Rendez *r; /* rendezvous point slept on */ Rendez sleep; /* place for tsleep and syssleep */ | |
| 1991/0727 | int notepending; /* note issued but not acted on */ | |
| 1991/0428 | ulong pc; /* DEBUG only */ int kp; /* true if a kernel process */ | |
| 1991/0513 | Proc *palarm; /* Next alarm time */ | |
| 1991/0727/sys/src/9/port/portdat.h:582,588 – 1991/0731/sys/src/9/port/portdat.h:582,588 (short | long) | ||
|
Comment edit.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0724 | Streambhi= 32, /* block count high water mark */ | |
| 1991/0428 | }; | |
| 1991/0724 |
| |
| 1991/0731 | #define MAXSYSARG 6 /* for mount(fd, mpt, flag, arg, srv) */ | |
| 1991/0428 | #define PRINTSIZE 256 | |
| 1991/0724 | #define NUMSIZE 12 /* size of formatted number */ | |
| 1991/0428 | ||
| 1991/0731/sys/src/9/port/portdat.h:388,397 – 1991/0802/sys/src/9/port/portdat.h:388,396 (short | long) | ||
|
In Palloc: replace addr with addr0, addr1 (for gnot?). Remove page, minppn.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0705 | struct Palloc { Lock; | |
| 1991/0802 | ulong addr0; /* next available ialloc addr in bank 0 */ ulong addr1; /* next available ialloc addr in bank 1 */ | |
| 1991/0705 | int active; | |
| 1991/0724 |
| |
| 1991/0802/sys/src/9/port/portdat.h:355,360 – 1991/0806/sys/src/9/port/portdat.h:355,363 (short | long) | ||
|
Add rendezvous hash table to Pgrp, Rendezvous state, rendezvous info in Proc.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0705 | Pte *map[SEGMAPSIZE]; /* segment pte map */ }; | |
| 1991/0806 | #define RENDHASH 32 #define REND(p,s) ((p)->rendhash[(s)%RENDHASH]) | |
| 1991/0428 | struct Pgrp { Ref; /* also used as a lock when mounting */ | |
| 1991/0802/sys/src/9/port/portdat.h:365,370 – 1991/0806/sys/src/9/port/portdat.h:368,374 | ||
| 1991/0428 | int nmtab; /* highest active mount table entry, +1 */ QLock debug; /* single access via devproc.c */ Mtab *mtab; | |
| 1991/0806 | Proc *rendhash[RENDHASH]; /* Rendezvous tag hash */ | |
| 1991/0705 | }; struct Egrp | |
| 1991/0802/sys/src/9/port/portdat.h:437,442 – 1991/0806/sys/src/9/port/portdat.h:441,447 | ||
| 1991/0428 | Wakeme, Broken, | |
| 1991/0705 | Stopped, | |
| 1991/0806 | Rendezvous, | |
| 1991/0428 | }; /* | |
| 1991/0802/sys/src/9/port/portdat.h:499,504 – 1991/0806/sys/src/9/port/portdat.h:504,513 | ||
| 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/0806 | ulong rendtag; /* Tag for rendezvous */ ulong rendval; /* Value for rendezvous */ Proc *rendhash; /* Hash list for tag values */ | |
| 1991/0504 | /* | |
| 1991/0507 | * machine specific MMU goo | |
| 1991/0504 | */ | |
| 1991/0806/sys/src/9/port/portdat.h:415,420 – 1991/0807/sys/src/9/port/portdat.h:415,427 (short | long) | ||
|
Add Forkpg, Forkeg, Forkfd.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0514 | FPclear = 8, }; | |
| 1991/0807 | enum { Forkpg = 1, Forkeg = 2, Forkfd = 4, }; | |
| 1991/0428 | /* | |
| 1991/0605 | * process memory segments - NSEG always last ! | |
| 1991/0428 | */ | |
| 1991/0807/sys/src/9/port/portdat.h:569,574 – 1991/0809/sys/src/9/port/portdat.h:569,575 (short | long) | ||
|
Add Stream.flushmsg.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0724 | Queue *devq; /* read queue at device end */ Block *err; /* error message from down stream */ int forcedelim; /* force a delimiter before the next message */ | |
| 1991/0809 | int flushmsg; /* flush up till the next delimiter */ | |
| 1991/0428 | }; /* | |
| 1991/0809/sys/src/9/port/portdat.h:220,225 – 1991/0810/sys/src/9/port/portdat.h:220,229 (short | long) | ||
|
Add IOQ.gets, IOQ.getc.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0607 | void (*puts)(IOQ*, void*, int); /* output */ int (*putc)(IOQ*, int); /* input */ }; | |
| 1991/0810 | union{ int (*gets)(IOQ*, void*, int); /* input */ int (*getc)(IOQ*); /* output */ }; | |
| 1991/0607 | void *ptr; }; struct KIOQ | |
| 1991/0810/sys/src/9/port/portdat.h:485,490 – 1991/0830/sys/src/9/port/portdat.h:485,491 (short | long) | ||
|
Add Proc.qlockpc.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | Proc *rnext; /* next process in run queue */ Proc *qnext; /* next process on queue for a QLock */ QLock *qlock; /* address of qlock being queued for DEBUG */ | |
| 1991/0830 | ulong qlockpc; /* pc of last call to qlock */ | |
| 1991/0428 | int state; Page *upage; /* BUG: should be unlinked from page list */ | |
| 1991/0705 | Segment *seg[NSEG]; | |
| 1991/0830/sys/src/9/port/portdat.h:30,35 – 1991/0926/sys/src/9/port/portdat.h:30,36 (short | long) | ||
|
Add Waitq and use in Proc. Remove unused process states, Proc.exiting, Stream.forcedelim. rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | typedef struct Rendez Rendez; | |
| 1991/0705 | typedef struct Segment Segment; | |
| 1991/0428 | typedef struct Stream Stream; | |
| 1991/0926 | typedef struct Waitq Waitq; | |
| 1991/0428 | typedef int Devgen(Chan*, Dirtab*, int, int, Dir*); | |
| 1991/0830/sys/src/9/port/portdat.h:410,415 – 1991/0926/sys/src/9/port/portdat.h:411,422 | ||
| 1991/0724 | int wanted; /* Do the wakeup at free */ | |
| 1991/0705 | }; | |
| 1991/0926 | struct Waitq { Waitmsg w; Waitq *next; }; | |
| 1991/0514 | enum /* Argument to forkpgrp call */ { FPall = 0, /* Concession to back portablility */ | |
| 1991/0830/sys/src/9/port/portdat.h:441,454 – 1991/0926/sys/src/9/port/portdat.h:448,457 | ||
| 1991/0428 | { Dead = 0, Moribund, | |
| 1991/0705 | Stopped, | |
| 1991/0830/sys/src/9/port/portdat.h:487,499 – 1991/0926/sys/src/9/port/portdat.h:490,505 | ||
| 1991/0428 | QLock *qlock; /* address of qlock being queued for DEBUG */ | |
| 1991/0830 | ulong qlockpc; /* pc of last call to qlock */ | |
| 1991/0428 | int state; | |
| 1991/0926 | char *psstate; /* What /proc/???/status reports */ | |
| 1991/0428 | Page *upage; /* BUG: should be unlinked from page list */ | |
| 1991/0705 | Segment *seg[NSEG]; | |
| 1991/0428 | ulong pid; | |
| 1991/0926 | Lock exl; /* Lock count and waitq */ Waitq *waitq; /* Exited processes wait children */ int nchild; /* Number of living children */ int nwait; /* Number of uncollected wait records */ Rendez waitr; /* Place to hang out in wait */ | |
| 1991/0428 | Proc *parent; | |
| 1991/0705 | Pgrp *pgrp; /* Process group for notes and namespace */ | |
| 1991/0830/sys/src/9/port/portdat.h:502,508 – 1991/0926/sys/src/9/port/portdat.h:508,513 | ||
| 1991/0705 | ||
| 1991/0428 | ulong parentpid; ulong time[6]; /* User, Sys, Real; child U, S, R */ | |
| 1991/0830/sys/src/9/port/portdat.h:573,579 – 1991/0926/sys/src/9/port/portdat.h:578,583 | ||
| 1991/0724 | Queue *procq; /* write queue at process end */ Queue *devq; /* read queue at device end */ Block *err; /* error message from down stream */ | |
| 1991/0809 | int flushmsg; /* flush up till the next delimiter */ | |
| 1991/0428 | }; | |
| 1991/0926/sys/src/9/port/portdat.h:53,62 – 1991/1002/sys/src/9/port/portdat.h:53,62 (short | long) | ||
|
In QLock: add locked, remove queue.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | struct QLock { | |
| 1991/1002 | Lock use; /* to use object */ | |
| 1991/0428 | Proc *head; /* next process waiting for object */ Proc *tail; /* last process waiting for object */ | |
| 1991/1002 | int locked; /* flag */ | |
| 1991/0428 | }; struct Alarm | |
| 1991/1002/sys/src/9/port/portdat.h:16,22 – 1991/1011/sys/src/9/port/portdat.h:16,22 (short | long) | ||
|
Rename Mtab to Mhead. Add Proc.mnthash, RWlock. Rename CMOUNT to CMSG. Comment edit. In Mount: remove Ref, term, rename c to to, add head. In Mhead: rename c to from, mnt to mount, add hash. Add MNTHASH, Proc.ns, Proc.mnthash. rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0607 | typedef struct KIOQ KIOQ; | |
| 1991/0428 | typedef struct List List; typedef struct Mount Mount; | |
| 1991/1011 | typedef struct Mhead Mhead; | |
| 1991/0428 | typedef struct Note Note; typedef struct Page Page; | |
| 1991/0705 | typedef struct Palloc Palloc; | |
| 1991/1002/sys/src/9/port/portdat.h:28,33 – 1991/1011/sys/src/9/port/portdat.h:28,34 | ||
| 1991/0428 | typedef struct Queue Queue; typedef struct Ref Ref; typedef struct Rendez Rendez; | |
| 1991/1011 | typedef struct RWlock RWlock; | |
| 1991/0705 | typedef struct Segment Segment; | |
| 1991/0428 | typedef struct Stream Stream; | |
| 1991/0926 | typedef struct Waitq Waitq; | |
| 1991/1002/sys/src/9/port/portdat.h:59,64 – 1991/1011/sys/src/9/port/portdat.h:60,73 | ||
| 1991/1002 | int locked; /* flag */ | |
| 1991/0428 | }; | |
| 1991/1011 | struct RWlock { Lock; /* Lock modify lock */ QLock x; /* Mutual exclusion lock */ QLock k; /* Lock for waiting writers held for readers */ int readers; /* Count of readers in lock */ }; | |
| 1991/0428 | struct Alarm { List; | |
| 1991/1002/sys/src/9/port/portdat.h:119,126 – 1991/1011/sys/src/9/port/portdat.h:128,135 | ||
| 1991/0428 | * Chan.flags */ | |
| 1991/0724 | #define COPEN 1 /* for i/o */ | |
| 1991/1011 | #define CMSG 2 /* is the message channel for a mount */ #define CCREATE 4 /* permits creation if c->mnt */ | |
| 1991/0724 | #define CCEXEC 8 /* close on exec */ #define CFREE 16 /* not in use */ | |
| 1991/0428 | ||
| 1991/1002/sys/src/9/port/portdat.h:242,258 – 1991/1011/sys/src/9/port/portdat.h:251,267 | ||
| 1991/0607 | ||
| 1991/0428 | struct Mount { | |
| 1991/1011 | Mhead *head; Chan *to; /* channel replacing underlying channel */ | |
| 1991/0428 | }; | |
| 1991/1011 | struct Mhead | |
| 1991/0428 | { | |
| 1991/1011 | Chan *from; /* channel mounted upon */ Mount *mount; /* what's mounted upon it */ Mhead *hash; /* Hash chain */ | |
| 1991/0428 | }; enum{ | |
| 1991/1002/sys/src/9/port/portdat.h:362,367 – 1991/1011/sys/src/9/port/portdat.h:371,378 | ||
| 1991/0705 | ||
| 1991/0806 | #define RENDHASH 32 #define REND(p,s) ((p)->rendhash[(s)%RENDHASH]) | |
| 1991/1011 | #define MNTHASH 32 #define MOUNTH(p,s) ((p)->mnthash[(s)->qid.path%MNTHASH]) | |
| 1991/0806 | ||
| 1991/0428 | struct Pgrp { | |
| 1991/1002/sys/src/9/port/portdat.h:370,378 – 1991/1011/sys/src/9/port/portdat.h:381,389 | ||
| 1991/0428 | int index; /* index in pgrp table */ ulong pgrpid; char user[NAMELEN]; | |
| 1991/1011 | RWlock ns; /* Namespace many read/one write lock */ Mhead *mnthash[MNTHASH]; | |
| 1991/0806 | Proc *rendhash[RENDHASH]; /* Rendezvous tag hash */ | |
| 1991/0705 | }; | |
| 1991/1011/sys/src/9/port/portdat.h:7,13 – 1991/1018/sys/src/9/port/portdat.h:7,12 (short | long) | ||
|
Remove Envp. Simplify Env. Add QLock Egrp.ev for all of etab. (Bug fix? proper locking)
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | typedef struct Dirtab Dirtab; | |
| 1991/0705 | typedef struct Egrp Egrp; | |
| 1991/0428 | typedef struct Env Env; | |
| 1991/0705 | typedef struct Fgrp Fgrp; | |
| 1991/1011/sys/src/9/port/portdat.h:187,205 – 1991/1018/sys/src/9/port/portdat.h:186,195 | ||
| 1991/0428 | struct Env { | |
| 1991/1018 | Envval *name; | |
| 1991/0428 | Envval *val; | |
| 1991/0705 |
| |
| 1991/0428 |
| |
| 1991/1011/sys/src/9/port/portdat.h:392,398 – 1991/1018/sys/src/9/port/portdat.h:382,389 | ||
| 1991/0705 | Ref; Egrp *next; int nenv; /* highest active env table entry, +1 */ | |
| 1991/0428 |
| |
| 1991/1018 | QLock ev; /* for all of etab */ Env *etab; | |
| 1991/0428 | }; | |
| 1991/0705 | #define NFD 100 | |
| 1991/1018/sys/src/9/port/portdat.h:95,100 – 1991/10302/sys/src/9/port/portdat.h:95,101 (short | long) | ||
|
Add Block.list.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1991/0428 | struct Block { Block *next; | |
| 1991/10302 | Block *list; /* chain of block lists */ | |
| 1991/0724 | uchar *rptr; /* first unconsumed byte */ uchar *wptr; /* first empty byte */ uchar *lim; /* 1 past the end of the buffer */ | |
| Too many diffs (26 > 25). Stopping. | ||