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

1991/0719/gnot/mem.h (diff list | history)

1990/03091/sys/src/9/gnot/mem.h:12,181990/0611/sys/src/9/gnot/mem.h:12,18 (short | long)
1990/03091    
#define	BY2PG		8192			/* bytes per page */ 
#define	WD2PG		(BY2PG/BY2WD)		/* words per page */ 
#define	PGSHIFT		13			/* log(BY2PG) */ 
#define	MS2HZ		16	/* BUG */	/* millisec per clock tick */ 
1990/0611    
#define	MS2HZ		(1000/60)		/* millisec per clock tick */ 
1990/03091    
 
#define	MAXMACH		1			/* max # cpus system can run */ 
 
1990/0611/sys/src/9/gnot/mem.h:12,201990/06111/sys/src/9/gnot/mem.h:12,27 (short | long)
1990/03091    
#define	BY2PG		8192			/* bytes per page */ 
#define	WD2PG		(BY2PG/BY2WD)		/* words per page */ 
#define	PGSHIFT		13			/* log(BY2PG) */ 
1990/0611    
#define	MS2HZ		(1000/60)		/* millisec per clock tick */ 
1990/03091    
 
#define	MAXMACH		1			/* max # cpus system can run */ 
1990/06111    
 
/* 
 * Time 
 */ 
#define	MS2HZ		(1000/60)		/* millisec per clock tick */ 
#define	TK2SEC(t)	((t)/60)		/* ticks to seconds */ 
#define	TK2MS(t)	(((t)*1000)/60)		/* ticks to milliseconds */ 
#define	MS2TK(t)	(((t)*60)/1000)		/* milliseconds to ticks */ 
1990/03091    
 
/* 
 * SR bits 
1990/06111/sys/src/9/gnot/mem.h:18,271990/08101/sys/src/9/gnot/mem.h:18,28 (short | long)
1990/06111    
/* 
 * Time 
 */ 
#define	MS2HZ		(1000/60)		/* millisec per clock tick */ 
#define	TK2SEC(t)	((t)/60)		/* ticks to seconds */ 
#define	TK2MS(t)	(((t)*1000)/60)		/* ticks to milliseconds */ 
#define	MS2TK(t)	(((t)*60)/1000)		/* milliseconds to ticks */ 
1990/08101    
#define	HZ		(60)			/* clock frequency */ 
#define	MS2HZ		(1000/HZ)		/* millisec per clock tick */ 
#define	TK2SEC(t)	((t)/HZ)		/* ticks to seconds */ 
#define	TK2MS(t)	(((t)*1000)/HZ)		/* ticks to milliseconds */ 
#define	MS2TK(t)	(((t)*HZ)/1000)		/* milliseconds to ticks */ 
1990/03091    
 
/* 
 * SR bits 
1990/06111/sys/src/9/gnot/mem.h:59,641990/08101/sys/src/9/gnot/mem.h:60,66
1990/03091    
 * MMU 
 */ 
 
1990/08101    
#define	VAMASK	0xCFFFFFFF	/* clear balu bits in address */ 
1990/03091    
#define	KUSEG	0x00000000 
#define KSEG	0x80000000 
 
1990/08101/sys/src/9/gnot/mem.h:95,1001990/0821/sys/src/9/gnot/mem.h:95,101 (short | long)
1990/03091    
#define	USTKTOP	(TSTKTOP-100*BY2PG)	/* byte just beyond user stack */ 
#define	KZERO	KSEG			/* base of kernel address space */ 
#define	KTZERO	(KZERO+BY2PG)		/* first address in kernel text */ 
1990/0821    
#define	USTACKSIZE	(4*1024*1024)	/* size of user stack */ 
1990/03091    
 
#define	NSEG		5 
#define	MACHSIZE	4096 
1990/0821/sys/src/9/gnot/mem.h:21,281990/1012/sys/src/9/gnot/mem.h:21,28 (short | long)
1990/08101    
#define	HZ		(60)			/* clock frequency */ 
#define	MS2HZ		(1000/HZ)		/* millisec per clock tick */ 
#define	TK2SEC(t)	((t)/HZ)		/* ticks to seconds */ 
#define	TK2MS(t)	(((t)*1000)/HZ)		/* ticks to milliseconds */ 
#define	MS2TK(t)	(((t)*HZ)/1000)		/* milliseconds to ticks */ 
1990/1012    
#define	TK2MS(t)	((((ulong)(t))*1000)/HZ)	/* ticks to milliseconds */ 
#define	MS2TK(t)	((((ulong)(t))*HZ)/1000)	/* milliseconds to ticks */ 
1990/03091    
 
