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

1994/0209/carrera/mem.h (diff list | history)

1993/1230/sys/src/9/carrera/mem.h:7,261994/0209/sys/src/9/carrera/mem.h:7,26 (short | long | prev | next)
1993/0903    
 */ 
 
#define	BI2BY		8			/* bits per byte */ 
#define BI2WD		32			/* bits per word */ 
1994/0209    
#define	BI2WD		32			/* bits per word */ 
1993/0903    
#define	BY2WD		4			/* bytes per word */ 
#define	BY2PG		4096			/* bytes per page */ 
#define	WD2PG		(BY2PG/BY2WD)		/* words per page */ 
#define	PGSHIFT		12			/* log(BY2PG) */ 
#define PGROUND(s)	(((s)+(BY2PG-1))&~(BY2PG-1)) 
1994/0209    
#define	PGROUND(s)	(((s)+(BY2PG-1))&~(BY2PG-1)) 
1993/0903    
 
1993/1211    
#define	MAXMACH		1			/* max # cpus system can run */ 
1993/0903    
#define KSTACK		4096			/* Size of kernel stack */ 
1994/0209    
#define	KSTACK		4096			/* Size of kernel stack */ 
1993/0903    
 
/* 
 * Time 
 */ 
#define HZ		100			/* clock frequency */ 
1994/0209    
#define	HZ		100			/* clock frequency */ 
1993/0903    
#define	MS2HZ		(1000/HZ)		/* millisec per clock tick */ 
#define	TK2SEC(t)	((t)/HZ)		/* ticks to seconds */ 
#define	TK2MS(t)	((t)*MS2HZ)		/* ticks to milliseconds */ 
1993/1230/sys/src/9/carrera/mem.h:96,1481994/0209/sys/src/9/carrera/mem.h:96,148
1993/0903    
 * Fundamental addresses 
 */ 
1993/1211    
#define	MACHADDR	(KTZERO-MAXMACH*BY2PG)	/* warning: rdbg is near here */ 
1993/0906    
#define UREGSIZE	0xA0		/* Sizeof(Ureg)+retpc & ur */ 
1994/0209    
#define	UREGSIZE	0xC0		/* Sizeof(Ureg)+R5,R6+16 bytes slop+retpc & ur */ 
1993/0903    
#define	MACHP(n)	((Mach *)(MACHADDR+(n)*BY2PG)) 
 
/* 
 * MMU 
 */ 
#define PGSZ4K		(0x00<<13) 
1993/0904    
#define PGSZ64K		(0x0F<<13) 
1993/0903    
#define PGSZ256K	(0x3F<<13) 
1993/0907    
#define PGSZ1M		(0xFF<<13) 
1994/0209    
#define	PGSZ4K		(0x00<<13) 
#define	PGSZ64K		(0x0F<<13) 
#define	PGSZ256K	(0x3F<<13) 
#define	PGSZ1M		(0xFF<<13) 
1993/0903    
	 
#define	KUSEG	0x00000000 
#define KSEG0	0x80000000 
#define KSEG1	0xA0000000 
1994/0209    
#define	KSEG0	0x80000000 
#define	KSEG1	0xA0000000 
1993/0903    
#define	KSEG2	0xC0000000 
#define	KSEG3	0xE0000000 
#define	KSEGM	0xE0000000	/* mask to check which seg */ 
 
#define PIDXSHFT	12 
#define PIDX		(0x7<<PIDXSHFT) 
1994/0209    
#define	PIDXSHFT	12 
#define	PIDX		(0x7<<PIDXSHFT) 
1993/1218    
#define	KMAPADDR	0xE2000000 
1993/0906    
#define KMAPMASK	0xFF000000 
1993/0903    
#define KMAPSHIFT	15 
#define NCOLOR		8 
1993/0906    
#define getpgcolor(a)	(((ulong)(a)>>PIDXSHFT)&7) 
1994/0209    
#define	KMAPMASK	0xFF000000 
#define	KMAPSHIFT	15 
#define	NCOLOR		8 
#define	getpgcolor(a)	(((ulong)(a)>>PIDXSHFT)&7) 
1993/0903    
 
#define	PTEGLOBL	(1<<0) 
#define	PTEVALID	(1<<1) 
#define	PTEWRITE	(1<<2) 
#define PTERONLY	0 
#define PTEALGMASK	(7<<3) 
#define PTEUNCACHED	(2<<3) 
#define PTENONCOHER	(3<<3) 
#define PTECOHERXCL	(4<<3) 
#define PTECOHERXCLW	(5<<3) 
#define PTECOHERUPDW	(6<<3) 
1993/0908    
#define IOPTE		(PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED) 
1994/0209    
#define	PTERONLY	0 
#define	PTEALGMASK	(7<<3) 
#define	PTEUNCACHED	(2<<3) 
#define	PTENONCOHER	(3<<3) 
#define	PTECOHERXCL	(4<<3) 
#define	PTECOHERXCLW	(5<<3) 
#define	PTECOHERUPDW	(6<<3) 
#define	IOPTE		(PTEGLOBL|PTEVALID|PTEWRITE|PTEUNCACHED) 
1993/0903    
 
#define	PTEPID(n)	(n) 
#define TLBPID(n)	((n)&0xFF) 
#define PTEMAPMEM	(1024*1024)	 
1994/0209    
#define	TLBPID(n)	((n)&0xFF) 
#define	PTEMAPMEM	(1024*1024)	 
1993/0903    
#define	PTEPERTAB	(PTEMAPMEM/BY2PG) 
#define STLBLOG		13 
#define STLBSIZE	(1<<STLBLOG) 
1993/1224    
#define KPTELOG		7 
1993/0903    
#define KPTESIZE	(1<<KPTELOG) 
#define SEGMAPSIZE	512 
1994/0209    
#define	STLBLOG		13 
#define	STLBSIZE	(1<<STLBLOG) 
#define	KPTELOG		7 
#define	KPTESIZE	(1<<KPTELOG) 
#define	SEGMAPSIZE	512 
1993/0903    
 
#define	NTLBPID	256	/* number of pids */ 
#define	NTLB	48	/* number of entries */ 
1993/1230/sys/src/9/carrera/mem.h:156,1621994/0209/sys/src/9/carrera/mem.h:156,162
1993/0903    
#define	UTZERO	(UZERO+BY2PG)		/* first address in user text */ 
#define	USTKTOP	(KZERO-BY2PG)		/* byte just beyond user stack */ 
#define	TSTKTOP	(0xC0000000+USTKSIZE-BY2PG) /* top of temporary stack */ 
#define TSTKSIZ 100 
1994/0209    
#define	TSTKSIZ 100 
1993/0903    
#define	KZERO	KSEG0			/* base of kernel address space */ 
#define	KTZERO	(KZERO+0x20000)		/* first address in kernel text */ 
#define	USTKSIZE	(4*1024*1024)	/* size of user stack */ 


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