#define MiB 1048576u /* Mebi 0x0000000000100000 */
#define GiB 1073741824u /* Gibi 000000000040000000 */
-#define HOWMANY(x, y) (((x)+((y)-1))/(y))
-#define ROUNDUP(x, y) (HOWMANY((x), (y))*(y)) /* ceiling */
-#define ROUNDDN(x, y) (((x)/(y))*(y)) /* floor */
#define MIN(a, b) ((a) < (b)? (a): (b))
#define MAX(a, b) ((a) > (b)? (a): (b))
*/
#define BY2PG (4*KiB) /* bytes per page */
#define PGSHIFT 12 /* log(BY2PG) */
-#define PGROUND(s) ROUNDUP(s, BY2PG)
+#define PGROUND(s) ROUND(s, BY2PG)
#define ROUND(s, sz) (((s)+(sz-1))&~(sz-1))
#define MAXMACH 1 /* max # cpus system can run */
#define MACHSIZE BY2PG
-#define KSTKSIZE (16*KiB) /* was 8K */
+#define KSTACK (16*KiB) /* was 8K */
#define STACKALIGN(sp) ((sp) & ~3) /* bug: assure with alloc */
/*
#define UZERO 0 /* user segment */
#define UTZERO (UZERO+BY2PG) /* user text start */
-#define UTROUND(t) ROUNDUP((t), BY2PG)
+
/* moved USTKTOP down to 512MB to keep MMIO space out of user space. */
#define USTKTOP 0x20000000 /* user segment end +1 */
#define USTKSIZE (8*1024*1024) /* user stack size */
* Legacy...
*/
#define BLOCKALIGN 32 /* only used in allocb.c */
-#define KSTACK KSTKSIZE
/*
* Sizes
#define PPN(x) ((x)&~(BY2PG-1)) /* pure page number? */
/*
+ * 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)
/*
* Physical machine information from here on.