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

1992/0726/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    
}; 
 
1992/0726    
#define	NFPQ	4	/* just a guess */ 
 
1990/1223    
struct	FPsave 
{ 
1991/01151    
	long	fsr; 
1991/1113    
	long	fpreg[32]; 
1992/0726    
	struct{ 
		ulong	a;	/* address */ 
		ulong	i;	/* instruction */ 
	}q[NFPQ]; 
1990/1223    
}; 
 
struct Conf 
{ 
	int	nmach;		/* processors */ 
	int	nproc;		/* processes */ 
	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 */ 
1991/0706    
	ulong	nimage;		/* number of page cache image headers */ 
	ulong	nswap;		/* number of swap blocks */ 
1992/0619    
	ulong	upages;		/* number of user pages */ 
1990/1223    
	int	copymode;	/* 0 is copy on write, 1 is copy on reference */ 
1991/0926    
	ulong	ipif;		/* Ip protocol interfaces */ 
	ulong	ip;		/* Ip conversations per interface */ 
	ulong	arp;		/* Arp table size */ 
	ulong	frag;		/* Ip fragment assemble queue size */ 
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; 
1991/1112    
	int	load; 
1991/0427    
	int	intr; 
 
1990/1223    
	int	stack[1]; 
}; 
 
#define	NERR	15 
#define	NNOTE	5 
struct User 
{ 
	Proc	*p; 
1991/1113    
					/* &fpsave must be 4 mod 8 */ 
	FPsave	fpsave;			/* address of this is known by db */ 
1992/06271    
	int	scallnr;		/* sys call number - known by db */ 
	Sargs	s;			/* address of this is known by db */ 
1990/1223    
	int	nerrlab; 
	Label	errlab[NERR]; 
	char	error[ERRLEN]; 
	char	elem[NAMELEN];		/* last name element from namec */ 
	Chan	*slash; 
	Chan	*dot; 
	/* 
	 * Rest of structure controlled by devproc.c and friends. 
	 * lock(&p->debug) to modify. 
	 */ 
1991/0717    
	ulong	svpsr; 
1990/1223    
	Note	note[NNOTE]; 
	short	nnote; 
	short	notified;		/* sysnoted is due */ 
1991/0717    
	Note	lastnote; 
1990/1223    
	int	(*notify)(void*, char*); 
	void	*ureg; 
1991/1111    
	void	*dbgreg;		/* User registers for debugging in proc */ 
1992/0102    
	ulong	svr7; 
1990/1223    
}; 
 
/* 
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; 
1991/0604    
 
struct 
{ 
	Lock; 
	short	machs; 
	short	exiting; 
}active; 


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