/* 
 * SR bits 
1990/1012/sys/src/9/gnot/mem.h:68,731990/1212/sys/src/9/gnot/mem.h:68,74 (short | long)
1990/03091    
 * MMU entries 
 */ 
#define	PTEVALID	(1<<13) 
1990/1212    
#define PTEWRITE	0 
1990/03091    
#define	PTERONLY	(1<<14) 
#define	PTEKERNEL	(1<<15) 
#define	INVALIDPTE	0 
1990/1212/sys/src/9/gnot/mem.h:37,431990/1223/sys/src/9/gnot/mem.h:37,43 (short | long)
1990/03091    
#define	CENABLE		0x01 
 
/* 
 * Magic registers 
1990/1223    
 * Magic registers (unused in current system) 
1990/03091    
 */ 
 
#define	MACH		A5		/* A5 is m-> */ 
1990/1223/sys/src/9/gnot/mem.h:48,541991/0319/sys/src/9/gnot/mem.h:48,54 (short | long)
1990/03091    
 */ 
 
#define	USERADDR	0x80000000 
#define	UREGADDR	(USERADDR+BY2PG-(2+4+2+(8+8+1)*BY2WD)) 
1991/0319    
#define	UREGADDR	(USERADDR+BY2PG-(2+4+2+(8+8+1+1)*BY2WD)) 
1990/03091    
 
/* 
 * Devices poked during bootstrap 
1991/0319/sys/src/9/gnot/mem.h:100,1021991/0411/sys/src/9/gnot/mem.h:100,105 (short | long)
1990/03091    
 
#define	NSEG		5 
#define	MACHSIZE	4096 
1991/0411    
 
 
#define isphys(p) ((((ulong)(p))&0xF0000000) == KSEG) 
1991/0411/sys/src/9/gnot/mem.h:93,991991/0523/sys/src/9/gnot/mem.h:93,100 (short | long)
1990/03091    
#define	UZERO	KUSEG			/* base of user address space */ 
#define	UTZERO	(UZERO+BY2PG)		/* first address in user text */ 
#define	TSTKTOP	0x10000000		/* end of new stack in sysexec */ 
#define	USTKTOP	(TSTKTOP-100*BY2PG)	/* byte just beyond user stack */ 
1991/0523    
#define TSTKSIZ 100 
#define	USTKTOP	(TSTKTOP-TSTKSIZ*BY2PG) /* byte just beyond user stack */ 
1990/03091    
#define	KZERO	KSEG			/* base of kernel address space */ 
#define	KTZERO	(KZERO+BY2PG)		/* first address in kernel text */ 
1990/0821    
#define	USTACKSIZE	(4*1024*1024)	/* size of user stack */ 
1991/0523/sys/src/9/gnot/mem.h:97,1051991/0605/sys/src/9/gnot/mem.h:97,104 (short | long)
1991/0523    
#define	USTKTOP	(TSTKTOP-TSTKSIZ*BY2PG) /* byte just beyond user stack */ 
1990/03091    
#define	KZERO	KSEG			/* base of kernel address space */ 
#define	KTZERO	(KZERO+BY2PG)		/* first address in kernel text */ 
1990/0821    
#define	USTACKSIZE	(4*1024*1024)	/* size of user stack */ 
1991/0605    
#define	USTKSIZE	(4*1024*1024)	/* size of user stack */ 
1990/03091    
 
#define	NSEG		5 
#define	MACHSIZE	4096 
1991/0411    
 
 
1991/0605/sys/src/9/gnot/mem.h:12,171991/0606/sys/src/9/gnot/mem.h:12,18 (short | long)
1990/03091    
#define	BY2PG		8192			/* bytes per page */ 
#define	WD2PG		(BY2PG/BY2WD)		/* words per page */ 
#define	PGSHIFT		13			/* log(BY2PG) */ 
1991/0606    
#define PGROUND(s)	(((s)+(BY2PG-1))&~(BY2PG-1)) 
1990/03091    
 
#define	MAXMACH		1			/* max # cpus system can run */ 
1990/06111    
 
1991/0606/sys/src/9/gnot/mem.h:72,771991/0608/sys/src/9/gnot/mem.h:72,78 (short | long)
1990/1212    
#define PTEWRITE	0 
1990/03091    
#define	PTERONLY	(1<<14) 
#define	PTEKERNEL	(1<<15) 
1991/0608    
#define PTEUNCACHED	0 
1990/03091    
#define	INVALIDPTE	0 
#define	PPN(pa)		((pa>>13)&0x1FFF) 
 
1991/0608/sys/src/9/gnot/mem.h:13,181991/0705/sys/src/9/gnot/mem.h:13,19 (short | long)
1990/03091    
#define	WD2PG		(BY2PG/BY2WD)		/* words per page */ 
#define	PGSHIFT		13			/* log(BY2PG) */ 
1991/0606    
#define PGROUND(s)	(((s)+(BY2PG-1))&~(BY2PG-1)) 
1991/0705    
#define ICACHESIZE	0 
1990/03091    
 
#define	MAXMACH		1			/* max # cpus system can run */ 
1990/06111    
 
1991/0608/sys/src/9/gnot/mem.h:74,791991/0705/sys/src/9/gnot/mem.h:75,84
1990/03091    
#define	PTEKERNEL	(1<<15) 
1991/0608    
#define PTEUNCACHED	0 
1990/03091    
#define	INVALIDPTE	0 
1991/0705    
#define PTEMAPMEM	(1024*1024)	 
#define	PTEPERTAB	(PTEMAPMEM/BY2PG) 
#define SEGMAPSIZE	16 
 
1990/03091    
#define	PPN(pa)		((pa>>13)&0x1FFF) 
 
#define	KMAP	((unsigned long *)0xD0000000) 
1991/0705/sys/src/9/gnot/mem.h:50,561991/0719/sys/src/9/gnot/mem.h:50,58 (short | long)
1990/03091    
 */ 
 
#define	USERADDR	0x80000000 
1991/0319    
#define	UREGADDR	(USERADDR+BY2PG-(2+4+2+(8+8+1+1)*BY2WD)) 
1991/0719    
/* assuming we're in a syscall, this is the address of the Ureg structure */ 
#define	UREGVARSZ	(23*BY2WD)	/* size of variable part of Ureg */ 
#define	UREGADDR	(USERADDR+BY2PG-(UREGVARSZ+2+4+2+(8+8+1+1)*BY2WD)) 
1990/03091    
 
/* 
 * Devices poked during bootstrap 
1991/0719/sys/src/9/gnot/mem.h:14,191991/0821/sys/src/9/gnot/mem.h:14,20 (short | long)
1990/03091    
#define	PGSHIFT		13			/* log(BY2PG) */ 
1991/0606    
#define PGROUND(s)	(((s)+(BY2PG-1))&~(BY2PG-1)) 
1991/0705    
#define ICACHESIZE	0 
1991/0821    
#define MB4		(4*1024*1024)		/* Lots of things are 4Mb in size */ 
1990/03091    
 
#define	MAXMACH		1			/* max # cpus system can run */ 
1990/06111    
 
1991/0821/sys/src/9/gnot/mem.h:15,201992/0622/sys/src/9/gnot/mem.h:15,21 (short | long)
1991/0606    
#define PGROUND(s)	(((s)+(BY2PG-1))&~(BY2PG-1)) 
1991/0705    
#define ICACHESIZE	0 
1991/0821    
#define MB4		(4*1024*1024)		/* Lots of things are 4Mb in size */ 
1992/0622    
#define MB		(1024*1024) 
1990/03091    
 
#define	MAXMACH		1			/* max # cpus system can run */ 
1990/06111    
 
1992/0622/sys/src/9/gnot/mem.h:15,211992/0726/sys/src/9/gnot/mem.h:15,20 (short | long)
1991/0606    
#define PGROUND(s)	(((s)+(BY2PG-1))&~(BY2PG-1)) 
1991/0705    
#define ICACHESIZE	0 
1991/0821    
#define MB4		(4*1024*1024)		/* Lots of things are 4Mb in size */ 
1992/0622    
#define MB		(1024*1024) 
1990/03091    
 
#define	MAXMACH		1			/* max # cpus system can run */ 
1990/06111    
 
1992/0726/sys/src/9/gnot/mem.h:1,1151993/0501/sys/src/9/gnot/mem.h:0 (short | long)
Deleted.
rsc Mon Mar 7 10:21:50 2005
1990/03091    
/* 
 * Memory and machine-specific definitions.  Used in C and assembler. 
 */ 
                 
/* 
 * Sizes 
 */ 
                 
