Plan 9 from Bell Labs’s /usr/web/sources/extra/9hist/port/portdat.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


## diffname port/portdat.h 1991/0428
## diff -e /dev/null /n/bootesdump/1991/0428/sys/src/9/port/portdat.h
0a
typedef struct Alarm	Alarm;
typedef struct Block	Block;
typedef struct Blist	Blist;
typedef struct Chan	Chan;
typedef struct Dev	Dev;
typedef struct Dirtab	Dirtab;
typedef struct Env	Env;
typedef struct Envp	Envp;
typedef struct Envval	Envval;
typedef struct Etherpkt	Etherpkt;
typedef struct List	List;
typedef struct Mount	Mount;
typedef struct Mtab	Mtab;
typedef struct Note	Note;
typedef struct Orig	Orig;
typedef struct PTE	PTE;
typedef struct Page	Page;
typedef struct Pgrp	Pgrp;
typedef struct Proc	Proc;
typedef struct Qinfo	Qinfo;
typedef struct QLock	QLock;
typedef struct Queue	Queue;
typedef struct Ref	Ref;
typedef struct Rendez	Rendez;
typedef struct Seg	Seg;
typedef struct Stream	Stream;

typedef int Devgen(Chan*, Dirtab*, int, int, Dir*);

struct List
{
	void	*next;
};

struct Ref
{
	Lock;
	int	ref;
};

struct Rendez
{
	Lock;
	Proc	*p;
};

struct QLock
{
	Proc	*head;			/* next process waiting for object */
	Proc	*tail;			/* last process waiting for object */
	Lock	use;			/* to use object */
	Lock	queue;			/* to access list */
};

struct Alarm
{
	List;
	Lock;
	int	busy;
	long	dt;		/* may underflow in clock(); must be signed */
	void	(*f)(void*);
	void	*arg;
};

/* Block.flags */
#define S_DELIM 0x80
#define S_CLASS 0x07

/* Block.type */
#define M_DATA 0
#define M_CTL 1
#define M_HANGUP 2

struct Block
{
	Block	*next;
	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 */
	uchar	flags;
	uchar	type;
};

struct Blist {
	Lock;
	Block	*first;		/* first data block */
	Block	*last;		/* last data block */
	long	len;		/* length of list in bytes */
	int	nb;		/* number of blocks in list */
};

/*
 * Access types in namec
 */
enum
{
	Aaccess,	/* as in access, stat */
	Atodir,		/* as in chdir */
	Aopen,		/* for i/o */
	Amount,		/* to be mounted upon */
	Acreate,	/* file is to be created */
};

/*
 *  Chan.flags
 */
#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 */

struct Chan
{
	QLock	rdl;			/* read access */
	QLock	wrl;			/* write access */
	Ref;
	union{
		Chan	*next;		/* allocation */
		ulong	offset;		/* in file */
	};
	ushort	type;
	ushort	dev;
	ushort	mode;			/* read/write */
	ushort	flag;
	Qid	qid;
	Mount	*mnt;			/* mount point that derived Chan */
	ulong	mountid;
	int	fid;			/* for devmnt */
	union {
		Stream	*stream;	/* for stream channels */
		void	*aux;
		Qid	pgrpid;		/* for #p/notepg */
		int	mntindex;	/* for devmnt */
	};
	Chan	*mchan;			/* channel to mounted server */
	Qid	mqid;			/* qid of root of mount point */
};

struct Dev
{
	void	 (*reset)(void);
	void	 (*init)(void);
	Chan	*(*attach)(char*);
	Chan	*(*clone)(Chan*, Chan*);
	int	 (*walk)(Chan*, char*);
	void	 (*stat)(Chan*, char*);
	Chan	*(*open)(Chan*, int);
	void	 (*create)(Chan*, char*, int, ulong);
	void	 (*close)(Chan*);
	long	 (*read)(Chan*, void*, long, ulong);
	long	 (*write)(Chan*, void*, long, ulong);
	void	 (*remove)(Chan*);
	void	 (*wstat)(Chan*, char*);
};

struct Dirtab
{
	char	name[NAMELEN];
	Qid	qid;
	long	length;
	long	perm;
};

struct Env
{
	Lock;
	Envval	*val;
	char	name[NAMELEN];
	Env	*next;			/* in chain of Envs for a pgrp */
	int	pgref;			/* # pgrps pointing here */
};

struct Envp
{
	Env	*env;
	int	chref;			/* # chans from pgrp pointing here */
};

/*
 *  Ethernet packet buffers.
 */
struct Etherpkt {
	uchar d[6];
	uchar s[6];
	uchar type[2];
	uchar data[1500];
	uchar crc[4];
};
#define	ETHERMINTU	60	/* minimum transmit size */
#define	ETHERMAXTU	1514	/* maximum transmit size */
#define ETHERHDRSIZE	14	/* size of an ethernet header */

struct Mount
{
	Ref;				/* also used as a lock when playing lists */
	short	term;			/* terminates list */
	ulong	mountid;
	Mount	*next;
	Chan	*c;			/* channel replacing underlying channel */
};

struct Mtab
{
	Chan	*c;			/* channel mounted upon */
	Mount	*mnt;			/* what's mounted upon it */
};

enum{
	NUser,				/* note provided externally */
	NExit,				/* process should exit */
	NDebug,				/* process should hang */
};

struct Note
{
	char	msg[ERRLEN];
	int	flag;			/* whether system posted it */
};

#define	OWRPERM	0x01	/* write permission */
#define	OPURE	0x02	/* original data mustn't be written */
#define	OCACHED	0x04	/* cached; don't discard on exit */

struct Orig
{
	Lock;
	Orig	*next;			/* for allocation */
	ushort	nproc;			/* processes using it */
	ushort	npage;			/* sum of refs of pages in it */
	ushort	flag;
	ulong	va;			/* va of 0th pte */
	ulong	npte;			/* #pte's in list */
	PTE	*pte;
	Chan	*chan;			/* channel deriving segment (if open) */
	ushort	type;			/* of channel (which could be non-open) */
	Qid	qid;
	Chan	*mchan;
	Qid	mqid;
	ulong	minca;			/* base of region in chan */
	ulong	maxca;			/* end of region in chan */
};

struct Page
{
	Orig	*o;			/* origin of segment owning page */
	ulong	va;			/* virtual address */
	ulong	pa;			/* physical address */
	ushort	ref;
	Page	*next;
	Page	*prev;
};

struct Pgrp
{
	Ref;				/* also used as a lock when mounting */
	Pgrp	*next;
	int	index;			/* index in pgrp table */
	ulong	pgrpid;
	char	user[NAMELEN];
	int	nmtab;			/* highest active mount table entry, +1 */
	int	nenv;			/* highest active env table entry, +1 */
	QLock	debug;			/* single access via devproc.c */
	Mtab	*mtab;
	Envp	*etab;
};

/*
 *  process memory segments
 */
#define	SSEG	0
#define	TSEG	1
#define	DSEG	2
#define	BSEG	3
#define	ESEG	4	/* used by exec to build new stack */

struct Seg
{
	Proc	*proc;			/* process owning this segment */
	Orig	*o;			/* root list of pte's */
	ulong	minva;			/* va of 0th pte (not necessarily Seg->o->va) */
	ulong	maxva;			/* va of last pte */
	PTE	*mod;			/* list of modified pte's */
	ulong	pad[3]; /**/
};

/*
 * Process states
 */
enum
{
	Dead = 0,
	Moribund,
	Zombie,
	Ready,
	Scheding,
	Running,
	Queueing,
	MMUing,
	Exiting,
	Inwait,
	Wakeme,
	Broken,
};

/*
 * Proc.time
 */
enum
{
	TUser,
	TSys,
	TReal,
	TCUser,
	TCSys,
	TCReal,
};

struct Proc
{
	Label	sched;
	Mach	*mach;			/* machine running this proc */
	char	text[NAMELEN];
	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 */
	int	state;
	Page	*upage;			/* BUG: should be unlinked from page list */
	Seg	seg[NSEG];
	ulong	bssend;			/* initial top of bss seg */
	ulong	pid;
	int	nchild;
	QLock	wait;			/* exiting children to be waited for */
	Waitmsg	waitmsg;		/* this is large but must be addressable */
	Proc	*child;
	Proc	*parent;
	Pgrp	*pgrp;
	ulong	parentpid;
	ulong	time[6];		/* User, Sys, Real; child U, S, R */
	short	exiting;
	short	insyscall;
	int	fpstate;
	Lock	debug;			/* to access debugging elements of User */
	Rendez	*r;			/* rendezvous point slept on */
	Rendez	sleep;			/* place for tsleep and syssleep */
	int	wokeup;			/* whether sleep was interrupted */
	ulong	pc;			/* DEBUG only */
	int	kp;			/* true if a kernel process */
	union {
		int	pidonmach[MAXMACH];	/* !!Compatability with mips!! */
		MMU	*mmu;
		int	nmmuseg;		/* number of segments active in mmu */
	};
};

struct PTE
{
	Proc	*proc;			/* process owning this PTE (0 in Orig) */
	PTE	*nextmod;		/* next at this va */
	PTE	*nextva;		/* next in this proc at higher va */
	Page	*page;
};

/*
 *  operations available to a queue
 */
struct Qinfo
{
	void (*iput)(Queue*, Block*);	/* input routine */
	void (*oput)(Queue*, Block*);	/* output routine */
	void (*open)(Queue*, Stream*);
	void (*close)(Queue*);
	char *name;
	void (*reset)(void);		/* initialization */
	Qinfo *next;
};

/*
 *  Queue.flag
 */
#define QHUNGUP	0x1	/* flag bit meaning the stream has been hung up */
#define QINUSE	0x2
#define QHIWAT	0x4	/* queue has gone past the high water mark */	
#define QDEBUG	0x8

struct Queue {
	Blist;
	int	flag;
	Qinfo	*info;		/* line discipline definition */
	Queue	*other;		/* opposite direction, same line discipline */
	Queue	*next;		/* next queue in the stream */
	void	(*put)(Queue*, Block*);
	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 */
};

struct Stream {
	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 */
};

/*
 *  useful stream macros
 */
#define	RD(q)		((q)->other < (q) ? (q->other) : q)
#define	WR(q)		((q)->other > (q) ? (q->other) : q)
#define GLOBAL(a)	(((ulong)(a)) & 0x80000000)
#define STREAMTYPE(x)	((x)&0x1f)
#define STREAMID(x)	(((x)&~CHDIR)>>5)
#define STREAMQID(i,t)	(((i)<<5)|(t))
#define PUTNEXT(q,b)	(*(q)->next->put)((q)->next, b)
#define BLEN(b)		((b)->wptr - (b)->rptr)
#define QFULL(q)	((q)->flag & QHIWAT)
#define FLOWCTL(q)	{ if(QFULL(q->next)) flowctl(q); }

/*
 *  stream file qid's & high water mark
 */
enum {
	Shighqid = STREAMQID(1,0) - 1,
	Sdataqid = Shighqid,
	Sctlqid = Sdataqid-1,
	Slowqid = Sctlqid,
	Streamhi= (9*1024),	/* byte count high water mark */
	Streambhi= 32,		/* block count high water mark */
};

#define	PRINTSIZE	256
#define	NUMSIZE	12		/* size of formatted number */

extern	FPsave	initfp;
extern	Conf	conf;
extern	ulong	initcode[];
extern	Dev	devtab[];
extern	char	devchar[];
extern	char	user[NAMELEN];
extern	char	*errstrtab[];
extern	char	*statename[];

#define	CHDIR	0x80000000L
#define	CHAPPEND 0x40000000L
#define	CHEXCL	0x20000000L



.
## diffname port/portdat.h 1991/0502
## diff -e /n/bootesdump/1991/0428/sys/src/9/port/portdat.h /n/bootesdump/1991/0502/sys/src/9/port/portdat.h
411a
	int	forcedelim;	/* force a delimiter before the next message */
.
## diffname port/portdat.h 1991/0504
## diff -e /n/bootesdump/1991/0502/sys/src/9/port/portdat.h /n/bootesdump/1991/0504/sys/src/9/port/portdat.h
350,351c
	/*
	 *  MMU goo.  which of the fillowing fields gets used depends on the
	 *  processor.
	 */
	struct {
		int	pidonmach[MAXMACH];
.
## diffname port/portdat.h 1991/0507
## diff -e /n/bootesdump/1991/0504/sys/src/9/port/portdat.h /n/bootesdump/1991/0507/sys/src/9/port/portdat.h
354,358c
	PMMU;
.
351,352c
	 *  machine specific MMU goo
.
## diffname port/portdat.h 1991/0513
## diff -e /n/bootesdump/1991/0507/sys/src/9/port/portdat.h /n/bootesdump/1991/0513/sys/src/9/port/portdat.h
349a
	Proc	*palarm;		/* Next alarm time */
	ulong	alarm;			/* Time of call */

.
64a
struct Alarms
{
	QLock;
	Proc	*head;
};

.
1a
typedef struct Alarms	Alarms;
.
## diffname port/portdat.h 1991/0514
## diff -e /n/bootesdump/1991/0513/sys/src/9/port/portdat.h /n/bootesdump/1991/0514/sys/src/9/port/portdat.h
275a
enum					/* Argument to forkpgrp call */
{
	FPall 	  = 0,			/* Concession to back portablility */
	FPnote 	  = 1,
	FPnamespc = 2,
	FPenv	  = 4,
	FPclear	  = 8,
};

.
## diffname port/portdat.h 1991/0605
## diff -e /n/bootesdump/1991/0514/sys/src/9/port/portdat.h /n/bootesdump/1991/0605/sys/src/9/port/portdat.h
288,292c
enum
{
	SSEG, TSEG, DSEG, BSEG, ESEG, LSEG, NSEG
};
.
286c
 *  process memory segments - NSEG always last !
.
## diffname port/portdat.h 1991/0606
## diff -e /n/bootesdump/1991/0605/sys/src/9/port/portdat.h /n/bootesdump/1991/0606/sys/src/9/port/portdat.h
346d
300c
	ulong	endseg;			/* segments end */
	ulong	pad[2]; /**/
.
## diffname port/portdat.h 1991/0607
## diff -e /n/bootesdump/1991/0606/sys/src/9/port/portdat.h /n/bootesdump/1991/0607/sys/src/9/port/portdat.h
301d
249a
	void	(*freepg)(Page*, int);	/* how to free pages for this origin */
	Page	(*allocpg)(int, Orig*, ulong);
.
231a
#define OISMEM	0x08	/* origin contains real memory */
#define OSHARED	0x10	/* origin does not copy on ref/wr */
.
201a
/*
 *  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;

.
11a
typedef struct IOQ	IOQ;
typedef struct KIOQ	KIOQ;
.
## diffname port/portdat.h 1991/0614
## diff -e /n/bootesdump/1991/0607/sys/src/9/port/portdat.h /n/bootesdump/1991/0614/sys/src/9/port/portdat.h
493a
#define MAXSYSARG	6	/* for mount(fd, mpt, flag, arg, srv, authfd) */
.
402a
	int	hasspin;
.
## diffname port/portdat.h 1991/0705
## diff -e /n/bootesdump/1991/0614/sys/src/9/port/portdat.h /n/bootesdump/1991/0705/sys/src/9/port/portdat.h
508,510c
#define	CHDIR		0x80000000L
#define	CHAPPEND 	0x40000000L
#define	CHEXCL		0x20000000L
.
506a
extern	Palloc 	palloc;
extern  Image	swapimage;
.
411,418d
403,404c
	int 	hasspin;		/* I hold a spin lock */
	int	newtlb;			/* Pager has touched my tables so I must flush */
	int	procctl;		/* Control for /proc debugging */
.
389c

	Pgrp	*pgrp;			/* Process group for notes and namespace */
	Egrp 	*egrp;			/* Environment group */
	Fgrp	*fgrp;			/* File descriptor group */

.
382c
	Segment	*seg[NSEG];
.
359a
 * devproc requests
 */
enum
{
	Proc_stopme = 1,
	Proc_exitme = 2,
};

/*
.
356a
	Stopped,
.
330,339d
327c
	SSEG, TSEG, DSEG, BSEG, ESEG, LSEG, SEG1, SEG2, NSEG
.
312a
#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 */
};

.
309a
};

struct Egrp
{
	Ref;
	Egrp	*next;
	int	nenv;			/* highest active env table entry, +1 */
.
307d
302c
	Pgrp	*next;			/* free list */
.
298a
/* 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 */
};

.
291,296c
	union {
		Pte	*next;			/* Free list */
		Page	*pages[PTEPERTAB];	/* Page map for this chunk of pte */
	};
.
289c
struct Pte
.
283,286c
	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 */
.
270,281c
	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 */
.
268c
struct Page
.
262,266c
/* 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
.
180c
	Env	*next;			/* in chain of Envs for a egrp */
.
28c
typedef struct Segment	Segment;
.
22a
typedef struct Pte	Pte;
.
20a
typedef struct Palloc	Palloc;
.
18,19d
11a
typedef struct Fgrp	Fgrp;
typedef struct Image	Image;
.
7a
typedef struct Egrp	Egrp;
.
## diffname port/portdat.h 1991/0706
## diff -e /n/bootesdump/1991/0705/sys/src/9/port/portdat.h /n/bootesdump/1991/0706/sys/src/9/port/portdat.h
350a
	int	flushme;		/* maintain consistent icache for this segment */
.
## diffname port/portdat.h 1991/0724
## diff -e /n/bootesdump/1991/0706/sys/src/9/port/portdat.h /n/bootesdump/1991/0724/sys/src/9/port/portdat.h
603,605d
587c
#define	NUMSIZE		12		/* size of formatted number */
.
585c
#define MAXSYSARG	6		/* for mount(fd, mpt, flag, arg, srv, authfd) */
.
581,582c
	Streamhi= (9*1024),		/* byte count high water mark */
	Streambhi= 32,			/* block count high water mark */
.
545,556c
	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 */
.
538,541c
	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 */
.
534,536c
	Qinfo	*info;			/* line discipline definition */
	Queue	*other;			/* opposite direction, same line discipline */
	Queue	*next;			/* next queue in the stream */
.
528c
#define QHIWAT	0x4			/* queue has gone past the high water mark */	
.
526c
#define QHUNGUP	0x1			/* flag bit meaning the stream has been hung up */
.
401,403c
	Rendez	r;			/* Sleep for free mem */
	QLock	pwait;			/* Queue of procs waiting for memory */
	int	wanted;			/* Do the wakeup at free */
.
393,398c
	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 */
.
290,295c
	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 */
.
203,205c
#define	ETHERMINTU	60		/* minimum transmit size */
#define	ETHERMAXTU	1514		/* maximum transmit size */
#define ETHERHDRSIZE	14		/* size of an ethernet header */
.
120,124c
#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 */
.
110,114c
	Aaccess,			/* as in access, stat */
	Atodir,				/* as in chdir */
	Aopen,				/* for i/o */
	Amount,				/* to be mounted upon */
	Acreate,			/* file is to be created */
.
99,102c
	Block	*first;			/* first data block */
	Block	*last;			/* last data block */
	long	len;			/* length of list in bytes */
	int	nb;			/* number of blocks in list */
.
89,92c
	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 */
.
66c
	long	dt;			/* may underflow in clock(); must be signed */
.
## diffname port/portdat.h 1991/0727
## diff -e /n/bootesdump/1991/0724/sys/src/9/port/portdat.h /n/bootesdump/1991/0727/sys/src/9/port/portdat.h
495c
	int	notepending;		/* note issued but not acted on */
.
73c
	Lock;
.
## diffname port/portdat.h 1991/0731
## diff -e /n/bootesdump/1991/0727/sys/src/9/port/portdat.h /n/bootesdump/1991/0731/sys/src/9/port/portdat.h
585c
#define MAXSYSARG	6		/* for mount(fd, mpt, flag, arg, srv) */
.
## diffname port/portdat.h 1991/0802
## diff -e /n/bootesdump/1991/0731/sys/src/9/port/portdat.h /n/bootesdump/1991/0802/sys/src/9/port/portdat.h
393,394d
391c
	ulong	addr0;			/* next available ialloc addr in bank 0 */
	ulong	addr1;			/* next available ialloc addr in bank 1 */
.
## diffname port/portdat.h 1991/0806
## diff -e /n/bootesdump/1991/0802/sys/src/9/port/portdat.h /n/bootesdump/1991/0806/sys/src/9/port/portdat.h
501a

	ulong	rendtag;		/* Tag for rendezvous */ 
	ulong	rendval;		/* Value for rendezvous */
	Proc	*rendhash;		/* Hash list for tag values */
.
439a
	Rendezvous,
.
367a
	Proc	*rendhash[RENDHASH];	/* Rendezvous tag hash */
.
357a
#define RENDHASH	32
#define REND(p,s)	((p)->rendhash[(s)%RENDHASH])

.
## diffname port/portdat.h 1991/0807
## diff -e /n/bootesdump/1991/0806/sys/src/9/port/portdat.h /n/bootesdump/1991/0807/sys/src/9/port/portdat.h
417a
enum
{
	Forkpg	  = 1,
	Forkeg	  = 2,
	Forkfd	  = 4,
};

.
## diffname port/portdat.h 1991/0809
## diff -e /n/bootesdump/1991/0807/sys/src/9/port/portdat.h /n/bootesdump/1991/0809/sys/src/9/port/portdat.h
571a
	int	flushmsg;		/* flush up till the next delimiter */
.
## diffname port/portdat.h 1991/0810
## diff -e /n/bootesdump/1991/0809/sys/src/9/port/portdat.h /n/bootesdump/1991/0810/sys/src/9/port/portdat.h
222a
	union{
		int	(*gets)(IOQ*, void*, int);	/* input */
		int	(*getc)(IOQ*);			/* output */
	};
.
## diffname port/portdat.h 1991/0830
## diff -e /n/bootesdump/1991/0810/sys/src/9/port/portdat.h /n/bootesdump/1991/0830/sys/src/9/port/portdat.h
487a
	ulong	qlockpc;		/* pc of last call to qlock */
.
## diffname port/portdat.h 1991/0926
## diff -e /n/bootesdump/1991/0830/sys/src/9/port/portdat.h /n/bootesdump/1991/0926/sys/src/9/port/portdat.h
576d
505d
493,496c

	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 */
.
489a
	char	*psstate;		/* What /proc/???/status reports */
.
449,451d
444d
412a
struct Waitq
{
	Waitmsg	w;
	Waitq	*next;
};

.
32a
typedef struct Waitq	Waitq;
.
## diffname port/portdat.h 1991/1002
## diff -e /n/bootesdump/1991/0926/sys/src/9/port/portdat.h /n/bootesdump/1991/1002/sys/src/9/port/portdat.h
58,59c
	int	locked;			/* flag */
.
55a
	Lock	use;			/* to use object */
.
## diffname port/portdat.h 1991/1011
## diff -e /n/bootesdump/1991/1002/sys/src/9/port/portdat.h /n/bootesdump/1991/1011/sys/src/9/port/portdat.h
375c
	RWlock	ns;			/* Namespace many read/one write lock */
	Mhead	*mnthash[MNTHASH];
.
373d
364a
#define MNTHASH		32
#define MOUNTH(p,s)	((p)->mnthash[(s)->qid.path%MNTHASH])
.
254,255c
	Chan	*from;			/* channel mounted upon */
	Mount	*mount;			/* what's mounted upon it */
	Mhead	*hash;			/* Hash chain */
.
252c
struct Mhead
.
249c
	Mhead	*head;
	Chan	*to;			/* channel replacing underlying channel */
.
245,246d
122,123c
#define	CMSG	2			/* is the message channel for a mount */
#define	CCREATE	4			/* permits creation if c->mnt */
.
61a
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 */
};

.
30a
typedef struct RWlock	RWlock;
.
19c
typedef struct Mhead	Mhead;
.
## diffname port/portdat.h 1991/1018
## diff -e /n/bootesdump/1991/1011/sys/src/9/port/portdat.h /n/bootesdump/1991/1018/sys/src/9/port/portdat.h
395c
	QLock	ev;			/* for all of etab */
	Env	*etab;
.
197,202d
192,194d
190c
	Envval	*name;
.
10d
## diffname port/portdat.h 1991/10302
## diff -e /n/bootesdump/1991/1018/sys/src/9/port/portdat.h /n/bootesdump/1991/10302/sys/src/9/port/portdat.h
97a
	Block	*list;			/* chain of block lists */
.
## diffname port/portdat.h 1991/1101
## diff -e /n/bootesdump/1991/10302/sys/src/9/port/portdat.h /n/bootesdump/1991/1101/sys/src/9/port/portdat.h
139a
	Lock	offl;			/* offset access */
.
## diffname port/portdat.h 1991/1102
## diff -e /n/bootesdump/1991/1101/sys/src/9/port/portdat.h /n/bootesdump/1991/1102/sys/src/9/port/portdat.h
623a
extern	char	*conffile;
.
## diffname port/portdat.h 1991/1105
## diff -e /n/bootesdump/1991/1102/sys/src/9/port/portdat.h /n/bootesdump/1991/1105/sys/src/9/port/portdat.h
491a
	char	user[NAMELEN];
.
375d
261,262c
	NExit,				/* deliver note quietly */
	NDebug,				/* print debug message */
.
56c
	Lock	use;			/* to access Qlock structure */
.
## diffname port/portdat.h 1991/1106
## diff -e /n/bootesdump/1991/1105/sys/src/9/port/portdat.h /n/bootesdump/1991/1106/sys/src/9/port/portdat.h
612a

/*
 *  a multiplexed network
 */
struct Ifile
{
	char	*name;
	void	(*fill)(Chan*, char*, int);
};
struct Network
{
	char	*name;
	int	nif;			/* max # of interfaces */
	int	nconv;			/* max # of conversations */
	Qinfo	*devp;			/* device end line disc */
	Qinfo	*protop;		/* protocol line disc */
	int	(*listen)(Chan*);
	int	(*clone)(Chan*);
	void	(*connect)(Chan*, char*);
	void	(*announce)(Chan*, char*);
	int	ninfo;
	Ifile	info[5];
};
#define MAJOR(q) ((q) >> 8)
#define MINOR(q) ((q) & 0xff)
#define DEVICE(a,i) (((a)<<8) | (i))
.
18a
typedef struct Network	Network;
.
12a
typedef struct Ifile	Ifile;
.
## diffname port/portdat.h 1991/1107
## diff -e /n/bootesdump/1991/1106/sys/src/9/port/portdat.h /n/bootesdump/1991/1107/sys/src/9/port/portdat.h
633,634d
627d
## diffname port/portdat.h 1991/1109
## diff -e /n/bootesdump/1991/1107/sys/src/9/port/portdat.h /n/bootesdump/1991/1109/sys/src/9/port/portdat.h
653a
extern  char	eve[];
.
648d
519a
	ulong	procmode;		/* proc device file mode */

.
518a

.
## diffname port/portdat.h 1991/1110
## diff -e /n/bootesdump/1991/1109/sys/src/9/port/portdat.h /n/bootesdump/1991/1110/sys/src/9/port/portdat.h
532d
526d
524c
	Rendez	sleep;			/* place for tsleep/syssleep/debug */
.
521a
	int	hang;			/* hang at next exec for debug */
	int	procctl;		/* Control for /proc debugging */
	ulong	pc;			/* DEBUG only */
.
520a
	Proc	*pdbg;			/* the debugging process */
.
472a
	Proc_traceme = 3,
.
## diffname port/portdat.h 1991/1112
## diff -e /n/bootesdump/1991/1110/sys/src/9/port/portdat.h /n/bootesdump/1991/1112/sys/src/9/port/portdat.h
659a
extern	int	nrdy;
.
## diffname port/portdat.h 1991/1115
## diff -e /n/bootesdump/1991/1112/sys/src/9/port/portdat.h /n/bootesdump/1991/1115/sys/src/9/port/portdat.h
639c
	Netinf	info[5];
	Netprot	*prot;			/* protections */
.
631a
	Lock;
.
626a
	ulong	mode;
	char	owner[NAMELEN];
};
struct Netinf
{
.
625c
struct Netprot
.
19a
typedef struct Netinf	Netinf;
typedef struct Netprot	Netprot;
.
13d
## diffname port/portdat.h 1991/1122
## diff -e /n/bootesdump/1991/1115/sys/src/9/port/portdat.h /n/bootesdump/1991/1122/sys/src/9/port/portdat.h
325a
	Page	**first;			/* First used entry */
	Page	**last;				/* Last used entry */
.
## diffname port/portdat.h 1991/1127
## diff -e /n/bootesdump/1991/1122/sys/src/9/port/portdat.h /n/bootesdump/1991/1127/sys/src/9/port/portdat.h
655c
#define MAXSYSARG	6		/* for mount(fd, mpt, flag, arg, srv, crypt) */
.
379a
	Crypt	*crypt;			/* encryption key and challenge */
.
166a
#define	KEYLEN	7
struct Crypt
{
	char	key[KEYLEN];		/* des encryption key */
	char	chal[8];		/* challenge for setting user name */
};

.
5a
typedef struct Crypt	Crypt;
.
## diffname port/portdat.h 1991/1207
## diff -e /n/bootesdump/1991/1127/sys/src/9/port/portdat.h /n/bootesdump/1991/1207/sys/src/9/port/portdat.h
171c
	char	key[DESKEYLEN];		/* des encryption key */
.
168d
## diffname port/portdat.h 1991/1216
## diff -e /n/bootesdump/1991/1207/sys/src/9/port/portdat.h /n/bootesdump/1991/1216/sys/src/9/port/portdat.h
532c
	QLock	debug;			/* to access debugging elements of User */
.
## diffname port/portdat.h 1992/0111
## diff -e /n/bootesdump/1991/1216/sys/src/9/port/portdat.h /n/bootesdump/1992/0111/sys/src/9/port/portdat.h
673d
## diffname port/portdat.h 1992/0128
## diff -e /n/bootesdump/1992/0111/sys/src/9/port/portdat.h /n/bootesdump/1992/0128/sys/src/9/port/portdat.h
674a
extern	Pgrps 	pgrpalloc;
.
429a
struct Pgrps
{
	Lock;
	Pgrp	*arena;
	Pgrp	*free;
	ulong	pgrpid;
	ulong	cryptbase;
	ulong	crypttop;
};

.
25a
typedef struct Pgrps	Pgrps;
.
## diffname port/portdat.h 1992/0131
## diff -e /n/bootesdump/1992/0128/sys/src/9/port/portdat.h /n/bootesdump/1992/0131/sys/src/9/port/portdat.h
330,335c
	Page	*pages[PTEPERTAB];	/* Page map for this chunk of pte */
	Page	**first;		/* First used entry */
	Page	**last;			/* Last used entry */
	Pte	*next;			/* Free list */
.
## diffname port/portdat.h 1992/0212
## diff -e /n/bootesdump/1992/0131/sys/src/9/port/portdat.h /n/bootesdump/1992/0212/sys/src/9/port/portdat.h
672c
#define MAXSYSARG	5		/* for mount(fd, mpt, flag, arg, srv) */
.
## diffname port/portdat.h 1992/0222
## diff -e /n/bootesdump/1992/0212/sys/src/9/port/portdat.h /n/bootesdump/1992/0222/sys/src/9/port/portdat.h
109a
	ulong	pc;			/* pc of caller */
.
## diffname port/portdat.h 1992/0303
## diff -e /n/bootesdump/1992/0222/sys/src/9/port/portdat.h /n/bootesdump/1992/0303/sys/src/9/port/portdat.h
348,349d
346c
#define SG_RONLY	040			/* Segment is read only */
.
313a
	ulong	highwater;		/* Threshold beyond which we must page */
	ulong	headroom;		/* Space pager attempts to clear below highwater */
.
## diffname port/portdat.h 1992/0305
## diff -e /n/bootesdump/1992/0303/sys/src/9/port/portdat.h /n/bootesdump/1992/0305/sys/src/9/port/portdat.h
629c
#define FLOWCTL(q,b)	{ if(QFULL(q->next)) flowctl(q,b); else PUTNEXT(q,b);}
.
## diffname port/portdat.h 1992/0307
## diff -e /n/bootesdump/1992/0305/sys/src/9/port/portdat.h /n/bootesdump/1992/0307/sys/src/9/port/portdat.h
655a

.
650a

.
340,346c
#define SG_TYPE		07		/* Mask type of segment */
#define SG_TEXT		00
#define SG_DATA		01
#define SG_BSS		02
#define SG_STACK	03
#define SG_SHARED	04
#define SG_PHYSICAL	05
#define SG_SHDATA	06

.
271c
enum
{
.
250a

.
242a

.
40,41d
38a
typedef int    Devgen(Chan*, Dirtab*, int, int, Dir*);
.
## diffname port/portdat.h 1992/0309
## diff -e /n/bootesdump/1992/0307/sys/src/9/port/portdat.h /n/bootesdump/1992/0309/sys/src/9/port/portdat.h
49c
	long	ref;
.
## diffname port/portdat.h 1992/0318
## diff -e /n/bootesdump/1992/0309/sys/src/9/port/portdat.h /n/bootesdump/1992/0318/sys/src/9/port/portdat.h
698a

/*
 * auth messages
 */
#define CHLEN		8
enum{
	FScchal	= 1,
	FSctick,

	RXschal	= 0,
	RXstick	= 1,
};
.
687c
extern	char	*devchar;
.
626d
606c
struct Stream
{
.
593c
struct Queue
{
.
581a
	char nodelim;			/* True if stream does not preserve delimiters */
.
160d
158a
	Stream	*stream;		/* for stream channels */
.
## diffname port/portdat.h 1992/0319
## diff -e /n/bootesdump/1992/0318/sys/src/9/port/portdat.h /n/bootesdump/1992/0319/sys/src/9/port/portdat.h
605a
	Proc	*pp;
	Proc	*pg;
.
## diffname port/portdat.h 1992/0321
## diff -e /n/bootesdump/1992/0319/sys/src/9/port/portdat.h /n/bootesdump/1992/0321/sys/src/9/port/portdat.h
710a
	FSstick,
	FSerr,
.
709a
	FSschal,
	FSok,
.
698a
extern	char	sysname[NAMELEN];
.
## diffname port/portdat.h 1992/0322
## diff -e /n/bootesdump/1992/0321/sys/src/9/port/portdat.h /n/bootesdump/1992/0322/sys/src/9/port/portdat.h
708c
#define AUTHLEN		8
.
## diffname port/portdat.h 1992/0325
## diff -e /n/bootesdump/1992/0322/sys/src/9/port/portdat.h /n/bootesdump/1992/0325/sys/src/9/port/portdat.h
699a
extern	int	cpuserver;
.
## diffname port/portdat.h 1992/0326
## diff -e /n/bootesdump/1992/0325/sys/src/9/port/portdat.h /n/bootesdump/1992/0326/sys/src/9/port/portdat.h
606,607d
## diffname port/portdat.h 1992/0409
## diff -e /n/bootesdump/1992/0326/sys/src/9/port/portdat.h /n/bootesdump/1992/0409/sys/src/9/port/portdat.h
645,646c
	Streamhi= (32*1024),		/* byte count high water mark */
	Streambhi= 128,			/* block count high water mark */
.
## diffname port/portdat.h 1992/0428
## diff -e /n/bootesdump/1992/0409/sys/src/9/port/portdat.h /n/bootesdump/1992/0428/sys/src/9/port/portdat.h
698a
extern  Ref	noteidalloc;
.
528a
	ulong	noteid;			/* Equivalent of note group */
.
525c
	char	*psstate;		/* What /proc/#/status reports */
.
461,463c
	FORKNSG		= (1<<0),
	FORKEVG		= (1<<1),
	FORKFDG		= (1<<2),
	FORKNTG		= (1<<3),
	FORKPCS		= (1<<4),
	FORKMEM		= (1<<5),
	FORKCNSG	= (1<<10),
	FORKCEVG	= (1<<11),
	FORKCFDG	= (1<<12)
.
## diffname port/portdat.h 1992/0430
## diff -e /n/bootesdump/1992/0428/sys/src/9/port/portdat.h /n/bootesdump/1992/0430/sys/src/9/port/portdat.h
466a
	FORKNOW		= (1<<6),
.
450,458d
## diffname port/portdat.h 1992/0501
## diff -e /n/bootesdump/1992/0430/sys/src/9/port/portdat.h /n/bootesdump/1992/0501/sys/src/9/port/portdat.h
452,461c
	RFNAMEG		= (1<<0),
	RFENVG		= (1<<1),
	RFFDG		= (1<<2),
	RFNOTEG		= (1<<3),
	RFPROC		= (1<<4),
	RFMEM		= (1<<5),
	RFNOWAIT	= (1<<6),
	RFCNAMEG	= (1<<10),
	RFCENVG		= (1<<11),
	RFCFDG		= (1<<12)
.
## diffname port/portdat.h 1992/0516
## diff -e /n/bootesdump/1992/0501/sys/src/9/port/portdat.h /n/bootesdump/1992/0516/sys/src/9/port/portdat.h
86c
	QLock;
.
79c
	ulong	when;			/* may underflow in clock(); must be signed */
.
## diffname port/portdat.h 1992/0602
## diff -e /n/bootesdump/1992/0516/sys/src/9/port/portdat.h /n/bootesdump/1992/0602/sys/src/9/port/portdat.h
698a
extern	Talarm	talarm;
.
563a

	ulong	twhen;
	Rendez	*trend;
	Proc	*tlink;

.
553c
	Rendez	sleep;			/* place for syssleep/debug */
.
78,81c
	Proc	*list;
.
76d
74c
struct Talarm
.
37a
typedef struct Talarm	Talarm;
.
1d
## diffname port/portdat.h 1992/0617
## diff -e /n/bootesdump/1992/0602/sys/src/9/port/portdat.h /n/bootesdump/1992/0617/sys/src/9/port/portdat.h
563a
	int	(*tfn)(void*);
.
## diffname port/portdat.h 1992/0619
## diff -e /n/bootesdump/1992/0617/sys/src/9/port/portdat.h /n/bootesdump/1992/0619/sys/src/9/port/portdat.h
416,418c
	ulong	p0, p1;			/* base of pages in bank 0/1 */
	ulong	np0, np1;		/* number of pages in bank 0/1 */
.
407d
397d
40a
#include "fcall.h"

.
## diffname port/portdat.h 1992/0620
## diff -e /n/bootesdump/1992/0619/sys/src/9/port/portdat.h /n/bootesdump/1992/0620/sys/src/9/port/portdat.h
610a
	Stream	*next;
.
161c
		Mnt	*mntptr;	/* for devmnt */
.
17a
typedef struct Mnt	Mnt;
.
## diffname port/portdat.h 1992/0621
## diff -e /n/bootesdump/1992/0620/sys/src/9/port/portdat.h /n/bootesdump/1992/0621/sys/src/9/port/portdat.h
642c
enum
{
.
208c
struct Etherpkt
{
.
111c
struct Blist
{
.
44,48d
## diffname port/portdat.h 1992/0623
## diff -e /n/bootesdump/1992/0621/sys/src/9/port/portdat.h /n/bootesdump/1992/0623/sys/src/9/port/portdat.h
675c
	Netprot	*prot;			/* linked list of protections */
.
653a
	int	id;
	Netprot	*next;		/* linked list of protections */
.
401a
struct Evalue
{
	char	*name;
	char	*value;
	int	len;
	ulong	path;
	Evalue	*link;
};

.
397,399c
	QLock;
	Evalue	*entries;
	ulong	path;
.
195,200d
9,10c
typedef struct Evalue	Evalue;
.
## diffname port/portdat.h 1992/0625
## diff -e /n/bootesdump/1992/0623/sys/src/9/port/portdat.h /n/bootesdump/1992/0625/sys/src/9/port/portdat.h
723a

	AUTHLEN	= 8,
.
713,714c
enum
{
.
704a
extern	Palloc 	palloc;
extern	Pgrps 	pgrpalloc;
.
702,703d
700a
extern  IOQ	printq;
extern	char*	statename[];
extern  Image	swapimage;
.
699a
extern	ulong	initcode[];
extern	FPsave	initfp;
extern  KIOQ	kbdq;
extern  IOQ	lineq;
extern  IOQ	mouseq;
extern  Ref	noteidalloc;
.
693,698d
691c
extern	char*	conffile;
extern	int	cpuserver;
extern	char*	devchar;
.
689d
685d
681,683d
576,583c
	Streamput	*iput;		/* input routine */
	Streamput	*oput;		/* output routine */
	Streamopen	*open;
	Streamclose	*close;
	char		*name;
	Streamreset	*reset;		/* initialization */
	char		nodelim;	/* True if stream does not preserve delimiters */
	Qinfo		*next;
.
494,499c
	TUser = 0, 		/* Proc.time */
.
484,492c
	Proc_stopme = 1, 	/* devproc requests */
	Proc_exitme,
	Proc_traceme,
.
482d
472c
	Dead = 0,		/* Process states */
.
467,469d
340,341c
	SG_RONLY	= 040,		/* Segment is read only */
};
.
331,338c
enum
{
	SG_TYPE		= 07,		/* Mask type of segment */
	SG_TEXT		= 00,
	SG_DATA		= 01,
	SG_BSS		= 02,
	SG_STACK	= 03,
	SG_SHARED	= 04,
	SG_PHYSICAL	= 05,
	SG_SHDATA	= 06,
.
283a
	Lock;
.
274,280c
enum
{
	PG_NOFLUSH	= 0,		/* Fields for cache control of pages */
	PG_TXTFLUSH	= 1,
	PG_DATFLUSH	= 2,
	PG_MOD		= 0x01,		/* Simulated modified and referenced bits */
	PG_REF		= 0x02,
};
.
241,245d
82a
#define MAXSYSARG	5		/* for mount(fd, mpt, flag, arg, srv) */
struct Sargs
{
	ulong	args[MAXSYSARG];
};

.
39a
typedef	void   Streamput(Queue*, Block*);
typedef	void   Streamopen(Queue*, Stream*);
typedef	void   Streamclose(Queue*);
typedef	void   Streamreset(void);
.
34a
typedef struct Sargs	Sargs;
.
## diffname port/portdat.h 1992/0725
## diff -e /n/bootesdump/1992/0625/sys/src/9/port/portdat.h /n/bootesdump/1992/0725/sys/src/9/port/portdat.h
699a
extern	int	cpuserver;
.
## diffname port/portdat.h 1992/0726
## diff -e /n/bootesdump/1992/0725/sys/src/9/port/portdat.h /n/bootesdump/1992/0726/sys/src/9/port/portdat.h
678a
#define MB		(1024*1024)
.
## diffname port/portdat.h 1992/0805
## diff -e /n/bootesdump/1992/0726/sys/src/9/port/portdat.h /n/bootesdump/1992/0805/sys/src/9/port/portdat.h
514c
	Page	*upage;			/* page from palloc */
.
356a
#define pagedout(s)	(((ulong)s)==0 || onswap(s))
#define swapaddr(s)	(((ulong)s)&~PG_ONSWAP)
.
354,355d
## diffname port/portdat.h 1992/0808
## diff -e /n/bootesdump/1992/0805/sys/src/9/port/portdat.h /n/bootesdump/1992/0808/sys/src/9/port/portdat.h
219a
/*
 *  SCSI devices.
 */
enum
{
	ScsiTestunit	= 0x00,
	ScsiExtsens	= 0x03,
	ScsiModesense	= 0x1a,
	ScsiGetcap	= 0x25,
	ScsiRead	= 0x08,
	ScsiWrite	= 0x0a,

