⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 portdat.h

📁 著名操作系统Plan 9的第三版的部分核心源代码。现在很难找到了。Plan 9是bell实验室开发的Unix后继者。
💻 H
📖 第 1 页 / 共 2 页
字号:
	Pte	**map;	int	mapsize;	Pte	*ssegmap[SSEGMAPSIZE];};enum{	RENDHASH =	32,		/* Hash to lookup rendezvous tags */	MNTHASH	=	32,		/* Hash to walk mount table */	NFD =		100,		/* per process file descriptors */	PGHLOG  =	9,	PGHSIZE	=	1<<PGHLOG,	/* Page hash for image lookup */};#define REND(p,s)	((p)->rendhash[(s)%RENDHASH])#define MOUNTH(p,s)	((p)->mnthash[(s)->qid.path%MNTHASH])struct Pgrp{	Ref;				/* also used as a lock when mounting */	int	noattach;	ulong	pgrpid;	QLock	debug;			/* single access via devproc.c */	RWlock	ns;			/* Namespace n read/one write lock */	QLock	nsh;	Mhead	*mnthash[MNTHASH];};struct Rgrp{	Ref;	Proc	*rendhash[RENDHASH];	/* Rendezvous tag hash */};struct Egrp{	Ref;	QLock;	Evalue	*entries;	ulong	path;	/* qid.path of next Evalue to be allocated */	ulong	vers;	/* of Egrp */};struct Evalue{	char	*name;	char	*value;	int	len;	Evalue	*link;	Qid	qid;};struct Fgrp{	Ref;	Chan	**fd;	int	nfd;			/* number allocated */	int	maxfd;			/* highest fd in use */};enum{	DELTAFD	= 20		/* incremental increase in Fgrp.fd's */};struct Palloc{	Lock;	ulong	p0, p1;			/* base of pages in bank 0/1 */	ulong	np0, np1;		/* number of pages in bank 0/1 */	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 */	ulong	cmembase;		/* Key memory */	ulong	cmemtop;};struct Waitq{	Waitmsg	w;	Waitq	*next;};enum{	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),	RFREND		= (1<<13),	RFNOMNT		= (1<<14),};/* *  process memory segments - NSEG always last ! */enum{	SSEG, TSEG, DSEG, BSEG, ESEG, LSEG, SEG1, SEG2, SEG3, SEG4, NSEG};enum{	Dead = 0,		/* Process states */	Moribund,	Ready,	Scheding,	Running,	Queueing,	QueueingR,	QueueingW,	Wakeme,	Broken,	Stopped,	Rendezvous,	Proc_stopme = 1, 	/* devproc requests */	Proc_exitme,	Proc_traceme,	Proc_exitbig,	TUser = 0, 		/* Proc.time */	TSys,	TReal,	TCUser,	TCSys,	TCReal,	NERR = 15,	NNOTE = 5,	Nrq		= 20,	/* number of scheduler priority levels */	PriLock		= 0,	/* priority for processes waiting on a lock */	PriNormal	= 10,	/* base priority for normal processes */	PriKproc	= 13,	/* base priority for kernel processes */	PriRoot		= 13,	/* base priority for root processes */};struct Proc{	Label	sched;		/* known to l.s */	char	*kstack;	/* known to l.s */	Mach	*mach;		/* machine running this proc */	char	text[NAMELEN];	char	user[NAMELEN];	Proc	*rnext;		/* next process in run queue */	Proc	*qnext;		/* next process on queue for a QLock */	QLock	*qlock;		/* addrof qlock being queued for DEBUG */	int	state;	char	*psstate;	/* What /proc/#/status reports */	Segment	*seg[NSEG];	QLock	seglock;	/* locked whenever seg[] changes */	ulong	pid;	ulong	noteid;		/* Equivalent of note group */	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 */	QLock	qwaitr;	Rendez	waitr;		/* Place to hang out in wait */	Proc	*parent;	Pgrp	*pgrp;		/* Process group for namespace */	Egrp 	*egrp;		/* Environment group */	Fgrp	*fgrp;		/* File descriptor group */	Rgrp	*rgrp;		/* Rendez group */	ulong	parentpid;	ulong	time[6];	/* User, Sys, Real; child U, S, R */	short	insyscall;	int	fpstate;	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 */	Lock	rlock;		/* sync sleep/wakeup with postnote */	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, I must flush */	ulong	rendtag;	/* Tag for rendezvous */	ulong	rendval;	/* Value for rendezvous */	Proc	*rendhash;	/* Hash list for tag values */	ulong	twhen;	Rendez	*trend;	Proc	*tlink;	int	(*tfn)(void*);	void	(*kpfun)(void*);	void	*kparg;	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*);	int	lockwait;	/* waiting for lock to be released */	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 */	int	preempted;	/* true if this process hasn't finished the interrupt				 *  that last preempted it				 */	ulong	qpc;		/* pc calling last blocking qlock */	void	*ureg;		/* User registers for notes */	void	*dbgreg;	/* User registers for devproc */	Notsave;	/*	 *  machine specific MMU	 */	PMMU;};enum{	PRINTSIZE =	256,	MAXCRYPT = 	127,	NUMSIZE	=	12,		/* size of formatted number */	MB =		(1024*1024),	READSTR =	1000,		/* temporary buffer size for device reads */};extern	Conf	conf;extern	char*	conffile;extern	int	cpuserver;extern	Dev*	devtab[];extern  char	eve[];extern	char	hostdomain[];extern	uchar	initcode[];extern	FPsave	initfp;extern  Queue*	kbdq;extern  Ref	noteidalloc;extern	int	nrdy;extern	Palloc	palloc;extern  Queue	*printq;extern	char*	statename[];extern  Image	swapimage;extern	char	sysname[NAMELEN];extern	Pthash	syspt;extern	Talarm	talarm;enum{	CHDIR =		0x80000000L,	CHAPPEND = 	0x40000000L,	CHEXCL =	0x20000000L,	CHMOUNT	=	0x10000000L,};/* * auth messages */enum{	FScchal	= 1,	FSschal,	FSok,	FSctick,	FSstick,	FSerr,	RXschal	= 0,	RXstick	= 1,	AUTHLEN	= 8,};enum{	LRESPROF	= 3,};/* *  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[256];	char	*f[16];	int	nf;};extern int nsyscall;#define DEVDOTDOT -1#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*#pragma	varargck	type	"p"	void*

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -