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

1991/0507/ss/dat.h (diff list | history)

ss/dat.h on 1990/1223
1990/1223    
typedef struct Conf	Conf; 
typedef struct FFrame	FFrame; 
typedef struct FPsave	FPsave; 
typedef struct KMap	KMap; 
1990/1231    
typedef struct Lance	Lance; 
typedef struct Lancemem	Lancemem; 
1990/1223    
typedef struct Label	Label; 
typedef struct Lock	Lock; 
1991/0507    
typedef struct PMMU	PMMU; 
1990/1223    
typedef struct Mach	Mach; 
typedef struct Ureg	Ureg; 
typedef struct User	User; 
 
 
1991/0428    
#define	MACHP(n)	(n==0? &mach0 : *(Mach**)0) 
1990/1223    
 
1991/0428    
extern	Mach	mach0; 
extern  void	(*kprofp)(ulong); 
 
/* 
 *  parameters for sysproc.c 
 */ 
#define AOUT_MAGIC	K_MAGIC 
 
/* 
 *  machine dependent definitions used by ../port/dat.h 
 */ 
 
1990/1223    
struct Lock 
{ 
1990/1226    
	ulong	key; 
1990/1223    
	ulong	pc; 
}; 
 
struct Label 
{ 
	ulong	sp; 
	ulong	pc; 
}; 
 
1991/0428    
/* 
 * floating point registers 
 */ 
enum 
1990/1223    
{ 
1991/0428    
	FPinit, 
	FPactive, 
	FPinactive, 
1990/1223    
}; 
 
struct	FPsave 
{ 
1991/01151    
	long	fsr; 
	long	fpreg[32+1];	/* +1 so we can double-align */ 
1990/1223    
}; 
 
struct Conf 
{ 
	int	nmach;		/* processors */ 
	int	nproc;		/* processes */ 
	int	npgrp;		/* process groups */ 
	ulong	npage0;		/* total physical pages of memory, bank 0 */ 
	ulong	npage1;		/* total physical pages of memory, bank 1 */ 
	ulong	base0;		/* base of bank 0 */ 
	ulong	base1;		/* base of bank 1 */ 
	ulong	npage;		/* total physical pages of memory */ 
	ulong	norig;		/* origins */ 
	ulong	npte;		/* contiguous page table entries */ 
	ulong	nmod;		/* single (modifying) page table entries */ 
	int	nalarm;		/* alarms */ 
	int	nchan;		/* channels */ 
	int	nenv;		/* distinct environment values */ 
	int	nenvchar;	/* environment text storage */ 
	int	npgenv;		/* environment files per process group */ 
	int	nmtab;		/* mounted-upon channels per process group */ 
	int	nmount;		/* mounts */ 
	int	nmntdev;	/* mounted devices (devmnt.c) */ 
	int	nmntbuf;	/* buffers for devmnt.c messages */ 
	int	nmnthdr;	/* headers for devmnt.c messages */ 
	int	nstream;	/* streams */ 
	int	nqueue;		/* stream queues */ 
	int	nblock;		/* stream blocks */ 
	int	nsrv;		/* public servers (devsrv.c) */ 
	int	nbitmap;	/* bitmap structs (devbit.c) */ 
	int	nbitbyte;	/* bytes of bitmap data (devbit.c) */ 
	int	nfont;		/* font structs (devbit.c) */ 
1990/1231    
	ulong	nnoifc;		/* number of nonet interfaces */ 
	ulong	nnoconv;	/* number of nonet conversations/ifc */ 
1990/1223    
	int	nurp;		/* max urp conversations */ 
	int	nasync;		/* number of async protocol modules */ 
	int	npipe;		/* number of pipes */ 
	int	nservice;	/* number of services */ 
	int	nfsyschan;	/* number of filsys open channels */ 
	ulong	maxialloc;	/* maximum bytes used by ialloc */ 
	int	copymode;	/* 0 is copy on write, 1 is copy on reference */ 
1991/0507    
}; 
 
/* 
 *  mmu goo in the Proc structure 
 */ 
