plan 9 kernel history: overview | file list | diff list

1991/0724/port/portdat.h (diff list | history)

1991/0706/sys/src/9/port/portdat.h:63,691991/0724/sys/src/9/port/portdat.h:63,69 (short | long | prev | next)
Format edit, remove blank lines.
rsc Fri Mar 4 12:44:25 2005
1991/0428    
	List; 
	Lock; 
	int	busy; 
	long	dt;		/* may underflow in clock(); must be signed */ 
1991/0724    
	long	dt;			/* may underflow in clock(); must be signed */ 
1991/0428    
	void	(*f)(void*); 
	void	*arg; 
}; 
1991/0706/sys/src/9/port/portdat.h:86,951991/0724/sys/src/9/port/portdat.h:86,95
1991/0428    
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 */ 
1991/0724    
	uchar	*rptr;			/* first unconsumed byte */ 
	uchar	*wptr;			/* first empty byte */ 
	uchar	*lim;			/* 1 past the end of the buffer */ 
	uchar	*base;			/* start of the buffer */ 
1991/0428    
	uchar	flags; 
	uchar	type; 
}; 
1991/0706/sys/src/9/port/portdat.h:96,1051991/0724/sys/src/9/port/portdat.h:96,105
1991/0428    
 
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 */ 
1991/0724    
	Block	*first;			/* first data block */ 
	Block	*last;			/* last data block */ 
	long	len;			/* length of list in bytes */ 
	int	nb;			/* number of blocks in list */ 
1991/0428    
}; 
 
/* 
1991/0706/sys/src/9/port/portdat.h:107,1271991/0724/sys/src/9/port/portdat.h:107,127
1991/0428    
 */ 
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 */ 
1991/0724    
	Aaccess,			/* as in access, stat */ 
	Atodir,				/* as in chdir */ 
	Aopen,				/* for i/o */ 
	Amount,				/* to be mounted upon */ 
	Acreate,			/* file is to be created */ 
1991/0428    
}; 
 
/* 
 *  Chan.flags 
 */ 
#define	COPEN	1	/* for i/o */ 
#define	CMOUNT	2	/* is result of a mount/bind */ 
#define	CCREATE	4	/* permits creation if CMOUNT */ 
#define	CCEXEC	8	/* close on exec */ 
#define	CFREE	16	/* not in use */ 
1991/0724    
#define	COPEN	1			/* for i/o */ 
#define	CMOUNT	2			/* is result of a mount/bind */ 
#define	CCREATE	4			/* permits creation if CMOUNT */ 
#define	CCEXEC	8			/* close on exec */ 
#define	CFREE	16			/* not in use */ 
1991/0428    
 
struct Chan 
{ 
1991/0706/sys/src/9/port/portdat.h:200,2081991/0724/sys/src/9/port/portdat.h:200,208
1991/0428    
	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 */ 
1991/0724    
#define	ETHERMINTU	60		/* minimum transmit size */ 
#define	ETHERMAXTU	1514		/* maximum transmit size */ 
#define ETHERHDRSIZE	14		/* size of an ethernet header */ 
1991/0428    
 
1991/0607    
/* 
 *  character based IO (mouse, keyboard, console screen) 
1991/0706/sys/src/9/port/portdat.h:287,2981991/0724/sys/src/9/port/portdat.h:287,298
1991/0705    
 
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 */ 
1991/0724    
	Lock;				/* Free map lock */ 
	int	free;			/* Number of currently free swap pages */ 
	char	*swmap;			/* Base of swap map in memory */ 
	char	*alloc;			/* Round robin allocator */ 
	char	*top;			/* Top of swap map */ 
	Rendez	r;			/* Pager kproc idle sleep */ 
1991/0705    
}swapalloc; 
 
struct Image 
1991/0706/sys/src/9/port/portdat.h:390,4061991/0724/sys/src/9/port/portdat.h:390,406
1991/0705    
	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 */ 
1991/0724    
	Page	*page;			/* base of Page structures */ 
	ulong	minppn;			/* index of first usable page */ 
	Page	*head;			/* most recently used */ 
	Page	*tail;			/* least recently used */ 
	ulong	freecount;		/* how many pages on free list now */ 
	ulong	user;			/* how many user pages */ 