	/*
	 * data direction
	 */
	ScsiIn		= 1,
	ScsiOut		= 0,
};

struct Scsibuf
{
	void *	virt;
	void *	phys;
	Scsibuf *next;
};

struct Scsidata
{
	uchar *	base;
	uchar *	lim;
	uchar *	ptr;
};

struct Scsi
{
	QLock;
	ulong	pid;
	ushort	target;
	ushort	lun;
	ushort	rflag;
	ushort	status;
	Scsidata cmd;
	Scsidata data;
	Scsibuf	*b;
	uchar	*save;
	uchar	cmdblk[16];
};
.
35a
typedef struct Scsi	Scsi;
typedef struct Scsibuf	Scsibuf;
typedef struct Scsidata	Scsidata;
.
## diffname port/portdat.h 1992/0811
## diff -e /n/bootesdump/1992/0808/sys/src/9/port/portdat.h /n/bootesdump/1992/0811/sys/src/9/port/portdat.h
147a
#define	CRCLOSE	32			/* remove on close */
.
## diffname port/portdat.h 1992/0824
## diff -e /n/bootesdump/1992/0811/sys/src/9/port/portdat.h /n/bootesdump/1992/0824/sys/src/9/port/portdat.h
754,756c
enum
{
	CHDIR =		0x80000000L,
	CHAPPEND = 	0x40000000L,
	CHEXCL =	0x20000000L,
};
.
751d
728,730c
enum
{
	PRINTSIZE =	256,
	NUMSIZE	=	12,		/* size of formatted number */
	MB =		(1024*1024),
};
.
689,694c
	Shighqid	= STREAMQID(1,0) - 1,
	Sdataqid	= Shighqid,
	Sctlqid		= Sdataqid-1,
	Slowqid		= Sctlqid,
	Streamhi	= (32*1024),	/* byte count high water mark */
	Streambhi	= 128,		/* block count high water mark */
.
632,638c
/* Queue.flag */
enum
{
	QHUNGUP	=	0x1,	/* stream has been hung up */
	QINUSE =	0x2,	/* allocation check */
	QHIWAT =	0x4,	/* queue has gone past the high water mark */	
	QDEBUG =	0x8,
};
.
612c
	 *  machine specific MMU
.
490,499d
487a
	ulong	cmembase;		/* Key memory protected from read by devproc */
	ulong	cmemtop;
.
473d
465d
439d
432d
430c
enum
{
	RENDHASH =	32,		/* Hash to lookup rendezvous tags */
	MNTHASH	=	32,		/* Hash to walk mount table */
	NFD =		100,		/* Number of per process file descriptors */
	PGHSIZE	=	512,		/* Page hash for image lookup */
};
.
424c
	Image	*image;			/* text in file attached to this segment */
.
376c
	Segment *s;			/* TEXT segment for image if running */
.
365c
	ulong	headroom;		/* Space pager keeps free under highwater */
.
271,273c

/* character based IO (mouse, keyboard, console screen) */
.
260,269c
	ulong		pid;
	ushort		target;
	ushort		lun;
	ushort		rflag;
	ushort		status;
	Scsidata 	cmd;
	Scsidata 	data;
	Scsibuf*	b;
	uchar*		save;
	uchar		cmdblk[16];
.
252,254c
	uchar*		base;
	uchar*		lim;
	uchar*		ptr;
.
245,247c
	void*		virt;
	void*		phys;
	Scsibuf*	next;
.
236,238c
	/* data direction */
.
228a
	ETHERMINTU =	60,		/* minimum transmit size */
	ETHERMAXTU =	1514,		/* maximum transmit size */
	ETHERHDRSIZE =	14,		/* size of an ethernet header */
};

/* SCSI devices. */
enum
{
.
224,226d
220,222d
214,218c
	uchar	d[6];
	uchar	s[6];
	uchar	type[2];
	uchar	data[1500];
	uchar	crc[4];
.
186,198c
	void	(*reset)(void);
	void	(*init)(void);
	Chan*	(*attach)(char*);
	Chan*	(*clone)(Chan*, Chan*);
	int	(*walk)(Chan*, char*);
	void	(*stat)(Chan*, char*);
	Chan*	(*open)(Chan*, int);
	void	(*create)(Chan*, char*, int, ulong);
	void	(*close)(Chan*);
	long	(*read)(Chan*, void*, long, ulong);
	long	(*write)(Chan*, void*, long, ulong);
	void	(*remove)(Chan*);
	void	(*wstat)(Chan*, char*);
.
181a
	Crypt	*next;
.
## diffname port/portdat.h 1992/0825
## diff -e /n/bootesdump/1992/0824/sys/src/9/port/portdat.h /n/bootesdump/1992/0825/sys/src/9/port/portdat.h
233a
	ScsiInquiry	= 0x12,
.
152,154d
## diffname port/portdat.h 1992/0826
## diff -e /n/bootesdump/1992/0825/sys/src/9/port/portdat.h /n/bootesdump/1992/0826/sys/src/9/port/portdat.h
723a
	MAXCRYPT = 	127,
.
## diffname port/portdat.h 1992/0902
## diff -e /n/bootesdump/1992/0826/sys/src/9/port/portdat.h /n/bootesdump/1992/0902/sys/src/9/port/portdat.h
735c
extern	uchar	initcode[];
.
## diffname port/portdat.h 1992/0912
## diff -e /n/bootesdump/1992/0902/sys/src/9/port/portdat.h /n/bootesdump/1992/0912/sys/src/9/port/portdat.h
358,360c
	uchar	*swmap;			/* Base of swap map in memory */
	uchar	*alloc;			/* Round robin allocator */
	uchar	*last;			/* Speed swap allocation */
	uchar	*top;			/* Top of swap map */
.
## diffname port/portdat.h 1992/1009
## diff -e /n/bootesdump/1992/0912/sys/src/9/port/portdat.h /n/bootesdump/1992/1009/sys/src/9/port/portdat.h
232a
	ScsiStartunit	= 0x1B,
	ScsiStopunit	= 0x1B,
.
## diffname port/portdat.h 1992/1021
## diff -e /n/bootesdump/1992/1009/sys/src/9/port/portdat.h /n/bootesdump/1992/1021/sys/src/9/port/portdat.h
776a

/*
 *  mouse types
 */
enum
{
	Mouseother=	0,
	Mouseserial=	1,
	MousePS2=	2,
};
extern int mouseshifted;
extern int mousetype;
.
## diffname port/portdat.h 1992/1209
## diff -e /n/bootesdump/1992/1021/sys/src/9/port/portdat.h /n/bootesdump/1992/1209/sys/src/9/port/portdat.h
436c
	PGHLOG  =	9,
	PGHSIZE	=	1<<PGHLOG,	/* Page hash for image lookup */
.
## diffname port/portdat.h 1992/1217
## diff -e /n/bootesdump/1992/1209/sys/src/9/port/portdat.h /n/bootesdump/1992/1217/sys/src/9/port/portdat.h
736c
extern	Rune*	devchar;
.
## diffname port/portdat.h 1993/0120
## diff -e /n/bootesdump/1992/1217/sys/src/9/port/portdat.h /n/bootesdump/1993/0120/sys/src/9/port/portdat.h
426c
	Page	*(*pgalloc)(Segment*, ulong);/* SG_PHYSICAL page allocator */
.
## diffname port/portdat.h 1993/0209
## diff -e /n/bootesdump/1993/0120/sys/src/9/port/portdat.h /n/bootesdump/1993/0209/sys/src/9/port/portdat.h
347d
## diffname port/portdat.h 1993/0210
## diff -e /n/bootesdump/1993/0209/sys/src/9/port/portdat.h /n/bootesdump/1993/0210/sys/src/9/port/portdat.h
415,426c
	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 */
	int	flushme;	/* maintain consistent icache for this segment */
	Image	*image;		/* text in file attached to this segment */
	Physseg *pseg;
.
410a
struct Physseg
{
	ulong	attr;			/* Segment attributes */
	char	*name;			/* Attach name */
	ulong	pa;			/* Physical address */
	ulong	size;			/* Maximum segment size in pages */
	Page	*(*pgalloc)(Segment*, ulong);	/* Allocation if we need it */
	void	(*pgfree)(Page*);
};

.
26a
typedef struct Physseg	Physseg;
.
## diffname port/portdat.h 1993/0309
## diff -e /n/bootesdump/1993/0210/sys/src/9/port/portdat.h /n/bootesdump/1993/0309/sys/src/9/port/portdat.h
578a
	QLock	qwaitr;
.
## diffname port/portdat.h 1993/0323
## diff -e /n/bootesdump/1993/0309/sys/src/9/port/portdat.h /n/bootesdump/1993/0323/sys/src/9/port/portdat.h
768a
	CHMOUNT	=	0x10000000L,
.
## diffname port/portdat.h 1993/0330
## diff -e /n/bootesdump/1993/0323/sys/src/9/port/portdat.h /n/bootesdump/1993/0330/sys/src/9/port/portdat.h
786,787d
748a
extern	char	hostdomain[];
.
456d
176,182d
173a
	Session	*session;
.
50c
#include <auth.h>
#include <fcall.h>
.
36a
typedef struct Session	Session;
.
5d
## diffname port/portdat.h 1993/0407
## diff -e /n/bootesdump/1993/0330/sys/src/9/port/portdat.h /n/bootesdump/1993/0407/sys/src/9/port/portdat.h
233a
	ScsiExtread	= 0x28,
	ScsiExtwrite	= 0x2a,
.
## diffname port/portdat.h 1993/0501
## diff -e /n/bootesdump/1993/0407/sys/src/9/port/portdat.h /n/fornaxdump/1993/0501/sys/src/brazil/port/portdat.h
782a

	AUTHLEN	= 8,
.
758,759d
756a
extern	Pthash	syspt;
.
752a
extern	Palloc	palloc;
.
741a
extern	int	cpuserver;
.
612a
	FPsave	fpsave;		/* address of this is known by db */
	int	scallnr;	/* sys call number - known by db */
	Sargs	s;		/* address of this is known by db */
	int	nerrlab;
	Label	errlab[NERR];
	char	error[ERRLEN];
	char	elem[NAMELEN];	/* last name element from namec */
	Chan	*slash;
	Chan	*dot;

	Note	note[NNOTE];
	short	nnote;
	short	notified;	/* sysnoted is due */
	Note	lastnote;
	int	(*notify)(void*, char*);

	void	*ureg;		/* User registers for notes */
	void	*dbgreg;	/* User registers for devproc */
	ulong	svstatus;
	ulong	svr1;

.
611a
	void	(*kpfun)(void*);
	void	*kparg;
.
604,606c
	ulong	rendtag;	/* Tag for rendezvous */ 
	ulong	rendval;	/* Value for rendezvous */
	Proc	*rendhash;	/* Hash list for tag values */
.
595,602c
	Rendez	*r;		/* rendezvous point slept on */
	Rendez	sleep;		/* place for syssleep/debug */
	int	notepending;	/* note issued but not acted on */
	int	kp;		/* true if a kernel process */
	Proc	*palarm;	/* Next alarm time */
	ulong	alarm;		/* Time of call */
	int	newtlb;		/* Pager has changed my pte's so I must flush */
.
588,593c
	QLock	debug;		/* to access debugging elements of User */
	Proc	*pdbg;		/* the debugging process */
	ulong	procmode;	/* proc device file mode */
	int	hang;		/* hang at next exec for debug */
	int	procctl;	/* Control for /proc debugging */
	ulong	pc;		/* DEBUG only */
.
584c
	ulong	time[6];	/* User, Sys, Real; child U, S, R */
.
579,581c
	Pgrp	*pgrp;		/* Process group for namespace */
	Egrp 	*egrp;		/* Environment group */
	Fgrp	*fgrp;		/* File descriptor group */
.
576c
	Rendez	waitr;		/* Place to hang out in wait */
.
571,574c
	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 */
.
569c
	ulong	noteid;		/* Equivalent of note group */
.
565,566c
	char	*psstate;	/* What /proc/#/status reports */
	Page	*upage;		/* page from palloc */
.
560,563c
	Proc	*rnext;		/* next process in run queue */
	Proc	*qnext;		/* next process on queue for a QLock */
	QLock	*qlock;		/* addrof qlock being queued for DEBUG */
.
556,557c
	Label	sched;		/* known to l.s */
	char	*kstack;	/* known to l.s */
	Mach	*mach;		/* machine running this proc */
.
551a

	NERR = 15,
	NNOTE = 5,
.
454c
	RWlock	ns;			/* Namespace n read/one write lock */
	QLock	nsh;
.
441c
	NFD =		100,		/* per process file descriptors */
.
434c
	Pte	*map[SEGMAPSIZE];
.
431c
	int	flushme;	/* maintain icache for this segment */
.
369,370c
	Chan	*c;			/* channl to text file */
	Qid 	qid;			/* Qid for page cache coherence */
.
362,363c
	ulong	highwater;		/* Pager start threshold */
	ulong	headroom;		/* Space pager frees under highwater */
.
356c
	int	free;			/* currently free swap pages */
.
344a
	char	lock;			/* Software lock */
.
331,335c
	PG_TXTFLUSH	= 1<<1,		/* flush icache */
	PG_DATFLUSH	= 1<<2,		/* flush both i & d caches */
	PG_DATINVALID	= 1<<3,		/* invalidate d cache */

	PG_MOD		= 0x01,		/* software modified bit */
	PG_REF		= 0x02,		/* software referenced bit */
.
315a
struct Mnt
{
	Ref;			/* Count of attached channels */
	Chan	*c;		/* Channel to file service */
	Proc	*rip;		/* Reader in progress */
	Mntrpc	*queue;		/* Queue of pending requests on this channel */
	Mntrpc	*recwait;	/* List of rpc's with recovery pending */
	ulong	id;		/* Multiplexor id for channel check */
	Mnt	*list;		/* Free list */
	char	mux;		/* Set if the device does the multiplexing */
	char	recov;		/* Run recovery if channel is lost */
	char	recprog;	/* Recovery in progress */
	int	blocksize;	/* read/write block size */
	ushort	flushtag;	/* Tag to send flush on */
	ushort	flushbase;	/* Base tag of flush window for this buffer */
	Pthash	tree;		/* Path names from this mount point */
};

.
306c
	Chan	*to;			/* channel replacing channel */
	int	flag;
	char	spec[NAMELEN];
.
300a
enum
{
	NSMAX	=	1000,
	NSLOG	=	7,
	NSCACHE	=	(1<<NSLOG),
};

struct Pthash
{
	QLock;
	int	npt;
	Path	*root;
	Path	*hash[NSCACHE];
};

struct Mntwalk
{
	ulong	id;
	Mhead	*mh;
	Mount	*cm;
};

.
234,235d
175c
	Session *session;
.
171a
		ulong	mid;		/* for ns in devproc */
.
167a
	Path	*path;
	Mount	*mnt;			/* mount point that derived Chan */
	Mount	*xmnt;			/* Last mount point crossed */
	ulong	mountid;
.
164,165d
155,158c
	Chan	*next;			/* allocation */
	Chan	*link;
	ulong	offset;			/* in file */
.
142,150c
struct Path
{
	Ref;
	Path	*hash;
	Path	*parent;
	Pthash	*pthash;
	char	elem[NAMELEN];
};
.
139a

	COPEN	= 0x0001,		/* for i/o */
	CMSG	= 0x0002,		/* the message channel for a mount */
	CCREATE	= 0x0004,		/* permits creation if c->mnt */
	CCEXEC	= 0x0008,		/* close on exec */
	CFREE	= 0x0010,		/* not in use */
	CRCLOSE	= 0x0020,		/* remove on close */
	CRECOV	= 0x0040,		/* requires recovery */
.
131c
 * Access types in namec & channel flags
.
40a
typedef struct Session	Session;
.
36d
28a
typedef struct Pthash	Pthash;
.
22a
typedef struct Path	Path;
.
15a
typedef struct Mntrpc	Mntrpc;
typedef struct Mntwalk	Mntwalk;
.
4a
typedef struct Crypt	Crypt;
.
## diffname port/portdat.h 1993/0508
## diff -e /n/fornaxdump/1993/0501/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0508/sys/src/brazil/port/portdat.h
810a
	void	*ptr;
.
804,807c
	int	(*listen)(Netprot*);
	int	(*open)(Netprot*, int);
.
796c
	void	(*fill)(Netprot*, char*, int);
.
790a
	Network	*net;
.
217,235d
10d
## diffname port/portdat.h 1993/0511
## diff -e /n/fornaxdump/1993/0508/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0511/sys/src/brazil/port/portdat.h
760a

.
758,759d
744,751c
#define BLEN(b)		((b)->wp - (b)->rp)
.
739,740d
737c
 *  Macros to manage Qid's used for multiplexed devices
.
721,733c
	Qcsleep=1,	/* consumer sleeping */
.
719c
enum
.
707,716c
	Lock;

	Block	*first;
	Block	*last;
	int	nbytes;		/* bytes in queue */
	int	limit;		/* max bytes in queue */
	int	state;

	QLock	rlock;		/* mutex for readers */
	QLock	wlock;		/* mutex for writers */
	Rendez	r;
.
696,702c
	uchar	*rp;			/* first unconsumed byte */
	uchar	*wp;			/* first empty byte */
	uchar	*lim;			/* 1 past the end of the buffer */
	uchar	*base;			/* start of the buffer */
.
686,694c
	Block	*next;
.
684c
struct Block
.
682c
 *  IO queues
.
175d
103,133d
49,52d
45d
33d
3d
## diffname port/portdat.h 1993/0512
## diff -e /n/fornaxdump/1993/0511/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0512/sys/src/brazil/port/portdat.h
672c
	Qstarve=1,	/* consumer starved */
.
## diffname port/portdat.h 1993/0513
## diff -e /n/fornaxdump/1993/0512/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0513/sys/src/brazil/port/portdat.h
665,666c
	QLock	wlock;		/* mutex for r */
.
659,661c
	Block	*rfirst;	/* waiting readers */
	Block	*rlast;

	Block	*bfirst;	/* buffer */
	Block	*blast;

	int	len;		/* bytes in queue */
.
652a

	Rendez	r;			/* waiting reader */
.
## diffname port/portdat.h 1993/0522
## diff -e /n/fornaxdump/1993/0513/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0522/sys/src/brazil/port/portdat.h
694d
689,692c
	Nhighqid	= NETQID(1,0) - 1,
	Ndataqid	= Nhighqid,
	Nctlqid		= Ndataqid-1,
	Nlowqid		= Nctlqid,
.
683,686c
#define NETTYPE(x)	((x)&0x1f)
#define NETID(x)	(((x)&~CHDIR)>>5)
#define NETQID(i,t)	(((i)<<5)|(t))
.
678a
#define BLEN(b)		((b)->wp - (b)->rp)
.
670a
	void	(*kick)(void*);	/* restart output */
	void	*arg;		/* argument to kick */

.
## diffname port/portdat.h 1993/0525
## diff -e /n/fornaxdump/1993/0522/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0525/sys/src/brazil/port/portdat.h
684,727d
680a
	Qmsg=1,		/* message oriented */
.
19,21d
## diffname port/portdat.h 1993/0526
## diff -e /n/fornaxdump/1993/0525/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0526/sys/src/brazil/port/portdat.h
671d
656a
	QLock	rlock;		/* mutex for reading processes */
	QLock	wlock;		/* mutex for writing processes */
.
## diffname port/portdat.h 1993/0527
## diff -e /n/fornaxdump/1993/0526/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0527/sys/src/brazil/port/portdat.h
681d
678,679c
	/* Block.flag */
	Bfilled=1,		/* block filled */

	/* Queue.state */	
	Qstarve=1,		/* consumer starved */
	Qmsg=2,			/* message stream */
.
652a
#define BLEN(b)		((b)->wp - (b)->rp)
.
649a
	uchar	flag;
.
## diffname port/portdat.h 1993/0528
## diff -e /n/fornaxdump/1993/0527/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0528/sys/src/brazil/port/portdat.h
684,685c
	Qstarve=	(1<<0),		/* consumer starved */
	Qmsg=		(1<<1),		/* message stream */
	Qclosed=	(1<<2),
	Qflow=		(1<<3),
.
675c
	QLock	rlock;		/* mutex for reading processes */
	Rendez	rr;		/* process waiting to read */
	QLock	wlock;		/* mutex for writing processes */
	Rendez	wr;		/* process waiting to write */
.
662,664d
659,660d
## diffname port/portdat.h 1993/0530
## diff -e /n/fornaxdump/1993/0528/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0530/sys/src/brazil/port/portdat.h
639,688d
## diffname port/portdat.h 1993/0601
## diff -e /n/fornaxdump/1993/0530/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0601/sys/src/brazil/port/portdat.h
663c
extern  Queue	*printq;
.
657,659c
extern  Queue	*kbdq;
extern  Queue	*mouseq;
.
221,250d
## diffname port/portdat.h 1993/0727
## diff -e /n/fornaxdump/1993/0601/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0727/sys/src/brazil/port/portdat.h
602c
int entpc;
int entr31;
.
## diffname port/portdat.h 1993/0728
## diff -e /n/fornaxdump/1993/0727/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0728/sys/src/brazil/port/portdat.h
602,603c

.
## diffname port/portdat.h 1993/0731
## diff -e /n/fornaxdump/1993/0728/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0731/sys/src/brazil/port/portdat.h
308d
## diffname port/portdat.h 1993/0806
## diff -e /n/fornaxdump/1993/0731/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0806/sys/src/brazil/port/portdat.h
568c
	int	newtlb;		/* Pager has changed my pte's, I must flush */
.
461c
	ulong	cmembase;		/* Key memory */
.
87c
#define MAXSYSARG	5	/* for mount(fd, mpt, flag, arg, srv) */
.
71c
	QLock	k;			/* Lock for waiting writers */
.
## diffname port/portdat.h 1993/0811
## diff -e /n/fornaxdump/1993/0806/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0811/sys/src/brazil/port/portdat.h
293,295c
	PG_NOFLUSH	= 0,
	PG_TXTFLUSH	= 1,		/* flush icache */
	PG_DATFLUSH	= 2,		/* flush both i & d caches */
.
## diffname port/portdat.h 1993/0816
## diff -e /n/fornaxdump/1993/0811/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0816/sys/src/brazil/port/portdat.h
313a

	uchar	*log;
	int	lptr;
.
## diffname port/portdat.h 1993/0817
## diff -e /n/fornaxdump/1993/0816/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0817/sys/src/brazil/port/portdat.h
457c
	ulong	freecount;
	ulong	freecol[NCOLOR];	/* how many pages on free list now */
.
308a
	char	color;			/* Cache coloring */
.
## diffname port/portdat.h 1993/0818
## diff -e /n/fornaxdump/1993/0817/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0818/sys/src/brazil/port/portdat.h
315,317d
## diffname port/portdat.h 1993/0906
## diff -e /n/fornaxdump/1993/0818/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0906/sys/src/brazil/port/portdat.h
625a
extern	int	hwcurs;
.
## diffname port/portdat.h 1993/0910
## diff -e /n/fornaxdump/1993/0906/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0910/sys/src/brazil/port/portdat.h
460,461c
	Rendez	r[NCOLOR];		/* Sleep for free mem */
	QLock	pwait[NCOLOR];		/* Queue of procs waiting for memory */
.
455d
## diffname port/portdat.h 1993/0915
## diff -e /n/fornaxdump/1993/0910/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/0915/sys/src/brazil/port/portdat.h
491c
	SSEG, TSEG, DSEG, BSEG, ESEG, LSEG, SEG1, SEG2, SEG3, SEG4, NSEG
.
## diffname port/portdat.h 1993/1013
## diff -e /n/fornaxdump/1993/0915/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/1013/sys/src/brazil/port/portdat.h
600,601c
	Notsave;
.
137a
	Mntcache *mcp;			/* Mount cache pointer */
.
13a
typedef struct Mntcache Mntcache;
.
## diffname port/portdat.h 1993/1014
## diff -e /n/fornaxdump/1993/1013/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/1014/sys/src/brazil/port/portdat.h
272c
	int	flags;		/* recover/cache */
.
## diffname port/portdat.h 1993/1016
## diff -e /n/fornaxdump/1993/1014/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/1016/sys/src/brazil/port/portdat.h
111a
	CCACHE	= 0x0080,		/* client cache */
.
## diffname port/portdat.h 1993/1017
## diff -e /n/fornaxdump/1993/1016/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/1017/sys/src/brazil/port/portdat.h
112a
	CTEXT	= 0x0100,		/* text file */
.
## diffname port/portdat.h 1993/1018
## diff -e /n/fornaxdump/1993/1017/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/1018/sys/src/brazil/port/portdat.h
113d
## diffname port/portdat.h 1993/1120
## diff -e /n/fornaxdump/1993/1018/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/1120/sys/src/brazil/port/portdat.h
462,464c
	Rendez	r;			/* Sleep for free mem */
	QLock	pwait;			/* Queue of procs waiting for memory */
.
458c
	ulong	freecount;		/* how many pages on free list now */
.
## diffname port/portdat.h 1993/1121
## diff -e /n/fornaxdump/1993/1120/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/1121/sys/src/brazil/port/portdat.h
278a
	char	*partial;	/* Outstanding read data */
	int	npart;		/* Sizeof remains */
.
## diffname port/portdat.h 1993/1124
## diff -e /n/fornaxdump/1993/1121/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/1124/sys/src/brazil/port/portdat.h
175,221d
36,38d
12d
## diffname port/portdat.h 1993/1201
## diff -e /n/fornaxdump/1993/1124/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/1201/sys/src/brazil/port/portdat.h
553a

	/* statistics */
	ulong	counter[Pcounter];	/* specialized per process counters */
	ulong	syscall[NSYSCALL];
.
472a

	NSYSCALL = 37,		/* MUST be equal to the real thing!!!! */
	Pcounter = 6,		/* per process counters */
	 CSCNTR = 0,		/*  sched counter */
	 FAULTCNTR = 1,		/*  fault counter */
	 TLBCNTR = 2,		/*  utlbmiss */
.
11d
## diffname port/portdat.h 1993/1204
## diff -e /n/fornaxdump/1993/1201/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/1204/sys/src/brazil/port/portdat.h
568a

struct Schedq
{
	Lock;
	Proc	*head;
	Proc	*tail;
};

.
555a
	Mach	*mp;		/* machine this process is tied to */

.
33a
typedef struct Schedq	Schedq;
.
## diffname port/portdat.h 1993/1212
## diff -e /n/fornaxdump/1993/1204/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/1212/sys/src/brazil/port/portdat.h
557c
	Mach	*mp;		/* machine this process last ran on */
	ulong	mpfault;	/* page faults on that mach at sched time */
.
249a
	PG_NEWCOL	= 3,		/* page has been recolored */
.
## diffname port/portdat.h 1993/1214
## diff -e /n/fornaxdump/1993/1212/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/1214/sys/src/brazil/port/portdat.h
559c
	ulong	affinity;	/* affinity counter for that mach */
.
## diffname port/portdat.h 1993/1215
## diff -e /n/fornaxdump/1993/1214/sys/src/brazil/port/portdat.h /n/fornaxdump/1993/1215/sys/src/brazil/port/portdat.h
579a
	int	n;
.
## diffname port/portdat.h 1994/0106
## diff -e /n/fornaxdump/1993/1215/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0106/sys/src/brazil/port/portdat.h
318c
	SG_RONLY	= 0040,		/* Segment is read only */
	SG_CEXEC	= 0100,		/* Detach at exec */
.
## diffname port/portdat.h 1994/0216
## diff -e /n/fornaxdump/1994/0106/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0216/sys/src/brazil/port/portdat.h
652a
extern int mouseswap;
.
## diffname port/portdat.h 1994/0221
## diff -e /n/fornaxdump/1994/0216/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0221/sys/src/brazil/port/portdat.h
639a
};

/* Things scsi */
enum
{
	STharderr	=-1,	/* Command status error returns */
	STok		= 0,
	STcheck		= 2,
	STcondmet	= 4,
	STbusy		= 8,
	STintok		= 16,
	STconflict	= 18,
	STintcondmet	= 20,
	STterminated	= 22,
	STresconf	= 24,
	STqfull		= 28,

	SCSIread	= 0,
	SCSIwrite,
.
37a
typedef struct Target	Target;
.
## diffname port/portdat.h 1994/0222
## diff -e /n/fornaxdump/1994/0221/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0222/sys/src/brazil/port/portdat.h
659a

	SCSImaxxfer	= 1024*1024,
.
## diffname port/portdat.h 1994/0225
## diff -e /n/fornaxdump/1994/0222/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0225/sys/src/brazil/port/portdat.h
208,210c
	Chan*	from;			/* channel mounted upon */
	Mount*	mount;			/* what's mounted upon it */
	Mhead*	hash;			/* Hash chain */
.
199,201c
	Mount*	next;
	Mhead*	head;
	Chan*	to;			/* channel replacing channel */
.
192,193c
	Mhead*	mh;
	Mount*	cm;
.
189c
struct Mntwalk				/* state for /proc/#/ns */
.
185,186c
	Path*	root;
	Path*	hash[NSCACHE];
.
146c
	Session*session;
.
144c
	Chan*	mchan;			/* channel to mounted server */
.
141c
		Mnt*	mntptr;		/* for devmnt */
.
139c
		void*	aux;
.
133,135c
	Path*	path;
	Mount*	mnt;			/* mount point that derived Chan */
	Mount*	xmnt;			/* Last mount point crossed */
.
124,125c
	Chan*	next;			/* allocation */
	Chan*	link;
.
115,117c
	Path*	hash;
	Path*	parent;
	Pthash*	pthash;
.
## diffname port/portdat.h 1994/0306
## diff -e /n/fornaxdump/1994/0225/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0306/sys/src/brazil/port/portdat.h
120a
struct Block
{
	Block	*next;
	Block	*list;