struct PMMU 
{ 
	int	pidonmach[MAXMACH]; 
	int	nmmuseg;	/* number of segments active in mmu */ 
1990/1223    
}; 
 
1991/0428    
#include "../port/portdat.h" 
1990/1223    
 
1991/0428    
/* 
 *  machine dependent definitions not used by ../port/dat.h 
 */ 
1990/1223    
struct KMap 
{ 
	KMap	*next; 
	ulong	pa; 
	ulong	va; 
}; 
#define	VA(k)	((k)->va) 
 
struct Mach 
{ 
	int	machno;			/* physical id of processor */ 
	ulong	splpc;			/* pc of last caller to splhi */ 
	int	mmask;			/* 1<<m->machno */ 
	ulong	ticks;			/* of the clock since boot time */ 
	Proc	*proc;			/* current process on this processor */ 
	Proc	*lproc;			/* last process on this processor */ 
	Label	sched;			/* scheduler wakeup */ 
	Lock	alarmlock;		/* access to alarm list */ 
	void	*alarm;			/* alarms bound to this clock */ 
	int	fpstate;		/* state of fp registers on machine */ 
1991/0110    
	char	pidhere[NTLBPID];	/* is this tlbpid possibly in this mmu? */ 
1990/1226    
	int	lastpid;		/* last pid allocated on this machine */ 
1991/0110    
	Proc	*pidproc[NTLBPID];	/* process that owns this pid on this mach */ 
1991/0427    
 
	int	tlbfault; 
	int	tlbpurge; 
	int	pfault; 
	int	cs; 
	int	syscall; 
	int	spinlock; 
	int	intr; 
 
1990/1223    
	int	stack[1]; 
}; 
 
#define	NERR	15 
#define	NNOTE	5 
#define	NFD	100 
struct User 
{ 
	Proc	*p; 
	int	nerrlab; 
	Label	errlab[NERR]; 
	char	error[ERRLEN]; 
	FPsave	fpsave;			/* address of this is known by vdb */ 
	char	elem[NAMELEN];		/* last name element from namec */ 
	Chan	*slash; 
	Chan	*dot; 
	Chan	*fd[NFD]; 
	int	maxfd;			/* highest fd in use */ 
	/* 
	 * Rest of structure controlled by devproc.c and friends. 
	 * lock(&p->debug) to modify. 
	 */ 
	Note	note[NNOTE]; 
	short	nnote; 
	short	notified;		/* sysnoted is due */ 
	int	(*notify)(void*, char*); 
	void	*ureg; 
}; 
 
/* 
1991/0109    
 *  LANCE CSR3 (bus control bits) 
 */ 
#define BSWP	0x4 
#define ACON	0x2 
#define BCON	0x1 
1990/1231    
 
/* 
 *  system dependent lance stuff 
 *  filled by lancesetup()  
 */ 
struct Lance 
{ 
	ushort	lognrrb;	/* log2 number of receive ring buffers */ 
	ushort	logntrb;	/* log2 number of xmit ring buffers */ 
	ushort	nrrb;		/* number of receive ring buffers */ 
	ushort	ntrb;		/* number of xmit ring buffers */ 
	ushort	*rap;		/* lance address register */ 
	ushort	*rdp;		/* lance data register */ 
1991/0109    
	ushort	busctl;		/* bus control bits */ 
1990/1231    
	uchar	ea[6];		/* our ether addr */ 
	int	sep;		/* separation between shorts in lance ram 
				    as seen by host */ 
	ushort	*lanceram;	/* start of lance ram as seen by host */ 
	Lancemem *lm;		/* start of lance ram as seen by lance */ 
	Etherpkt *rp;		/* receive buffers (host address) */ 
	Etherpkt *tp;		/* transmit buffers (host address) */ 
	Etherpkt *lrp;		/* receive buffers (lance address) */ 
	Etherpkt *ltp;		/* transmit buffers (lance address) */ 
}; 
1990/1223    
 
1990/1226    
extern register Mach	*m;		/* R6 */ 
extern register User	*u;		/* R5 */ 
1990/1223    
 
1991/0110    
extern	uchar	*intrreg; 


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