Plan 9 from Bell Labs’s /usr/web/sources/extra/9hist/gnot/mem.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


## diffname gnot/mem.h 1990/03091
## diff -e /dev/null /n/bootesdump/1990/03091/sys/src/9/68020/mem.h
0a
/*
 * 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) */
#define	MS2HZ		16	/* BUG */	/* millisec per clock tick */

#define	MAXMACH		1			/* max # cpus system can run */

/*
 * SR bits
 */
#define SUPER		0x2000
#define SPL(n)		(n<<8)

/*
 * CACR
 */
#define	CCLEAR		0x08
#define	CENABLE		0x01

/*
 * Magic registers
 */

#define	MACH		A5		/* A5 is m-> */
#define	USER		A4		/* A4 is u-> */

/*
 * Fundamental addresses
 */

#define	USERADDR	0x80000000
#define	UREGADDR	(USERADDR+BY2PG-(2+4+2+(8+8+1)*BY2WD))

/*
 * Devices poked during bootstrap
 */
#define	TACADDR		0x40600000
#define	MOUSE		0x40200000

/*
 * MMU
 */

#define	KUSEG	0x00000000
#define KSEG	0x80000000

/*
 * MMU entries
 */
#define	PTEVALID	(1<<13)
#define	PTERONLY	(1<<14)
#define	PTEKERNEL	(1<<15)
#define	INVALIDPTE	0
#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 */
#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 */

#define	NSEG		5
#define	MACHSIZE	4096
.
## diffname gnot/mem.h 1990/0611
## diff -e /n/bootesdump/1990/03091/sys/src/9/68020/mem.h /n/bootesdump/1990/0611/sys/src/9/68020/mem.h
15c
#define	MS2HZ		(1000/60)		/* millisec per clock tick */
.
## diffname gnot/mem.h 1990/06111
## diff -e /n/bootesdump/1990/0611/sys/src/9/68020/mem.h /n/bootesdump/1990/06111/sys/src/9/68020/mem.h
17a

/*
 * 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 */
.
15d
## diffname gnot/mem.h 1990/08101
## diff -e /n/bootesdump/1990/06111/sys/src/9/68020/mem.h /n/bootesdump/1990/08101/sys/src/9/68020/mem.h
61a
#define	VAMASK	0xCFFFFFFF	/* clear balu bits in address */
.
21,24c
#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 */
.
## diffname gnot/mem.h 1990/0821
## diff -e /n/bootesdump/1990/08101/sys/src/9/68020/mem.h /n/bootesdump/1990/0821/sys/src/9/68020/mem.h
97a
#define	USTACKSIZE	(4*1024*1024)	/* size of user stack */
.
## diffname gnot/mem.h 1990/1012
## diff -e /n/bootesdump/1990/0821/sys/src/9/68020/mem.h /n/bootesdump/1990/1012/sys/src/9/68020/mem.h
24,25c
#define	TK2MS(t)	((((ulong)(t))*1000)/HZ)	/* ticks to milliseconds */
#define	MS2TK(t)	((((ulong)(t))*HZ)/1000)	/* milliseconds to ticks */
.
## diffname gnot/mem.h 1990/1212
## diff -e /n/bootesdump/1990/1012/sys/src/9/68020/mem.h /n/bootesdump/1990/1212/sys/src/9/68020/mem.h
70a
#define PTEWRITE	0
.
## diffname gnot/mem.h 1990/1223
## diff -e /n/bootesdump/1990/1212/sys/src/9/68020/mem.h /n/bootesdump/1990/1223/sys/src/9/68020/mem.h
40c
 * Magic registers (unused in current system)
.
## diffname gnot/mem.h 1991/0319
## diff -e /n/bootesdump/1991/0201/sys/src/9/68020/mem.h /n/bootesdump/1991/0319/sys/src/9/gnot/mem.h
51c
#define	UREGADDR	(USERADDR+BY2PG-(2+4+2+(8+8+1+1)*BY2WD))
.
## diffname gnot/mem.h 1991/0411
## diff -e /n/bootesdump/1991/0319/sys/src/9/gnot/mem.h /n/bootesdump/1991/0411/sys/src/9/gnot/mem.h
102a


#define isphys(p) ((((ulong)(p))&0xF0000000) == KSEG)
.
## diffname gnot/mem.h 1991/0523
## diff -e /n/bootesdump/1991/0411/sys/src/9/gnot/mem.h /n/bootesdump/1991/0523/sys/src/9/gnot/mem.h
96c
#define TSTKSIZ 100
#define	USTKTOP	(TSTKTOP-TSTKSIZ*BY2PG) /* byte just beyond user stack */
.
## diffname gnot/mem.h 1991/0605
## diff -e /n/bootesdump/1991/0523/sys/src/9/gnot/mem.h /n/bootesdump/1991/0605/sys/src/9/gnot/mem.h
102d
100c
#define	USTKSIZE	(4*1024*1024)	/* size of user stack */
.
## diffname gnot/mem.h 1991/0606
## diff -e /n/bootesdump/1991/0605/sys/src/9/gnot/mem.h /n/bootesdump/1991/0606/sys/src/9/gnot/mem.h
14a
#define PGROUND(s)	(((s)+(BY2PG-1))&~(BY2PG-1))
.
## diffname gnot/mem.h 1991/0608
## diff -e /n/bootesdump/1991/0606/sys/src/9/gnot/mem.h /n/bootesdump/1991/0608/sys/src/9/gnot/mem.h
74a
#define PTEUNCACHED	0
.
## diffname gnot/mem.h 1991/0705
## diff -e /n/bootesdump/1991/0608/sys/src/9/gnot/mem.h /n/bootesdump/1991/0705/sys/src/9/gnot/mem.h
76a
#define PTEMAPMEM	(1024*1024)	
#define	PTEPERTAB	(PTEMAPMEM/BY2PG)
#define SEGMAPSIZE	16

.
15a
#define ICACHESIZE	0
.
## diffname gnot/mem.h 1991/0719
## diff -e /n/bootesdump/1991/0705/sys/src/9/gnot/mem.h /n/bootesdump/1991/0719/sys/src/9/gnot/mem.h
53c
/* 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))
.
## diffname gnot/mem.h 1991/0821
## diff -e /n/bootesdump/1991/0719/sys/src/9/gnot/mem.h /n/bootesdump/1991/0821/sys/src/9/gnot/mem.h
16a
#define MB4		(4*1024*1024)		/* Lots of things are 4Mb in size */
.
## diffname gnot/mem.h 1992/0622
## diff -e /n/bootesdump/1991/0821/sys/src/9/gnot/mem.h /n/bootesdump/1992/0622/sys/src/9/gnot/mem.h
17a
#define MB		(1024*1024)
.
## diffname gnot/mem.h 1992/0726
## diff -e /n/bootesdump/1992/0622/sys/src/9/gnot/mem.h /n/bootesdump/1992/0726/sys/src/9/gnot/mem.h
18d
## diffname gnot/mem.h 1993/0501 # deleted
## diff -e /n/bootesdump/1992/0726/sys/src/9/gnot/mem.h /n/fornaxdump/1993/0501/sys/src/brazil/gnot/mem.h
1,115d

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.