	uchar	*rp;			/* first unconsumed byte */
	uchar	*wp;			/* first empty byte */
	uchar	*lim;			/* 1 past the end of the buffer */
	uchar	*base;			/* start of the buffer */
	uchar	flag;
};

.
## diffname port/portdat.h 1994/0309
## diff -e /n/fornaxdump/1994/0306/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0309/sys/src/brazil/port/portdat.h
131a
#define BLEN(s)	((s)->wp - (s)->rp)
.
## diffname port/portdat.h 1994/0321
## diff -e /n/fornaxdump/1994/0309/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0321/sys/src/brazil/port/portdat.h
123,129c
	Block*	next;
	Block*	list;
	int	size;			/* power of 2 allocation list */
	uchar*	rp;			/* first unconsumed byte */
	uchar*	wp;			/* first empty byte */
	uchar*	lim;			/* 1 past the end of the buffer */
	uchar*	base;			/* start of the buffer */
.
## diffname port/portdat.h 1994/0322
## diff -e /n/fornaxdump/1994/0321/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0322/sys/src/brazil/port/portdat.h
130a
	uchar	intr;
.
125d
## diffname port/portdat.h 1994/0325
## diff -e /n/fornaxdump/1994/0322/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0325/sys/src/brazil/port/portdat.h
583c
ulong qpc;
.
## diffname port/portdat.h 1994/0331
## diff -e /n/fornaxdump/1994/0325/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0331/sys/src/brazil/port/portdat.h
597a
#define NCALLBACK	32

typedef struct Callbk Callbk;
struct Callbk
{
	void	(*func)(void*);
	void*	arg;
};
.
## diffname port/portdat.h 1994/0406
## diff -e /n/fornaxdump/1994/0331/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0406/sys/src/brazil/port/portdat.h
583c

.
490c
	NSYSCALL = 39,		/* MUST be equal to the real thing!!!! */
.
## diffname port/portdat.h 1994/0407
## diff -e /n/fornaxdump/1994/0406/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0407/sys/src/brazil/port/portdat.h
696a
extern int nsyscall;
.
582c
	ulong	*syscall;
.
490d
## diffname port/portdat.h 1994/0507
## diff -e /n/fornaxdump/1994/0407/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0507/sys/src/brazil/port/portdat.h
129,130c
	ulong	flag;
.
120a
enum
{
	BINTR	=	(1<<0),
	BFREE	=	(1<<1),
};

.
## diffname port/portdat.h 1994/0508
## diff -e /n/fornaxdump/1994/0507/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0508/sys/src/brazil/port/portdat.h
602,610d
## diffname port/portdat.h 1994/0612
## diff -e /n/fornaxdump/1994/0508/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0612/sys/src/brazil/port/portdat.h
584,587d
## diffname port/portdat.h 1994/0613
## diff -e /n/fornaxdump/1994/0612/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0613/sys/src/brazil/port/portdat.h
218a
	Mount*	copy;
	Mount*	order;
.
## diffname port/portdat.h 1994/0725
## diff -e /n/fornaxdump/1994/0613/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0725/sys/src/brazil/port/portdat.h
580a
	ulong	movetime;	/* ticks when proc was last reassigned */
.
## diffname port/portdat.h 1994/0727
## diff -e /n/fornaxdump/1994/0725/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0727/sys/src/brazil/port/portdat.h
691a
extern Physseg physseg[];
.
581a
	ulong	priority;
.
## diffname port/portdat.h 1994/0728
## diff -e /n/fornaxdump/1994/0727/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0728/sys/src/brazil/port/portdat.h
580,581d
## diffname port/portdat.h 1994/0729
## diff -e /n/fornaxdump/1994/0728/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0729/sys/src/brazil/port/portdat.h
580c
	ulong	priority;	/* priority level 0 is highest */
	ulong	movetime;	/* last time process switched processors */
.
## diffname port/portdat.h 1994/0808
## diff -e /n/fornaxdump/1994/0729/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0808/sys/src/brazil/port/portdat.h
580c
	ulong	priority;	/* priority level */
	ulong	basepri;	/* base priority level */
.
## diffname port/portdat.h 1994/0810
## diff -e /n/fornaxdump/1994/0808/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0810/sys/src/brazil/port/portdat.h
582a
	ulong	readyticks;	/* time process went ready */
.
## diffname port/portdat.h 1994/0812
## diff -e /n/fornaxdump/1994/0810/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0812/sys/src/brazil/port/portdat.h
530a
	Rgrp	*rgrp;		/* Rendez group */
.
459c
	RFCFDG		= (1<<12),
	RFREND		= (1<<13),
.
397a
};

struct Rgrp
{
	Ref;
.
392d
31a
typedef struct Rgrp	Rgrp;
.
## diffname port/portdat.h 1994/0814
## diff -e /n/fornaxdump/1994/0812/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0814/sys/src/brazil/port/portdat.h
701a
extern ulong crasharea;
extern ulong crashend;
.
699a

.
## diffname port/portdat.h 1994/0816
## diff -e /n/fornaxdump/1994/0814/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0816/sys/src/brazil/port/portdat.h
503,506c
	Nrq	= 5,
.
## diffname port/portdat.h 1994/0817
## diff -e /n/fornaxdump/1994/0816/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0817/sys/src/brazil/port/portdat.h
503c
	Nrq		= 20,
	PriNormal	= 10,
	PriRoot		= 5,
.
317a
	int	notext;			/* no file associated */
.
## diffname port/portdat.h 1994/0908
## diff -e /n/fornaxdump/1994/0817/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0908/sys/src/brazil/port/portdat.h
669a
	STtimeout	=-3,
	STownid		=-2,
.
## diffname port/portdat.h 1994/0914
## diff -e /n/fornaxdump/1994/0908/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0914/sys/src/brazil/port/portdat.h
600,607d
504,506c
	Nrq		= 20,	/* number of scheduler priority levels */
	PriNormal	= 10,	/* base priority for normal processes */
	PriRoot		= 5,	/* base priority for root processes */
.
35d
## diffname port/portdat.h 1994/0915
## diff -e /n/fornaxdump/1994/0914/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0915/sys/src/brazil/port/portdat.h
505c
	PriRoot		= 13,	/* base priority for root processes */
.
## diffname port/portdat.h 1994/0917
## diff -e /n/fornaxdump/1994/0915/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0917/sys/src/brazil/port/portdat.h
587a
	ulong	rt;		/* # ticks used since last blocked */
	ulong	art;		/* avg # ticks used since last blocked */
.
## diffname port/portdat.h 1994/0918
## diff -e /n/fornaxdump/1994/0917/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0918/sys/src/brazil/port/portdat.h
591c
	ulong	readytime;	/* time process went ready */
.
## diffname port/portdat.h 1994/0920
## diff -e /n/fornaxdump/1994/0918/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/0920/sys/src/brazil/port/portdat.h
504a
	PriKproc	= 13,	/* base priority for kernel processes */
.
## diffname port/portdat.h 1994/1124
## diff -e /n/fornaxdump/1994/0920/sys/src/brazil/port/portdat.h /n/fornaxdump/1994/1124/sys/src/brazil/port/portdat.h
146c
	ulong	dev;
.
## diffname port/portdat.h 1995/0101
## diff -e /n/fornaxdump/1994/1124/sys/src/brazil/port/portdat.h /n/fornaxdump/1995/0101/sys/src/brazil/port/portdat.h
134a
	void	(*free)(Block*);
.
## diffname port/portdat.h 1995/0102
## diff -e /n/fornaxdump/1995/0101/sys/src/brazil/port/portdat.h /n/fornaxdump/1995/0102/sys/src/brazil/port/portdat.h
587,593c
	Mach	*wired;		/* machine this process must run on */
	int	pri;		/* scheduling priority - low is high priority */
	int	nice;		/* time-passing algorithm - low is high priority */
.
504,507c
	NiceMax		= 10,		/* max nice */
	NiceNormal	= 5,		/* base nice for normal processes */
	NiceKproc	= NiceNormal-2,	/* nice for kernel processes */
	NiceRoot	= NiceNormal-2,	/* nice for root processes */
.
## diffname port/portdat.h 1995/0106
## diff -e /n/fornaxdump/1995/0102/sys/src/brazil/port/portdat.h /n/fornaxdump/1995/0106/sys/src/brazil/port/portdat.h
589c
	short	nice;		/* time-passing algorithm - low is high priority */
	short	yield;		/* force one lap in the runq */	
.
## diffname port/portdat.h 1995/0108
## diff -e /n/fornaxdump/1995/0106/sys/src/brazil/port/portdat.h /n/fornaxdump/1995/0108/sys/src/brazil/port/portdat.h
590c
	char	yield;		/* force one lap in the runq */
	char	inlock;		/* temp hi proirity ~= 2*num of locks set */
.
180a
	long	(*bwrite)(Chan*, Block*, ulong);
.
179a
	Block*	(*bread)(Chan*, long, ulong);
.
## diffname port/portdat.h 1995/0110
## diff -e /n/fornaxdump/1995/0108/sys/src/brazil/port/portdat.h /n/fornaxdump/1995/0110/sys/src/brazil/port/portdat.h
589,593c
	Mach	*wired;
	Mach	*mp;		/* machine this process last ran on */
	ulong	priority;	/* priority level */
	ulong	basepri;	/* base priority level */
	ulong	rt;		/* # ticks used since last blocked */
	ulong	art;		/* avg # ticks used since last blocked */
	ulong	movetime;	/* last time process switched processors */
	ulong	readytime;	/* time process went ready */
.
506,509c
	Nrq		= 20,	/* number of scheduler priority levels */
	PriNormal	= 10,	/* base priority for normal processes */
	PriKproc	= 13,	/* base priority for kernel processes */
	PriRoot		= 13,	/* base priority for root processes */
.
## diffname port/portdat.h 1995/0215
## diff -e /n/fornaxdump/1995/0110/sys/src/brazil/port/portdat.h /n/fornaxdump/1995/0215/sys/src/brazil/port/portdat.h
494a
	Proc_exitbig,
.
## diffname port/portdat.h 1995/0319
## diff -e /n/fornaxdump/1995/0215/sys/src/brazil/port/portdat.h /n/fornaxdump/1995/0319/sys/src/brazil/port/portdat.h
304a
	Rendez	pause;
.
300,303c
	uchar*	swmap;			/* Base of swap map in memory */
	uchar*	alloc;			/* Round robin allocator */
	uchar*	last;			/* Speed swap allocation */
	uchar*	top;			/* Top of swap map */
.
## diffname port/portdat.h 1995/0910
## diff -e /n/fornaxdump/1995/0319/sys/src/brazil/port/portdat.h /n/fornaxdump/1995/0910/sys/src/brazil/port/portdat.h
706a
extern ulong randomcount;
.
## diffname port/portdat.h 1996/0303
## diff -e /n/fornaxdump/1995/0910/sys/src/brazil/port/portdat.h /n/fornaxdump/1996/0303/sys/src/brazil/port/portdat.h
701a

enum
{
	LRESPROF	= 3,
};
.
379a
	ulong*	profile;	/* Tick profile area */
.
## diffname port/portdat.h 1996/0511
## diff -e /n/fornaxdump/1996/0303/sys/src/brazil/port/portdat.h /n/fornaxdump/1996/0511/sys/src/brazil/port/portdat.h
509a
	PriLock		= 19,	/* priority for processes holding locks */
.
## diffname port/portdat.h 1996/0516
## diff -e /n/fornaxdump/1996/0511/sys/src/brazil/port/portdat.h /n/fornaxdump/1996/0516/sys/src/brazil/port/portdat.h
600a
	ulong	lockpri;	/* priority of process holding lock we're trying for */
.
## diffname port/portdat.h 1996/0607
## diff -e /n/fornaxdump/1996/0516/sys/src/brazil/port/portdat.h /n/fornaxdump/1996/0607/sys/src/brazil/port/portdat.h
673,685c
	STnomem		=-4,		/* buffer allocation failed */
	STtimeout	=-3,		/* bus timeout */
	STownid		=-2,		/* playing with myself */
	STharderr	=-1,		/* controller error of some kind */
	STok		= 0,		/* good */
	STcheck		= 0x02,		/* check condition */
	STcondmet	= 0x04,		/* condition met/good */
	STbusy		= 0x08,		/* busy */
	STintok		= 0x10,		/* intermediate/good */
	STintcondmet	= 0x14,		/* intermediate/condition met/good */
	STresconf	= 0x18,		/* reservation conflict */
	STterminated	= 0x22,		/* command terminated */
	STqfull		= 0x28,		/* queue full */
.
## diffname port/portdat.h 1996/0712
## diff -e /n/fornaxdump/1996/0607/sys/src/brazil/port/portdat.h /n/fornaxdump/1996/0712/sys/src/brazil/port/portdat.h
690c
	SCSImaxxfer	= 2048*1024,
.
## diffname port/portdat.h 1996/1015
## diff -e /n/fornaxdump/1996/0712/sys/src/brazil/port/portdat.h /n/fornaxdump/1996/1015/sys/src/brazil/port/portdat.h
557a
	Lock	rlock;		/* synchronization for 'r' below */
.
## diffname port/portdat.h 1996/1016
## diff -e /n/fornaxdump/1996/1015/sys/src/brazil/port/portdat.h /n/fornaxdump/1996/1016/sys/src/brazil/port/portdat.h
558c
	Lock	rlock;		/* sync sleep/wakeup with postnote */
.
## diffname port/portdat.h 1997/0220
## diff -e /n/fornaxdump/1996/1016/sys/src/brazil/port/portdat.h /n/emeliedump/1997/0220/sys/src/brazil/port/portdat.h
53d
## diffname port/portdat.h 1997/0327
## diff -e /n/emeliedump/1997/0220/sys/src/brazil/port/portdat.h /n/emeliedump/1997/0327/sys/src/brazil/port/portdat.h
713,715d
698,707d
693,695d
632,633c
extern  Queue*	kbdq;
.
629d
626c
extern	Dev*	devtab[];
.
624d
244d
## diffname port/portdat.h 1997/0408
## diff -e /n/emeliedump/1997/0327/sys/src/brazil/port/portdat.h /n/emeliedump/1997/0408/sys/src/brazil/port/portdat.h
623d
168a
	int	dc;
	char*	name;

.
## diffname port/portdat.h 1997/0417
## diff -e /n/emeliedump/1997/0408/sys/src/brazil/port/portdat.h /n/emeliedump/1997/0417/sys/src/brazil/port/portdat.h
620a
	READSTR =	1000,		/* temporary buffer size for device reads */
.
## diffname port/portdat.h 1997/0516
## diff -e /n/emeliedump/1997/0417/sys/src/brazil/port/portdat.h /n/emeliedump/1997/0516/sys/src/brazil/port/portdat.h
343a
	SG_MAP		= 07,
.
## diffname port/portdat.h 1997/0603
## diff -e /n/emeliedump/1997/0516/sys/src/brazil/port/portdat.h /n/emeliedump/1997/0603/sys/src/brazil/port/portdat.h
434a
};

enum
{
	DELTAFD	= 20		/* incremental increase in Fgrp.fd's */
.
433c
	Chan	**fd;
	int	nfd;			/* number allocated */
.
## diffname port/portdat.h 1998/0306
## diff -e /n/emeliedump/1997/0603/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0306/sys/src/brazil/port/portdat.h
160a
		char	tag[4];		/* for iproute */
.
## diffname port/portdat.h 1998/0319
## diff -e /n/emeliedump/1998/0306/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0319/sys/src/brazil/port/portdat.h
184c
	long	(*write)(Chan*, void*, long, vlong);
.
182c
	long	(*read)(Chan*, void*, long, vlong);
.
144c
	vlong	offset;			/* in file */
.
## diffname port/portdat.h 1998/0325
## diff -e /n/emeliedump/1998/0319/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0325/sys/src/brazil/port/portdat.h
497a
	QueueingW,
.
66,69c
	Lock	use;
	Proc	*head;		/* list of waiting processes */
	Proc	*tail;
	int	readers;	/* number of readers */
	int	writer;		/* number of writers */
.
## diffname port/portdat.h 1998/0326
## diff -e /n/emeliedump/1998/0325/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0326/sys/src/brazil/port/portdat.h
708d
## diffname port/portdat.h 1998/0512
## diff -e /n/emeliedump/1998/0326/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0512/sys/src/brazil/port/portdat.h
578c
	ulong	rendtag;	/* Tag for rendezvous */
.
## diffname port/portdat.h 1998/0516
## diff -e /n/emeliedump/1998/0512/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0516/sys/src/brazil/port/portdat.h
613a
	int	preempted;	/* true if this process hasn't finished the interrupt
				 *  that last preempted it
				 */
.
## diffname port/portdat.h 1998/0604
## diff -e /n/emeliedump/1998/0516/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0604/sys/src/brazil/port/portdat.h
613d
## diffname port/portdat.h 1998/0605
## diff -e /n/emeliedump/1998/0604/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0605/sys/src/brazil/port/portdat.h
603a

	int	nlocks;		/* Number of locks held */
.
539d
## diffname port/portdat.h 1998/0606
## diff -e /n/emeliedump/1998/0605/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0606/sys/src/brazil/port/portdat.h
604c
	int	lockwait;	/* waiting for lock to be released */
.
521c
	PriLock		= 0,	/* priority for processes waiting on a lock */
.
## diffname port/portdat.h 1998/0617
## diff -e /n/emeliedump/1998/0606/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0617/sys/src/brazil/port/portdat.h
195c
	Length;
.
## diffname port/portdat.h 1998/0805
## diff -e /n/emeliedump/1998/0617/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0805/sys/src/brazil/port/portdat.h
70a
//	int	pidw;
//	int	pidr[10];
.
## diffname port/portdat.h 1998/0806
## diff -e /n/emeliedump/1998/0805/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0806/sys/src/brazil/port/portdat.h
500a
	QueueingR,
.
71,72d
## diffname port/portdat.h 1998/0811
## diff -e /n/emeliedump/1998/0806/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0811/sys/src/brazil/port/portdat.h
711a

#pragma	varargck	argpos	print	1
#pragma	varargck	argpos	snprint	3
#pragma	varargck	argpos	sprint	2
#pragma	varargck	argpos	fprint	2

#pragma	varargck	type	"lld"	vlong
#pragma	varargck	type	"llx"	vlong
#pragma	varargck	type	"lld"	uvlong
#pragma	varargck	type	"llx"	uvlong
#pragma	varargck	type	"lx"	void*
#pragma	varargck	type	"ld"	long
#pragma	varargck	type	"lx"	long
#pragma	varargck	type	"ld"	ulong
#pragma	varargck	type	"lx"	ulong
#pragma	varargck	type	"d"	int
#pragma	varargck	type	"x"	int
#pragma	varargck	type	"c"	int
#pragma	varargck	type	"C"	int
#pragma	varargck	type	"d"	uint
#pragma	varargck	type	"x"	uint
#pragma	varargck	type	"c"	uint
#pragma	varargck	type	"C"	uint
#pragma	varargck	type	"f"	double
#pragma	varargck	type	"e"	double
#pragma	varargck	type	"g"	double
#pragma	varargck	type	"s"	char*
#pragma	varargck	type	"S"	Rune*
#pragma	varargck	type	"r"	void
#pragma	varargck	type	"%"	void
#pragma	varargck	type	"I"	uchar*
#pragma	varargck	type	"V"	uchar*
#pragma	varargck	type	"E"	uchar*
#pragma	varargck	type	"M"	uchar*
.
## diffname port/portdat.h 1998/0829
## diff -e /n/emeliedump/1998/0811/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0829/sys/src/brazil/port/portdat.h
234a
	Ref;
	RWlock	lock;
.
153,154c
	Mhead*	mh;			/* mount point that derived Chan */
	Mhead*	xmh;			/* Last mount point crossed */
	int	uri;			/* union read index */
.
## diffname port/portdat.h 1998/0916
## diff -e /n/emeliedump/1998/0829/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0916/sys/src/brazil/port/portdat.h
388c
	Pte	**map;
	int	mapsize;
	Pte	*ssegmap[SSEGMAPSIZE];
.
377d
## diffname port/portdat.h 1998/0918
## diff -e /n/emeliedump/1998/0916/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0918/sys/src/brazil/port/portdat.h
138a
#define BALLOC(s) ((s)->lim - (s)->base);
.
## diffname port/portdat.h 1998/0923
## diff -e /n/emeliedump/1998/0918/sys/src/brazil/port/portdat.h /n/emeliedump/1998/0923/sys/src/brazil/port/portdat.h
139c
#define BALLOC(s) ((s)->lim - (s)->base)
.
## diffname port/portdat.h 1999/0108
## diff -e /n/emeliedump/1998/0923/sys/src/brazil/port/portdat.h /n/emeliedump/1999/0108/sys/src/brazil/port/portdat.h
545a
	QLock	seglock;	/* locked whenever seg[] changes */
.
328a
	QLock	rdlock;			/* mutex for reading from image */
.
## diffname port/portdat.h 1999/0110
## diff -e /n/emeliedump/1999/0108/sys/src/brazil/port/portdat.h /n/emeliedump/1999/0110/sys/src/brazil/port/portdat.h
624a
	ulong	qpc;		/* pc calling last blocking qlock */
.
329d
## diffname port/portdat.h 1999/0122
## diff -e /n/emeliedump/1999/0110/sys/src/brazil/port/portdat.h /n/emeliedump/1999/0122/sys/src/brazil/port/portdat.h
434a
	Qid	qid;
.
433d
425c
	ulong	path;	/* qid.path of next Evalue to be allocated */
	ulong	vers;	/* of Egrp */
.
## diffname port/portdat.h 1999/0316
## diff -e /n/emeliedump/1999/0122/sys/src/brazil/port/portdat.h /n/emeliedump/1999/0316/sys/src/brazil/port/portdat.h
716a
};

/*
 *  action log
 */
struct Log {
	Lock;
	int	opens;
	char*	buf;
	char	*end;
	char	*rptr;
	int	len;