1991/0705    
	Page	*hash[PGHSIZE]; 
	Lock	hashlock; 
	Rendez	r;		/* Sleep for free mem */ 
	QLock	pwait;		/* Queue of procs waiting for memory */ 
	int	wanted;		/* Do the wakeup at free */ 
1991/0724    
	Rendez	r;			/* Sleep for free mem */ 
	QLock	pwait;			/* Queue of procs waiting for memory */ 
	int	wanted;			/* Do the wakeup at free */ 
1991/0705    
}; 
 
1991/0514    
enum					/* Argument to forkpgrp call */ 
1991/0706/sys/src/9/port/portdat.h:523,5591991/0724/sys/src/9/port/portdat.h:523,559
1991/0428    
/* 
 *  Queue.flag 
 */ 
#define QHUNGUP	0x1	/* flag bit meaning the stream has been hung up */ 
1991/0724    
#define QHUNGUP	0x1			/* flag bit meaning the stream has been hung up */ 
1991/0428    
#define QINUSE	0x2 
#define QHIWAT	0x4	/* queue has gone past the high water mark */	 
1991/0724    
#define QHIWAT	0x4			/* queue has gone past the high water mark */	 
1991/0428    
#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 */ 
1991/0724    
	Qinfo	*info;			/* line discipline definition */ 
	Queue	*other;			/* opposite direction, same line discipline */ 
	Queue	*next;			/* next queue in the stream */ 
1991/0428    
	void	(*put)(Queue*, Block*); 
	QLock	rlock;		/* mutex for processes sleeping at r */ 
	Rendez	r;		/* standard place to wait for flow control */ 
	Rendez	*rp;		/* where flow control wakeups go to */ 
	void	*ptr;		/* private info for the queue */ 
1991/0724    
	QLock	rlock;			/* mutex for processes sleeping at r */ 
	Rendez	r;			/* standard place to wait for flow control */ 
	Rendez	*rp;			/* where flow control wakeups go to */ 
	void	*ptr;			/* private info for the queue */ 
1991/0428    
}; 
 
struct Stream { 
	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 */ 
1991/0502    
	int	forcedelim;	/* force a delimiter before the next message */ 
1991/0724    
	QLock;				/* structure lock */ 
	short	inuse;			/* number of processes in stream */ 
	short	opens;			/* number of processes with stream open */ 
	ushort	hread;			/* number of reads after hangup */ 
	ushort	type;			/* correlation with Chan */ 
	ushort	dev;			/* ... */ 
	ushort	id;			/* ... */ 
	QLock	rdlock;			/* read lock */ 
	Queue	*procq;			/* write queue at process end */ 
	Queue	*devq;			/* read queue at device end */ 
	Block	*err;			/* error message from down stream */ 
	int	forcedelim;		/* force a delimiter before the next message */ 
1991/0428    
}; 
 
/* 
1991/0706/sys/src/9/port/portdat.h:578,5901991/0724/sys/src/9/port/portdat.h:578,590
1991/0428    
	Sdataqid = Shighqid, 
	Sctlqid = Sdataqid-1, 
	Slowqid = Sctlqid, 
	Streamhi= (9*1024),	/* byte count high water mark */ 
	Streambhi= 32,		/* block count high water mark */ 
1991/0724    
	Streamhi= (9*1024),		/* byte count high water mark */ 
	Streambhi= 32,			/* block count high water mark */ 
1991/0428    
}; 
 
1991/0614    
#define MAXSYSARG	6	/* for mount(fd, mpt, flag, arg, srv, authfd) */ 
1991/0724    
#define MAXSYSARG	6		/* for mount(fd, mpt, flag, arg, srv, authfd) */ 
1991/0428    
#define	PRINTSIZE	256 
#define	NUMSIZE	12		/* size of formatted number */ 
1991/0724    
#define	NUMSIZE		12		/* size of formatted number */ 
1991/0428    
 
extern	FPsave	initfp; 
extern	Conf	conf; 
1991/0706/sys/src/9/port/portdat.h:600,6051991/0724/sys/src/9/port/portdat.h:600,602
1991/0705    
#define	CHDIR		0x80000000L 
#define	CHAPPEND 	0x40000000L 
#define	CHEXCL		0x20000000L 
1991/0428    
                 
                 
                 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)