diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2003-08-01 07:47:01 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2003-08-01 07:47:01 +0000 |
commit | 5a797cd7d292eeac3bb14efad6b5ac0b227a0dff (patch) | |
tree | ef0ec0e9c984c0cea736b517de47720d27ef3977 /sys/arch/mvme88k | |
parent | ba6a08c4c45dbb9ee7cf27d2fcfa7c9ce8d7f4f8 (diff) |
Do not use hardcoded values for constants which are in fact computed from other
constants.
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r-- | sys/arch/mvme88k/include/param.h | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/sys/arch/mvme88k/include/param.h b/sys/arch/mvme88k/include/param.h index 74ae319853b..7daec5af95d 100644 --- a/sys/arch/mvme88k/include/param.h +++ b/sys/arch/mvme88k/include/param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: param.h,v 1.28 2003/06/02 23:27:52 millert Exp $ */ +/* $OpenBSD: param.h,v 1.29 2003/08/01 07:47:00 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1988 University of Utah. @@ -66,7 +66,7 @@ #define ALIGN(p) (((u_int)(p) + ALIGNBYTES) & ~ALIGNBYTES) #define ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0) -#define NBPG 4096 /* bytes/page */ +#define NBPG (1 << PGSHIFT) /* bytes/page */ #define PGOFSET (NBPG-1) /* byte offset into page */ #define PGSHIFT 12 /* LOG2(NBPG) */ @@ -74,27 +74,27 @@ #define PAGE_SIZE (1 << PAGE_SHIFT) #define PAGE_MASK (PAGE_SIZE - 1) -#define NPTEPG (PAGE_SIZE / (sizeof(u_int))) +#define NPTEPG (PAGE_SIZE / (sizeof(pt_entry_t))) /* * 187 Bug uses the bottom 64k. We allocate ptes to map this into the * kernel. But when we link the kernel, we tell it to start linking - * past this 64k. How does this change KERNBASE? XXX + * past this 64k. */ +#define KERNBASE 0x00000000 /* start of kernel virtual */ +#define KERNTEXTOFF 0x00010000 /* start of kernel text */ -#define KERNBASE 0x0 /* start of kernel virtual */ -#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT) - -#define DEV_BSIZE 512 #define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ -#define BLKDEV_IOSIZE 2048 /* Should this be changed? XXX */ +#define DEV_BSIZE (1 << DEV_BSHIFT) +#define BLKDEV_IOSIZE 2048 #define MAXPHYS (64 * 1024) /* max raw I/O transfer size */ #define SSIZE 1 /* initial stack size/NBPG */ #define SINCR 1 /* increment of stack/NBPG */ -#define USPACE ctob(UPAGES) #define UPAGES 8 /* pages of u-area */ +#define USPACE (UPAGES * NBPG) + #define UADDR 0xEEE00000 /* address of u */ #define UVPN (UADDR>>PGSHIFT) /* virtual page number of u */ #define KERNELSTACK (UADDR+UPAGES*NBPG) /* top of kernel stack */ @@ -137,18 +137,14 @@ /* pages ("clicks") to disk blocks */ #define ctod(x) ((x) << (PGSHIFT - DEV_BSHIFT)) #define dtoc(x) ((x) >> (PGSHIFT - DEV_BSHIFT)) -#define dtob(x) ((x) << DEV_BSHIFT) /* pages to bytes */ #define ctob(x) ((x) << PGSHIFT) +#define btoc(x) (((x) + PGOFSET) >> PGSHIFT) -/* bytes to pages */ -#define btoc(x) (((unsigned)(x) + PAGE_MASK) >> PGSHIFT) - -#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ - ((unsigned)(bytes) >> DEV_BSHIFT) -#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ - ((unsigned)(db) << DEV_BSHIFT) +/* bytes to disk blocks */ +#define btodb(x) ((x) >> DEV_BSHIFT) +#define dbtob(x) ((x) << DEV_BSHIFT) /* * Map a ``block device block'' to a file system block. |