	int	logmask;	/* mask of things to debug */

	QLock	readq;
	Rendez	readr;
};

struct Logflag {
	char*	name;
	int	mask;
};

struct Cmdbuf
{
	char	buf[64];
	char	*f[16];
	int	nf;
.
41a

.
11a
typedef struct Log	Log;
typedef struct Logflag	Logflag;
.
3a
typedef struct Cmdbuf	Cmdbuf;
.
## diffname port/portdat.h 1999/0517
## diff -e /n/emeliedump/1999/0316/sys/src/brazil/port/portdat.h /n/emeliedump/1999/0517/sys/src/brazil/port/portdat.h
786a
#pragma	varargck	type	"p"	void*
.
## diffname port/portdat.h 1999/0618
## diff -e /n/emeliedump/1999/0517/sys/src/brazil/port/portdat.h /n/emeliedump/1999/0618/sys/src/brazil/port/portdat.h
747c
	char	buf[256];
.
## diffname port/portdat.h 1999/0629
## diff -e /n/emeliedump/1999/0618/sys/src/brazil/port/portdat.h /n/emeliedump/1999/0629/sys/src/brazil/port/portdat.h
747c
	char	buf[64];
.
262d
221a
	int		cddone;
.
212,219d
174a
struct Cname
{
	Ref;
	int	alen;			/* allocated length */
	int	len;			/* strlen(s) */
	char	*s;
};

.
172a
	Cname	*name;
.
157d
116,124d
23d
4a
typedef struct Cname	Cname;
.
## diffname port/portdat.h 1999/0731
## diff -e /n/emeliedump/1999/0629/sys/src/brazil/port/portdat.h /n/emeliedump/1999/0731/sys/src/brazil/port/portdat.h
738c
	char	buf[256];
.
## diffname port/portdat.h 1999/1022
## diff -e /n/emeliedump/1999/0731/sys/src/brazil/port/portdat.h /n/emeliedump/1999/1022/sys/src/brazil/port/portdat.h
315c
	Chan	*c;			/* channel to text file */
.
## diffname port/portdat.h 1999/1105
## diff -e /n/emeliedump/1999/1022/sys/src/brazil/port/portdat.h /n/emeliedump/1999/1105/sys/src/9/port/portdat.h
249,250c
	int	flags;		/* cache */
.
246,247c
	ulong	id;		/* Multiplexer id for channel check */
.
112d
## diffname port/portdat.h 1999/1230
## diff -e /n/emeliedump/1999/1105/sys/src/9/port/portdat.h /n/emeliedump/1999/1230/sys/src/9/port/portdat.h
741a
#define DEVDOTDOT -1

.
## diffname port/portdat.h 2000/0104
## diff -e /n/emeliedump/1999/1230/sys/src/9/port/portdat.h /n/emeliedump/2000/0104/sys/src/9/port/portdat.h
249,250d
## diffname port/portdat.h 2000/0107
## diff -e /n/emeliedump/2000/0104/sys/src/9/port/portdat.h /n/emeliedump/2000/0107/sys/src/9/port/portdat.h
72a
	ulong	wpc;		/* pc of writer */
	Proc	*wproc;		/* writing proc */
.
## diffname port/portdat.h 2000/0123
## diff -e /n/emeliedump/2000/0107/sys/src/9/port/portdat.h /n/emeliedump/2000/0123/sys/src/9/port/portdat.h
271,272c
	PG_TXTFLUSH	= 1,		/* flush dcache and invalidate icache */
	PG_DATFLUSH	= 2,		/* flush both i & d caches (UNUSED) */
.
## diffname port/portdat.h 2000/0322
## diff -e /n/emeliedump/2000/0123/sys/src/9/port/portdat.h /n/emeliedump/2000/0322/sys/src/9/port/portdat.h
478a
	RFNOMNT		= (1<<14),
.
398a
	int	noattach;
.
## diffname port/portdat.h 2000/0506
## diff -e /n/emeliedump/2000/0322/sys/src/9/port/portdat.h /n/emeliedump/2000/0506/sys/src/9/port/portdat.h
685,707d
## diffname port/portdat.h 2000/0919
## diff -e /n/emeliedump/2000/0506/sys/src/9/port/portdat.h /n/emeliedump/2000/0919/sys/src/9/port/portdat.h
56a
	Lock;
.
## diffname port/portdat.h 2000/1018
## diff -e /n/emeliedump/2000/0919/sys/src/9/port/portdat.h /n/emeliedump/2000/1018/sys/src/9/port/portdat.h
700a
	int	nlog;
	int	minread;
.
## diffname port/portdat.h 2000/1122
## diff -e /n/emeliedump/2000/1018/sys/src/9/port/portdat.h /n/emeliedump/2000/1122/sys/src/9/port/portdat.h
195a
	void	(*power)(int);	/* power mgt: power(1) → on, power (0) → off */
.
## diffname port/portdat.h 2000/1205
## diff -e /n/emeliedump/2000/1122/sys/src/9/port/portdat.h /n/emeliedump/2000/1205/sys/src/9/port/portdat.h
196a
	int	(*config)(int, char*, DevConf*);
.
11a
typedef struct DevConf	DevConf;
.
## diffname port/portdat.h 2000/1215
## diff -e /n/emeliedump/2000/1205/sys/src/9/port/portdat.h /n/emeliedump/2000/1215/sys/src/9/port/portdat.h
205c
	vlong	length;
.
## diffname port/portdat.h 2001/0127
## diff -e /n/emeliedump/2000/1215/sys/src/9/port/portdat.h /n/emeliedump/2001/0127/sys/src/9/port/portdat.h
623a
	ulong	kppc;		/* kprof calling pc */
.
## diffname port/portdat.h 2001/0315
## diff -e /n/emeliedump/2001/0127/sys/src/9/port/portdat.h /n/emeliedump/2001/0315/sys/src/9/port/portdat.h
615a
	uchar	fixedpri;	/* priority level deson't change */
.
43a
typedef struct Watchdog	Watchdog;
.
## diffname port/portdat.h 2001/0405
## diff -e /n/emeliedump/2001/0315/sys/src/9/port/portdat.h /n/emeliedump/2001/0405/sys/src/9/port/portdat.h
162d
## diffname port/portdat.h 2001/0424
## diff -e /n/emeliedump/2001/0405/sys/src/9/port/portdat.h /n/emeliedump/2001/0424/sys/src/9/port/portdat.h
346d
## diffname port/portdat.h 2001/0425
## diff -e /n/emeliedump/2001/0424/sys/src/9/port/portdat.h /n/emeliedump/2001/0425/sys/src/9/port/portdat.h
345d
## diffname port/portdat.h 2001/0510
## diff -e /n/emeliedump/2001/0425/sys/src/9/port/portdat.h /n/emeliedump/2001/0510/sys/src/9/port/portdat.h
545a
	Proc	*pidhash;	/* next proc in pid hash */
.
## diffname port/portdat.h 2001/0511
## diff -e /n/emeliedump/2001/0510/sys/src/9/port/portdat.h /n/emeliedump/2001/0511/sys/src/9/port/portdat.h
755a
#pragma	varargck	type	"q"	char*
.
536a
	char	*args;
	int	nargs;		/* number of bytes of args */
.
## diffname port/portdat.h 2001/0527
## diff -e /n/emeliedump/2001/0511/sys/src/9/port/portdat.h /n/emeliedump/2001/0527/sys/src/9/port/portdat.h
766a
#pragma	varargck	type	"q"	char*
.
758d
729a
enum {
	Stagesize=	1024
};

/*
 *  software UART
 */
struct Uart
{
	void*	regs;			/* hardware stuff */
	char*	name;			/* internal name */
	ulong	freq;			/* clock frequency */
	int	bits;			/* bits per character */
	int	stop;			/* stop bits */
	int	parity;			/* even, odd or no parity */
	int	baud;			/* baud rate */
	PhysUart*phys;
	int	console;		/* used as a serial console */
	int	special;		/* internal kernel device */
	Uart*	next;			/* list of allocated uarts */

	QLock;
	int	type;			/* ?? */
	int	dev;
	int	opens;

	int	enabled;
	Uart	*elist;			/* next enabled interface */

	int	perr;			/* parity errors */
	int	ferr;			/* framing errors */
	int	oerr;			/* rcvr overruns */

	/* buffers */
	int	(*putc)(Queue*, int);
	Queue	*iq;
	Queue	*oq;

	uchar	istage[Stagesize];
	uchar	*iw;
	uchar	*ir;
	uchar	*ie;

	Lock	tlock;			/* transmit */
	uchar	ostage[Stagesize];
	uchar	*op;
	uchar	*oe;

	int	modem;			/* hardware flow control on */
	int	xonoff;			/* software flow control on */
	int	blocked;
	int	cts, dsr, dcd, dcdts;	/* keep track of modem status */ 
	int	ctsbackoff;
	int	hup_dsr, hup_dcd;	/* send hangup upstream? */
	int	dohup;

	Rendez	r;
};

.
728c
/*
 *  routines to access UART hardware
 */
struct PhysUart
{
	char*	name;
	Uart*	(*pnp)(void);
	void	(*enable)(Uart*, int);
	void	(*disable)(Uart*);
	void	(*kick)(Uart*);
	void	(*dobreak)(Uart*, int);
	int	(*baud)(Uart*, int);
	int	(*bits)(Uart*, int);
	int	(*stop)(Uart*, int);
	int	(*parity)(Uart*, int);
	void	(*modemctl)(Uart*, int);
	void	(*rts)(Uart*, int);
	void	(*dtr)(Uart*, int);
	long	(*status)(Uart*, void*, long, long);
	void	(*fifo)(Uart*, int);
};
.
668,693d
662c
extern	int	nsyscall;
extern	char	*sysname;
.
659c
extern  Queue	*serialoq;
.
657d
655a
extern  Queue*	kprintoq;
.
651c
extern  char	*eve;
.
626d
600,601c
	char	error[ERRMAX];
	char	genbuf[128];	/* buffer used e.g. for last name element from namec */
.
541c
	QLock	*qlock;		/* addr of qlock being queued for DEBUG */
.
535,536c
	char	*text;
	char	*user;
.
395,396c
#define REND(p,s)	((p)->rendhash[(s)&((1<<RENDLOG)-1)])
#define MOUNTH(p,qid)	((p)->mnthash[(qid).path&((1<<MNTLOG)-1)])
.
389,390c
	RENDLOG	=	5,
	RENDHASH =	1<<RENDLOG,		/* Hash to lookup rendezvous tags */
	MNTLOG	=	5,
	MNTHASH =	1<<MNTLOG,		/* Hash to walk mount table */
.
268c
	char	msg[ERRMAX];
.
254,256d
232,233c
	int	mflag;
	char	*spec;
.
208a
struct Walkqid
{
	Chan	*clone;
	int	nqid;
	Qid	qid[1];
};

.
205c
	vlong length;
.
203c
	char	name[KNAMELEN];
.
196,198c
	int	(*wstat)(Chan*, uchar*, int);
.
185,187c
	Walkqid*	(*walk)(Chan*, Chan*, char**, int);
	int	(*stat)(Chan*, uchar*, int);
.
165a
	char	*version;			/* 9P version */
.
152,153c
	ulong	iounit;	/* chunk size for i/o; 0==default */
	Mhead*	umh;			/* mount point that derived Chan; used in unionread */
	Chan*	umc;			/* channel in union; held for union read */
	QLock	umqlock;		/* serialize unionreads */
.
113c
/*rsc	CCREATE	= 0x0004,		/* permits creation if c->mnt */
.
108,109c
	Amount,				/* to be mounted or mounted upon */
	Acreate,			/* is to be created */
	Aremove,			/* will be removed by caller */
.
105c
	Aaccess,			/* as in stat, wstat */
.
48d
44,45c
typedef struct Walkqid Walkqid;
typedef int    Devgen(Chan*, char*, Dirtab*, int, int, Dir*);
.
42a
typedef struct Uart	Uart;
.
26a
typedef struct PhysUart	PhysUart;
.
12d
## diffname port/portdat.h 2001/0529
## diff -e /n/emeliedump/2001/0527/sys/src/9/port/portdat.h /n/emeliedump/2001/0529/sys/src/9/port/portdat.h
199a
	void	(*power)(int);	/* power mgt: power(1) → on, power (0) → off */
	int	(*config)(int, char*, DevConf*);
.
11a
typedef struct DevConf	DevConf;
.
## diffname port/portdat.h 2001/0602
## diff -e /n/emeliedump/2001/0529/sys/src/9/port/portdat.h /n/emeliedump/2001/0602/sys/src/9/port/portdat.h
264a
	Queue	*q;		/* input queue */
.
## diffname port/portdat.h 2001/0619
## diff -e /n/emeliedump/2001/0602/sys/src/9/port/portdat.h /n/emeliedump/2001/0619/sys/src/9/port/portdat.h
744a
	void*	saveregs;		/* place to put registers on power down */
.
732a
	void	(*power)(Uart*, int);
.
## diffname port/portdat.h 2001/0731
## diff -e /n/emeliedump/2001/0619/sys/src/9/port/portdat.h /n/emeliedump/2001/0731/sys/src/9/port/portdat.h
95d
## diffname port/portdat.h 2001/0807
## diff -e /n/emeliedump/2001/0731/sys/src/9/port/portdat.h /n/emeliedump/2001/0807/sys/src/9/port/portdat.h
200c
	void	(*power)(int);	/* power mgt: power(1) => on, power (0) => off */
.
## diffname port/portdat.h 2001/0819
## diff -e /n/emeliedump/2001/0807/sys/src/9/port/portdat.h /n/emeliedump/2001/0819/sys/src/9/port/portdat.h
263a
	char	*version;			/* 9P version */
.
257c
	Lock;
	/* references are counted using c->ref; channels on this mount point incref(c->mchan) == Mnt.c */
.
169d
163d
159a
	Mnt		*mux;		/* Mnt for clients using me for messages */
.
## diffname port/portdat.h 2001/0820
## diff -e /n/emeliedump/2001/0819/sys/src/9/port/portdat.h /n/emeliedump/2001/0820/sys/src/9/port/portdat.h
263a
	int	msize;		/* data + IOHDRSZ */
.
## diffname port/portdat.h 2001/0822
## diff -e /n/emeliedump/2001/0820/sys/src/9/port/portdat.h /n/emeliedump/2001/0822/sys/src/9/port/portdat.h
612c
	char	syserror[ERRMAX];	/* last error from a system call */
	char	error[ERRMAX];		/* reason we're unwinding the error stack */
.
157a
	int	dri;			/* devdirread index */
.
## diffname port/portdat.h 2001/0904
## diff -e /n/emeliedump/2001/0822/sys/src/9/port/portdat.h /n/emeliedump/2001/0904/sys/src/9/port/portdat.h
678a
extern	uint	qiomaxatomic;
.
## diffname port/portdat.h 2001/0919
## diff -e /n/emeliedump/2001/0904/sys/src/9/port/portdat.h /n/emeliedump/2001/0919/sys/src/9/port/portdat.h
105a
	Abind,			/* for left-hand-side of bind */
.
## diffname port/portdat.h 2001/0924
## diff -e /n/emeliedump/2001/0919/sys/src/9/port/portdat.h /n/emeliedump/2001/0924/sys/src/9/port/portdat.h
614,615c
	char *syserrstr;			/* last error from a system call, errbuf0 or 1 */
	char *errstr;			/* reason we're unwinding the error stack, errbuf1 or 0 */
	char errbuf0[ERRMAX];
	char errbuf1[ERRMAX];
.
## diffname port/portdat.h 2001/1108
## diff -e /n/emeliedump/2001/0924/sys/src/9/port/portdat.h /n/emeliedump/2001/1108/sys/src/9/port/portdat.h
715,716c
	char	*buf;
	char	**f;
.
## diffname port/portdat.h 2001/1117
## diff -e /n/emeliedump/2001/1108/sys/src/9/port/portdat.h /n/emeliedump/2001/1117/sys/src/9/port/portdat.h
710a
};

enum
{
	NCMDFIELD = 128
.
584a
	ulong	privatemem;	/* proc does not let anyone read mem */
.
473,474d
## diffname port/portdat.h 2001/1118
## diff -e /n/emeliedump/2001/1117/sys/src/9/port/portdat.h /n/emeliedump/2001/1118/sys/src/9/port/portdat.h
721a
};

struct Cmdtab
{
	int	index;	/* used by client to switch on result */
	char	*cmd;	/* command name */
	int	narg;	/* expected #args; 0 ==> variadic */
.
4a
typedef struct Cmdtab	Cmdtab;
.
## diffname port/portdat.h 2001/1122
## diff -e /n/emeliedump/2001/1118/sys/src/9/port/portdat.h /n/emeliedump/2001/1122/sys/src/9/port/portdat.h
47c
typedef struct Walkqid	Walkqid;
.
44d
7d
## diffname port/portdat.h 2002/0109
## diff -e /n/emeliedump/2001/1122/sys/src/9/port/portdat.h /n/emeliedump/2002/0109/sys/src/9/port/portdat.h
187a
	void	(*shutdown)(void);
.
## diffname port/portdat.h 2002/0114
## diff -e /n/emeliedump/2002/0109/sys/src/9/port/portdat.h /n/emeliedump/2002/0114/sys/src/9/port/portdat.h
819a
#pragma varargck	argpos	panic	1
.
## diffname port/portdat.h 2002/0203
## diff -e /n/emeliedump/2002/0114/sys/src/9/port/portdat.h /n/emeliedump/2002/0203/sys/src/9/port/portdat.h
419d
## diffname port/portdat.h 2002/0217
## diff -e /n/emeliedump/2002/0203/sys/src/9/port/portdat.h /n/emeliedump/2002/0217/sys/src/9/port/portdat.h
838,840d
## diffname port/portdat.h 2002/0315
## diff -e /n/emeliedump/2002/0217/sys/src/9/port/portdat.h /n/emeliedump/2002/0315/sys/src/9/port/portdat.h
639a
	Task		*task;	/* if non-null, real-time proc, task contains scheduling params */

.
626c
	Lock		*lockwait;	/* waiting for lock to be released */
.
540a
typedef uvlong	Ticks;

struct Schedq
{
	Lock;
	Proc*	head;
	Proc*	tail;
	int	n;
};

.
41a
typedef struct Task	Task;
.
39a
typedef struct Schedq	Schedq;
.
## diffname port/portdat.h 2002/0328
## diff -e /n/emeliedump/2002/0315/sys/src/9/port/portdat.h /n/emeliedump/2002/0328/sys/src/9/port/portdat.h
641a
	ulong	nlocks;	/* number of locks held by proc */
.
638c
	Lock		*lockwait;
.
## diffname port/portdat.h 2002/0329
## diff -e /n/emeliedump/2002/0328/sys/src/9/port/portdat.h /n/emeliedump/2002/0329/sys/src/9/port/portdat.h
642a
	ulong	delaysched;
.
## diffname port/portdat.h 2002/0331
## diff -e /n/emeliedump/2002/0329/sys/src/9/port/portdat.h /n/emeliedump/2002/0331/sys/src/9/port/portdat.h
638a
	Lock		*lastlock;	/* debugging */
.
## diffname port/portdat.h 2002/0404
## diff -e /n/emeliedump/2002/0331/sys/src/9/port/portdat.h /n/emeliedump/2002/0404/sys/src/9/port/portdat.h
643c
	ulong	nlocks;		/* number of locks held by proc */
.
## diffname port/portdat.h 2002/0405
## diff -e /n/emeliedump/2002/0404/sys/src/9/port/portdat.h /n/emeliedump/2002/0405/sys/src/9/port/portdat.h
433c
	RWlock;
.
## diffname port/portdat.h 2002/0410
## diff -e /n/emeliedump/2002/0405/sys/src/9/port/portdat.h /n/emeliedump/2002/0410/sys/src/9/port/portdat.h
827a
};

/*
 * fasttick timer interrupts (Dummy for now)
 */
struct Timer
{
	uvlong	when;			/* fastticks when f should be called */
	void	(*f)(Ureg*, Timer*);
	void	*a;
	Timer	*next;
	ulong	period;
.
44a
typedef struct Timer	Timer;
.
## diffname port/portdat.h 2002/0412
## diff -e /n/emeliedump/2002/0410/sys/src/9/port/portdat.h /n/emeliedump/2002/0412/sys/src/9/port/portdat.h
829a

extern	Uart*	consuart;
.
768a
	int	(*getc)(Uart*);	/* polling versions, for iprint, rdb */
	void	(*putc)(Uart*, int);
.
## diffname port/portdat.h 2002/0502
## diff -e /n/emeliedump/2002/0412/sys/src/9/port/portdat.h /n/emeliedump/2002/0502/sys/src/9/port/portdat.h
625,628c
	char	*syserrstr;	/* last error from a system call, errbuf0 or 1 */
	char	*errstr;	/* reason we're unwinding the error stack, errbuf1 or 0 */
	char	errbuf0[ERRMAX];
	char	errbuf1[ERRMAX];
.
607a
	int	noswap;		/* process is not swappable */
.
## diffname port/portdat.h 2002/0618
## diff -e /n/emeliedump/2002/0502/sys/src/9/port/portdat.h /n/emeliedump/2002/0618/sys/src/9/port/portdat.h
205c
	int	(*config)(int, char*, DevConf*);	// returns nil on error
.
## diffname port/portdat.h 2002/0626
## diff -e /n/emeliedump/2002/0618/sys/src/9/port/portdat.h /n/emeliedump/2002/0626/sys/src/9/port/portdat.h
641a
	Lock		*lastilock;	/* debugging */
.
## diffname port/portdat.h 2002/0704
## diff -e /n/emeliedump/2002/0626/sys/src/9/port/portdat.h /n/emeliedump/2002/0704/sys/src/9/port/portdat.h
847a

struct Edfinterface {
	int		(*isedf)(Proc*);
	void		(*edfbury)(Proc*);
	int		(*edfanyready)(void);
	void		(*edfready)(Proc*);
	Proc*	(*edfrunproc)(void);
	void		(*edfblock)(Proc*);
	void		(*edfinit)(void);
	void		(*edfexpel)(Task *t);
	char *	(*edfadmit)(Task *t);
	void		(*edfdeadline)(Proc *p);
};

extern Edfinterface *edf;
.
8a
typedef struct Edfinterface	Edfinterface;
.
## diffname port/portdat.h 2002/0711
## diff -e /n/emeliedump/2002/0704/sys/src/9/port/portdat.h /n/emeliedump/2002/0711/sys/src/9/port/portdat.h
862a
/* queue state bits,  Qmsg, Qcoalesce, and Qkick can be set in qopen */
enum
{
	/* Queue.state */
	Qstarve		= (1<<0),	/* consumer starved */
	Qmsg		= (1<<1),	/* message stream */
	Qclosed		= (1<<2),	/* queue has been closed/hungup */
	Qflow		= (1<<3),	/* producer flow controlled */
	Qcoalesce	= (1<<4),	/* coallesce packets on read */
	Qkick		= (1<<5),	/* always call the kick routine after qwrite */
};


.
## diffname port/portdat.h 2002/0731
## diff -e /n/emeliedump/2002/0711/sys/src/9/port/portdat.h /n/emeliedump/2002/0731/sys/src/9/port/portdat.h
252a
	char	fromname[32];		/* temporary for debugging */
.
## diffname port/portdat.h 2002/0801
## diff -e /n/emeliedump/2002/0731/sys/src/9/port/portdat.h /n/emeliedump/2002/0801/sys/src/9/port/portdat.h
559c
	char	*kstack;			/* known to l.s */
.
## diffname port/portdat.h 2002/0821
## diff -e /n/emeliedump/2002/0801/sys/src/9/port/portdat.h /n/emeliedump/2002/0821/sys/src/9/port/portdat.h
138c
	uchar*	base;		/* start of the buffer */
.
## diffname port/portdat.h 2002/0822
## diff -e /n/emeliedump/2002/0821/sys/src/9/port/portdat.h /n/emeliedump/2002/0822/sys/src/9/port/portdat.h
861a
};

/*
 *  performance timers, all units in perfticks
 */
struct Perf
{
	ulong	intrts;		/* time of last interrupt */
	ulong	inintr;		/* time since last clock tick in interrupt handlers */
	ulong	avg_inintr;	/* avg time per clock tick in interrupt handlers */
	ulong	inidle;		/* time since last clock tick in idle loop */
	ulong	avg_inidle;	/* avg time per clock tick in idle loop */
	ulong	last;		/* value of perfticks() at last clock tick */
	ulong	period;		/* perfticks() per clock tick */
.
26a
typedef struct Perf	Perf;
.
## diffname port/portdat.h 2002/0824
## diff -e /n/emeliedump/2002/0822/sys/src/9/port/portdat.h /n/emeliedump/2002/0824/sys/src/9/port/portdat.h
592c
	int	insyscall;
.
## diffname port/portdat.h 2002/0911
## diff -e /n/emeliedump/2002/0824/sys/src/9/port/portdat.h /n/emeliedump/2002/0911/sys/src/9/port/portdat.h
254d
## diffname port/portdat.h 2002/0922
## diff -e /n/emeliedump/2002/0911/sys/src/9/port/portdat.h /n/emeliedump/2002/0922/sys/src/9/port/portdat.h
859,861c
	void		(*edfexpel)(Task*);
	char *	(*edfadmit)(Task*);
	void		(*edfdeadline)(Proc*);
	void		(*edfacquire)(Task*, CSN*);
	void		(*edfrelease)(Task*);
.
2a
typedef struct CSN	CSN;
.
## diffname port/portdat.h 2002/0924
## diff -e /n/emeliedump/2002/0922/sys/src/9/port/portdat.h /n/emeliedump/2002/0924/sys/src/9/port/portdat.h
863,864c
	void		(*resacquire)(Task*, CSN*);
	void		(*resrelease)(Task*);
.
## diffname port/portdat.h 2002/1024
## diff -e /n/emeliedump/2002/0924/sys/src/9/port/portdat.h /n/emeliedump/2002/1024/sys/src/9/port/portdat.h
841c
 * fasttick timer interrupts
.
## diffname port/portdat.h 2002/1105
## diff -e /n/emeliedump/2002/1024/sys/src/9/port/portdat.h /n/emeliedump/2002/1105/sys/src/9/port/portdat.h
664a
	int	setargs;

.
## diffname port/portdat.h 2003/0121
## diff -e /n/emeliedump/2002/1105/sys/src/9/port/portdat.h /n/emeliedump/2003/0121/sys/src/9/port/portdat.h
879c
	ulong	last;			/* value of perfticks() at last clock tick */
.
851d
847a
	ulong	period;
.
## diffname port/portdat.h 2003/0213
## diff -e /n/emeliedump/2003/0121/sys/src/9/port/portdat.h /n/emeliedump/2003/0213/sys/src/9/port/portdat.h
142c
	ushort	flag;
	ushort	checksum;		/* IP checksum of complete packet (minus media header) */
.
140c
	uchar*	base;			/* start of the buffer */
.
130a
	Bipck	=	(1<<2),		/* ip checksum */
	Budpck	=	(1<<3),		/* udp checksum */
	Btcpck	=	(1<<4),		/* tcp checksum */
	Bpktck	=	(1<<5),		/* packet checksum */
.
126a
/* flag values */
.
## diffname port/portdat.h 2003/0228
## diff -e /n/emeliedump/2003/0213/sys/src/9/port/portdat.h /n/emeliedump/2003/0228/sys/src/9/port/portdat.h
663d
660,661c
	int	quanta;		/* quanta left */
	ulong	readytime;	/* time process came ready */
.
## diffname port/portdat.h 2003/0314
## diff -e /n/emeliedump/2003/0228/sys/src/9/port/portdat.h /n/emeliedump/2003/0314/sys/src/9/port/portdat.h
660a
	uchar	yield;		/* non-zero if the process just did a sleep(0) */
.
## diffname port/portdat.h 2003/0325
## diff -e /n/emeliedump/2003/0314/sys/src/9/port/portdat.h /n/emeliedump/2003/0325/sys/src/9/port/portdat.h
444c
	Evalue	**ent;
	int nent;
	int ment;
.
## diffname port/portdat.h 2003/0326
## diff -e /n/emeliedump/2003/0325/sys/src/9/port/portdat.h /n/emeliedump/2003/0326/sys/src/9/port/portdat.h
465a
	int	exceed;			/* debugging */
.
## diffname port/portdat.h 2003/0407
## diff -e /n/emeliedump/2003/0326/sys/src/9/port/portdat.h /n/emeliedump/2003/0407/sys/src/9/port/portdat.h
332d
## diffname port/portdat.h 2003/0412
## diff -e /n/emeliedump/2003/0407/sys/src/9/port/portdat.h /n/emeliedump/2003/0412/sys/src/9/port/portdat.h
872,874c
	void	(*edfdeadline)(Proc*);
	void	(*resacquire)(Task*, CSN*);
	void	(*resrelease)(Task*);
.
868,870c
	void	(*edfblock)(Proc*);
	void	(*edfinit)(void);
	void	(*edfexpel)(Task*);
.
863,866c
	int	(*isedf)(Proc*);
	void	(*edfbury)(Proc*);
	int	(*edfanyready)(void);
	void	(*edfready)(Proc*);
.
669c
	Task	*task;		/* if non-null, real-time proc, task contains scheduling params */
.
651,653c
	Lock	*lockwait;
	Lock	*lastlock;	/* debugging */
	Lock	*lastilock;	/* debugging */
.
444,445c
	int	nent;
	int	ment;
.
221c
	vlong	length;
.
## diffname port/portdat.h 2003/0509
## diff -e /n/emeliedump/2003/0412/sys/src/9/port/portdat.h /n/emeliedump/2003/0509/sys/src/9/port/portdat.h
170a
	uchar*	dirrock;	/* directory entry rock for translations */
	int	nrock;
	int	mrock;
	QLock	rockqlock;
	int	ismtpt;
.
158c
	vlong	offset;			/* in fd */
	vlong	devoffset;			/* in underlying device; see read */
.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].