changelog shortlog tags branches changeset file revisions annotate raw help

Mercurial > hg > plan9front / sys/src/9/bcm64/mem.h

revision 7244: 2e8af1bf191d
parent 7217: 871931727b28
child 7317: 406bef7018a8
     1.1--- a/sys/src/9/bcm64/mem.h
     1.2+++ b/sys/src/9/bcm64/mem.h
     1.3@@ -17,11 +17,11 @@
     1.4  *	16K	32M	64G	128T
     1.5  *	64K	512M	4T	-
     1.6  */
     1.7-#define	PGSHIFT		12		/* log(BY2PG) */
     1.8+#define	PGSHIFT		16		/* log(BY2PG) */
     1.9 #define	BY2PG		(1ULL<<PGSHIFT)	/* bytes per page */
    1.10 
    1.11 /* effective virtual address space */
    1.12-#define EVASHIFT	36
    1.13+#define EVASHIFT	33
    1.14 #define EVAMASK		((1ULL<<EVASHIFT)-1)
    1.15 
    1.16 #define PTSHIFT		(PGSHIFT-3)
    1.17@@ -31,8 +31,8 @@
    1.18 
    1.19 #define PTL1X(v, l)	(L1TABLEX(v, l) | PTLX(v, l))
    1.20 #define L1TABLEX(v, l)	(L1TABLE(v, l) << PTSHIFT)
    1.21-#define L1TABLES	HOWMANY(-KZERO, PGLSZ(2))
    1.22-#define L1TABLE(v, l)	(L1TABLES-1 - ((PTLX(v, 2) % L1TABLES) >> (((l)-1)*PTSHIFT)) + (l)-1)
    1.23+#define L1TABLES	HOWMANY(-KSEG0, PGLSZ(2))
    1.24+#define L1TABLE(v, l)	(L1TABLES - ((PTLX(v, 2) % L1TABLES) >> (((l)-1)*PTSHIFT)) + (l)-1)
    1.25 #define L1TOPSIZE	(1ULL << (EVASHIFT - PTLEVELS*PTSHIFT))
    1.26 
    1.27 #define	MAXMACH		4			/* max # cpus system can run */
    1.28@@ -42,14 +42,12 @@
    1.29 #define STACKALIGN(sp)	((sp) & ~7)		/* bug: assure with alloc */
    1.30 #define TRAPFRAMESIZE	(38*8)
    1.31 
    1.32-/*
    1.33- * Address spaces.
    1.34- * KTZERO is used by kprof and dumpstack (if any).
    1.35- *
    1.36- * KZERO is mapped to physical 0 (start of ram).
    1.37- */
    1.38-
    1.39-#define	KZERO		0xFFFFFFFF80000000ULL	/* kernel address space */
    1.40+#define KSEG0		(0xFFFFFFFF00000000ULL)
    1.41+#define VIRTIO		(0xFFFFFFFF3F000000ULL)	/* i/o registers */
    1.42+#define	ARMLOCAL	(0xFFFFFFFF40000000ULL)
    1.43+#define	KZERO		(0xFFFFFFFF80000000ULL)	/* kernel address space */
    1.44+#define FRAMEBUFFER	(0xFFFFFFFFC0000000ULL|PTEWT)
    1.45+#define	VGPIO		0			/* virtual gpio for pi3 ACT LED */
    1.46 
    1.47 #define SPINTABLE	(KZERO+0xd8)
    1.48 #define CONFADDR	(KZERO+0x100)
    1.49@@ -57,16 +55,12 @@
    1.50 #define	VCBUFFER	(KZERO+0x3400)		/* videocore mailbox buffer */
    1.51 
    1.52 #define L1		(L1TOP-L1SIZE)
    1.53-#define L1SIZE		((L1TABLES+PTLEVELS-3)*BY2PG)
    1.54+#define L1SIZE		((L1TABLES+PTLEVELS-2)*BY2PG)
    1.55 #define L1TOP		((MACHADDR(MAXMACH-1)-L1TOPSIZE)&-BY2PG)
    1.56 
    1.57 #define MACHADDR(n)	(KTZERO-((n)+1)*MACHSIZE)
    1.58 
    1.59 #define	KTZERO		(KZERO+0x80000)		/* kernel text start */
    1.60-#define FRAMEBUFFER	(0xFFFFFFFFC0000000ULL | PTEWT)
    1.61-#define VIRTIO		0xFFFFFFFFE0000000ULL	/* i/o registers */
    1.62-#define	ARMLOCAL	(VIRTIO+IOSIZE)
    1.63-#define	VGPIO		0			/* virtual gpio for pi3 ACT LED */
    1.64 
    1.65 #define	UZERO		0ULL			/* user segment */
    1.66 #define	UTZERO		(UZERO+0x10000)		/* user text start */