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

1992/0824/port/portdat.h (diff list | history)

1992/0811/sys/src/9/port/portdat.h:179,2011992/0824/sys/src/9/port/portdat.h:179,202 (short | long | prev | next)
Format edits. Add Crypt.next. Remove Pgrps, pgrpalloc.
rsc Fri Mar 4 12:44:25 2005
1991/1127    
{ 
1991/1207    
	char	key[DESKEYLEN];		/* des encryption key */ 
1991/1127    
	char	chal[8];		/* challenge for setting user name */ 
1992/0824    
	Crypt	*next; 
1991/1127    
}; 
 
1991/0428    
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*); 
1992/0824    
	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*); 
1991/0428    
}; 
 
struct Dirtab 
1992/0811/sys/src/9/port/portdat.h:211,2311992/0824/sys/src/9/port/portdat.h:212,234
1991/0428    
 */ 
1992/0621    
struct Etherpkt 
{ 
1991/0428    
	uchar d[6]; 
	uchar s[6]; 
	uchar type[2]; 
	uchar data[1500]; 
	uchar crc[4]; 
1992/0824    
	uchar	d[6]; 
	uchar	s[6]; 
	uchar	type[2]; 
	uchar	data[1500]; 
	uchar	crc[4]; 
1991/0428    
}; 
1991/0724    
#define	ETHERMINTU	60		/* minimum transmit size */ 
#define	ETHERMAXTU	1514		/* maximum transmit size */ 
#define ETHERHDRSIZE	14		/* size of an ethernet header */ 
1991/0428    
 
1992/0808    
/* 
 *  SCSI devices. 
 */ 
enum 
{ 
1992/0824    
	ETHERMINTU =	60,		/* minimum transmit size */ 
	ETHERMAXTU =	1514,		/* maximum transmit size */ 
	ETHERHDRSIZE =	14,		/* size of an ethernet header */ 
}; 
 
/* SCSI devices. */ 
enum 
{ 
1992/0808    
	ScsiTestunit	= 0x00, 
	ScsiExtsens	= 0x03, 
	ScsiModesense	= 0x1a, 
1992/0811/sys/src/9/port/portdat.h:233,2411992/0824/sys/src/9/port/portdat.h:236,242
1992/0808    
	ScsiRead	= 0x08, 
	ScsiWrite	= 0x0a, 
 
	/* 
	 * data direction 
	 */ 
1992/0824    
	/* data direction */ 
1992/0808    
	ScsiIn		= 1, 
	ScsiOut		= 0, 
}; 
1992/0811/sys/src/9/port/portdat.h:242,2761992/0824/sys/src/9/port/portdat.h:243,276
1992/0808    
 
struct Scsibuf 
{ 
	void *	virt; 
	void *	phys; 
	Scsibuf *next; 
1992/0824    
	void*		virt; 
	void*		phys; 
	Scsibuf*	next; 
1992/0808    
}; 
 
struct Scsidata 
{ 
	uchar *	base; 
	uchar *	lim; 
	uchar *	ptr; 
1992/0824    
	uchar*		base; 
	uchar*		lim; 
	uchar*		ptr; 
1992/0808    
}; 
 
struct Scsi 
{ 
	QLock; 
	ulong	pid; 
	ushort	target; 
	ushort	lun; 
	ushort	rflag; 
	ushort	status; 
	Scsidata cmd; 
	Scsidata data; 
	Scsibuf	*b; 
	uchar	*save; 
	uchar	cmdblk[16]; 
1992/0824    
	ulong		pid; 
	ushort		target; 
	ushort		lun; 
	ushort		rflag; 
	ushort		status; 
	Scsidata 	cmd; 
	Scsidata 	data; 
	Scsibuf*	b; 
	uchar*		save; 
	uchar		cmdblk[16]; 
1992/0808    
}; 
1991/0607    
/* 
 *  character based IO (mouse, keyboard, console screen) 
 */ 
1992/0824    
 
/* character based IO (mouse, keyboard, console screen) */ 
1991/0607    
#define NQ	4096 
struct IOQ 
{ 
1992/0811/sys/src/9/port/portdat.h:362,3681992/0824/sys/src/9/port/portdat.h:362,368
1991/0724    
	char	*top;			/* Top of swap map */ 
	Rendez	r;			/* Pager kproc idle sleep */ 
1992/0303    
	ulong	highwater;		/* Threshold beyond which we must page */ 
	ulong	headroom;		/* Space pager attempts to clear below highwater */ 
1992/0824    
	ulong	headroom;		/* Space pager keeps free under highwater */ 
1991/0705    
}swapalloc; 
 
struct Image 
1992/0811/sys/src/9/port/portdat.h:373,3791992/0824/sys/src/9/port/portdat.h:373,379
1991/0428    
	Qid	mqid; 
1991/0705    
	Chan	*mchan; 
	ushort	type;			/* Device type of owning channel */ 
	Segment *s;			/* TEXT segment for image if running, may be null */ 
1992/0824    
	Segment *s;			/* TEXT segment for image if running */ 
1991/0705    
	Image	*hash;			/* Qid hash chains */ 
	Image	*next;			/* Free list */ 
1991/0428    
}; 
1992/0811/sys/src/9/port/portdat.h:421,4351992/0824/sys/src/9/port/portdat.h:421,440
1991/0705    
	ulong	fstart;			/* start address in file for demand load */ 
	ulong	flen;			/* length of segment in file */ 
1991/0706    
	int	flushme;		/* maintain consistent icache for this segment */ 
1991/0705    
	Image	*image;			/* image in file system attached to this segment */ 
1992/0824    
	Image	*image;			/* text in file attached to this segment */ 
1991/0705    
	Page	*(*pgalloc)(ulong addr);/* SG_PHYSICAL page allocator */ 
	void	(*pgfree)(Page *);	/* SG_PHYSICAL page free */ 
	Pte	*map[SEGMAPSIZE];	/* segment pte map */ 
}; 
 
1991/0806    
#define RENDHASH	32 
1992/0824    
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 */ 
}; 
1991/0806    
#define REND(p,s)	((p)->rendhash[(s)%RENDHASH]) 
1991/1011    
#define MNTHASH		32 
#define MOUNTH(p,s)	((p)->mnthash[(s)->qid.path%MNTHASH]) 
1991/0806    
 
1991/0428    
struct Pgrp 
1992/0811/sys/src/9/port/portdat.h:436,4421992/0824/sys/src/9/port/portdat.h:441,446
1991/0428    
{ 
	Ref;				/* also used as a lock when mounting */ 
1991/0705    
	Pgrp	*next;			/* free list */ 
1991/0428    
	int	index;			/* index in pgrp table */ 
	ulong	pgrpid; 
1991/1127    
	Crypt	*crypt;			/* encryption key and challenge */ 
1991/0428    
	QLock	debug;			/* single access via devproc.c */ 
1992/0811/sys/src/9/port/portdat.h:462,4681992/0824/sys/src/9/port/portdat.h:466,471
1992/0623    
	Evalue	*link; 
}; 
 
1991/0705    
#define	NFD	100 
struct Fgrp 
{ 
	Ref; 
1992/0811/sys/src/9/port/portdat.h:470,4761992/0824/sys/src/9/port/portdat.h:473,478
1991/0705    
	int	maxfd;			/* highest fd in use */ 
}; 
 
#define PGHSIZE	512 
struct Palloc 
{ 
	Lock; 
1992/0811/sys/src/9/port/portdat.h:485,5021992/0824/sys/src/9/port/portdat.h:487,496
1991/0724    
	Rendez	r;			/* Sleep for free mem */ 
	QLock	pwait;			/* Queue of procs waiting for memory */ 
	int	wanted;			/* Do the wakeup at free */ 
1992/0824    
	ulong	cmembase;		/* Key memory protected from read by devproc */ 
	ulong	cmemtop; 
1991/0705    
}; 
 
1992/0128    
struct Pgrps 
{ 
	Lock; 
	Pgrp	*arena; 
	Pgrp	*free; 
	ulong	pgrpid; 
	ulong	cryptbase; 
	ulong	crypttop; 
}; 
                 
1991/0926    
struct Waitq 
{ 
	Waitmsg	w; 
1992/0811/sys/src/9/port/portdat.h:609,6151992/0824/sys/src/9/port/portdat.h:603,609
1992/0617    
	int	(*tfn)(void*); 
1992/0602    
 
1991/0504    
	/* 
1991/0507    
	 *  machine specific MMU goo 
1992/0824    
	 *  machine specific MMU 
1991/0504    
	 */ 
1991/0507    
	PMMU; 
1991/0428    
}; 
1992/0811/sys/src/9/port/portdat.h:629,6411992/0824/sys/src/9/port/portdat.h:623,636
1992/0625    
	Qinfo		*next; 
1991/0428    
}; 
 
/* 
 *  Queue.flag 
 */ 
1991/0724    
#define QHUNGUP	0x1			/* flag bit meaning the stream has been hung up */ 
1991/0428    
#define QINUSE	0x2 
1991/0724    
#define QHIWAT	0x4			/* queue has gone past the high water mark */	 
1991/0428    
#define QDEBUG	0x8 
1992/0824    
/* 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, 
}; 
1991/0428    
 
1992/0318    
struct Queue 
{ 
1992/0811/sys/src/9/port/portdat.h:686,6971992/0824/sys/src/9/port/portdat.h:681,692
1991/0428    
 */ 
1992/0621    
enum 
{ 
1991/0428    
	Shighqid = STREAMQID(1,0) - 1, 
	Sdataqid = Shighqid, 
	Sctlqid = Sdataqid-1, 
	Slowqid = Sctlqid, 
1992/0409    
	Streamhi= (32*1024),		/* byte count high water mark */ 
	Streambhi= 128,			/* block count high water mark */ 
1992/0824    
	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 */ 
1991/0428    
}; 
1991/1106    
 
/* 
1992/0811/sys/src/9/port/portdat.h:725,7331992/0824/sys/src/9/port/portdat.h:720,731
1992/0623    
	Netprot	*prot;			/* linked list of protections */ 
1991/1106    
}; 
1991/0428    
 
#define	PRINTSIZE	256 
1991/0724    
#define	NUMSIZE		12		/* size of formatted number */ 
1992/0726    
#define MB		(1024*1024) 
1992/0824    
enum 
{ 
	PRINTSIZE =	256, 
	NUMSIZE	=	12,		/* size of formatted number */ 
	MB =		(1024*1024), 
}; 
1991/0428    
 
extern	Conf	conf; 
1992/0625    
extern	char*	conffile; 
1992/0811/sys/src/9/port/portdat.h:748,7591992/0824/sys/src/9/port/portdat.h:746,759
1992/0321    
extern	char	sysname[NAMELEN]; 
1992/0602    
extern	Talarm	talarm; 
1992/0625    
extern	Palloc 	palloc; 
extern	Pgrps 	pgrpalloc; 
1992/0725    
extern	int	cpuserver; 
1991/0428    
 
1991/0705    
#define	CHDIR		0x80000000L 
#define	CHAPPEND 	0x40000000L 
#define	CHEXCL		0x20000000L 
1992/0824    
enum 
{ 
	CHDIR =		0x80000000L, 
	CHAPPEND = 	0x40000000L, 
	CHEXCL =	0x20000000L, 
}; 
1992/0318    
 
/* 
 * auth messages 


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