#define	BI2BY		8			/* bits per byte */ 
#define BI2WD		32			/* bits per word */ 
#define	BY2WD		4			/* bytes per word */ 
#define	BY2PG		8192			/* bytes per page */ 
#define	WD2PG		(BY2PG/BY2WD)		/* words per page */ 
#define	PGSHIFT		13			/* log(BY2PG) */ 
1991/0606    
#define PGROUND(s)	(((s)+(BY2PG-1))&~(BY2PG-1)) 
1991/0705    
#define ICACHESIZE	0 
1991/0821    
#define MB4		(4*1024*1024)		/* Lots of things are 4Mb in size */ 
1990/03091    
                 
#define	MAXMACH		1			/* max # cpus system can run */ 
1990/06111    
                 
/* 
 * Time 
 */ 
1990/08101    
#define	HZ		(60)			/* clock frequency */ 
#define	MS2HZ		(1000/HZ)		/* millisec per clock tick */ 
#define	TK2SEC(t)	((t)/HZ)		/* ticks to seconds */ 
1990/1012    
#define	TK2MS(t)	((((ulong)(t))*1000)/HZ)	/* ticks to milliseconds */ 
#define	MS2TK(t)	((((ulong)(t))*HZ)/1000)	/* milliseconds to ticks */ 
1990/03091    
                 
/* 
 * SR bits 
 */ 
#define SUPER		0x2000 
#define SPL(n)		(n<<8) 
                 
/* 
 * CACR 
 */ 
#define	CCLEAR		0x08 
#define	CENABLE		0x01 
                 
/* 
1990/1223    
 * Magic registers (unused in current system) 
1990/03091    
 */ 
                 
#define	MACH		A5		/* A5 is m-> */ 
#define	USER		A4		/* A4 is u-> */ 
                 
/* 
 * Fundamental addresses 
 */ 
                 
#define	USERADDR	0x80000000 
1991/0719    
/* assuming we're in a syscall, this is the address of the Ureg structure */ 
#define	UREGVARSZ	(23*BY2WD)	/* size of variable part of Ureg */ 
#define	UREGADDR	(USERADDR+BY2PG-(UREGVARSZ+2+4+2+(8+8+1+1)*BY2WD)) 
1990/03091    
                 
/* 
 * Devices poked during bootstrap 
 */ 
#define	TACADDR		0x40600000 
#define	MOUSE		0x40200000 
                 
/* 
 * MMU 
 */ 
                 
1990/08101    
#define	VAMASK	0xCFFFFFFF	/* clear balu bits in address */ 
1990/03091    
#define	KUSEG	0x00000000 
#define KSEG	0x80000000 
                 
/* 
 * MMU entries 
 */ 
#define	PTEVALID	(1<<13) 
1990/1212    
#define PTEWRITE	0 
1990/03091    
#define	PTERONLY	(1<<14) 
#define	PTEKERNEL	(1<<15) 
1991/0608    
#define PTEUNCACHED	0 
1990/03091    
#define	INVALIDPTE	0 
1991/0705    
#define PTEMAPMEM	(1024*1024)	 
#define	PTEPERTAB	(PTEMAPMEM/BY2PG) 
#define SEGMAPSIZE	16 
                 
1990/03091    
#define	PPN(pa)		((pa>>13)&0x1FFF) 
                 
#define	KMAP	((unsigned long *)0xD0000000) 
#define	UMAP	((unsigned long *)0x50000000) 
                 
/* 
 * Virtual addresses 
 */ 
#define	VTAG(va)	((va>>22)&0x03F) 
#define	VPN(va)		((va>>13)&0x1FF) 
                 
#define	PARAM		((char*)0x40500000) 
#define	TLBFLUSH_	0x01 
                 
/* 
 * Address spaces 
 */ 
                 
#define	UZERO	KUSEG			/* base of user address space */ 
#define	UTZERO	(UZERO+BY2PG)		/* first address in user text */ 
#define	TSTKTOP	0x10000000		/* end of new stack in sysexec */ 
1991/0523    
#define TSTKSIZ 100 
#define	USTKTOP	(TSTKTOP-TSTKSIZ*BY2PG) /* byte just beyond user stack */ 
1990/03091    
#define	KZERO	KSEG			/* base of kernel address space */ 
#define	KTZERO	(KZERO+BY2PG)		/* first address in kernel text */ 
1991/0605    
#define	USTKSIZE	(4*1024*1024)	/* size of user stack */ 
1990/03091    
                 
#define	MACHSIZE	4096 
1991/0411    
                 
                 
#define isphys(p) ((((ulong)(p))&0xF0000000) == KSEG) 


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