*/
#define BY2PG (4*KiB) /* bytes per page */
#define PGSHIFT 12 /* log(BY2PG) */
-#define HOWMANY(x,y) (((x)+((y)-1))/(y))
-#define ROUNDUP(x,y) (HOWMANY((x),(y))*(y))
-#define PGROUND(s) ROUNDUP(s, BY2PG)
+#define PGROUND(s) ROUND(s, BY2PG)
#define ROUND(s, sz) (((s)+(sz-1))&~(sz-1))
#define MAXMACH 4 /* max # cpus system can run */
#define MACHSIZE BY2PG
#define L1SIZE (4 * BY2PG)
-#define KSTKSIZE (8*KiB)
+#define KSTACK (8*KiB)
#define STACKALIGN(sp) ((sp) & ~3) /* bug: assure with alloc */
/*
#define FIQSTKTOP (KZERO+0x4000) /* FIQ stack */
#define L1 (KZERO+0x4000) /* tt ptes: 16KiB aligned */
#define KTZERO (KZERO+0x8000) /* kernel text start */
-#define VIRTIO 0x7E000000 /* i/o registers */
-#define ARMLOCAL (VIRTIO+IOSIZE) /* armv7 only */
+#define VIRTIO (0x7E000000) /* i/o registers */
+#define ARMLOCAL (0x7F000000) /* armv7 only */
#define VGPIO (ARMLOCAL+MiB) /* virtual gpio for pi3 ACT LED */
#define FRAMEBUFFER 0xC0000000 /* video framebuffer */
#define UTZERO (UZERO+BY2PG) /* user text start */
#define USTKTOP 0x40000000 /* user segment end +1 */
#define USTKSIZE (8*1024*1024) /* user stack size */
-#define TSTKTOP (USTKTOP-USTKSIZE) /* sysexec temporary stack */
-#define TSTKSIZ 256
/*
* Legacy...
*/
#define BLOCKALIGN 64 /* only used in allocb.c */
-#define KSTACK KSTKSIZE
/*
* Sizes
#define PPN(x) ((x)&~(BY2PG-1))
/*
+ * These bits are completely artificial.
* With a little work these move to port.
*/
#define PTEVALID (1<<0)
#define PTERONLY 0
#define PTEWRITE (1<<1)
+#define PTECACHED 0
#define PTEUNCACHED (1<<2)
-#define PTEKERNEL (1<<3)
+#define PTENOEXEC (1<<4)
/*
* Physical machine information from here on.
* BUS addresses as seen from the videocore gpu.
*/
#define PHYSDRAM 0
-#define IOSIZE (16*MiB)
#define MIN(a, b) ((a) < (b)? (a): (b))
#define MAX(a, b) ((a) > (b)? (a): (b))