From cc2c493bc44afde611b4d72e6439ed8c5313c276 Mon Sep 17 00:00:00 2001 From: thorpej Date: Wed, 2 Apr 2003 07:35:54 +0000 Subject: [PATCH] Use PAGE_SIZE rather than NBPG. --- sys/arch/acorn32/include/vmparam.h | 4 ++-- sys/arch/amiga/include/pmap.h | 4 ++-- sys/arch/amiga/include/pte.h | 10 +++++----- sys/arch/amiga/include/vmparam.h | 8 ++++---- sys/arch/arm/include/arm32/vmparam.h | 4 ++-- sys/arch/atari/include/iomap.h | 10 +++++----- sys/arch/atari/include/pmap.h | 4 ++-- sys/arch/atari/include/pte.h | 10 +++++----- sys/arch/atari/include/vmparam.h | 8 ++++---- sys/arch/cats/include/vmparam.h | 4 ++-- sys/arch/cesfic/include/vmparam.h | 8 ++++---- sys/arch/evbarm/include/vmparam.h | 4 ++-- sys/arch/hp300/include/vmparam.h | 8 ++++---- sys/arch/hp700/include/cpu.h | 4 ++-- sys/arch/hpcarm/include/vmparam.h | 4 ++-- sys/arch/hppa/include/vmparam.h | 6 +++--- sys/arch/i386/i386/bioscall.S | 5 ++++- sys/arch/i386/i386/genassym.cf | 5 ++++- sys/arch/i386/include/apmvar.h | 4 ++-- sys/arch/i386/include/bioscall.h | 4 ++-- sys/arch/i386/include/pmap.h | 21 +++++++++++++-------- sys/arch/i386/include/proc.h | 6 +++--- sys/arch/i386/include/pte.h | 6 +++--- sys/arch/i386/include/vmparam.h | 4 ++-- sys/arch/luna68k/include/vmparam.h | 6 +++--- sys/arch/m68k/include/pmap_motorola.h | 4 ++-- sys/arch/mac68k/include/vmparam.h | 12 ++++++------ sys/arch/mips/include/vmparam.h | 6 +++--- sys/arch/mvme68k/include/vmparam.h | 8 ++++---- sys/arch/netwinder/include/vmparam.h | 4 ++-- sys/arch/news68k/include/vmparam.h | 8 ++++---- sys/arch/next68k/include/vmparam.h | 8 ++++---- sys/arch/pc532/include/pmap.h | 16 ++++++++-------- sys/arch/pc532/include/pte.h | 6 +++--- sys/arch/pc532/include/vmparam.h | 6 +++--- sys/arch/powerpc/include/ibm4xx/pmap.h | 8 ++++---- sys/arch/powerpc/include/ibm4xx/vmparam.h | 8 ++++---- sys/arch/sh3/include/vmparam.h | 6 +++--- sys/arch/sh5/include/pmap.h | 4 ++-- sys/arch/sh5/include/pte.h | 4 ++-- sys/arch/sh5/include/vmparam.h | 10 +++++----- sys/arch/shark/include/vmparam.h | 4 ++-- sys/arch/sparc64/include/pmap.h | 4 ++-- 43 files changed, 149 insertions(+), 138 deletions(-) diff --git a/sys/arch/acorn32/include/vmparam.h b/sys/arch/acorn32/include/vmparam.h index 0e341c203b78..b597b9fdc839 100644 --- a/sys/arch/acorn32/include/vmparam.h +++ b/sys/arch/acorn32/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.11 2002/09/14 15:54:00 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.12 2003/04/02 07:35:54 thorpej Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -88,7 +88,7 @@ /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* * max number of non-contig chunks of physical RAM you can have diff --git a/sys/arch/amiga/include/pmap.h b/sys/arch/amiga/include/pmap.h index e9b4f4ecd295..df1bd9db8c2b 100644 --- a/sys/arch/amiga/include/pmap.h +++ b/sys/arch/amiga/include/pmap.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.37 2003/01/17 22:17:06 thorpej Exp $ */ +/* $NetBSD: pmap.h,v 1.38 2003/04/02 07:35:55 thorpej Exp $ */ /* * Copyright (c) 1987 Carnegie-Mellon University @@ -110,7 +110,7 @@ struct pv_page_info { /* * This is basically: - * ((NBPG - sizeof(struct pv_page_info)) / sizeof(struct pv_entry)) + * ((PAGE_SIZE - sizeof(struct pv_page_info)) / sizeof(struct pv_entry)) */ #define NPVPPG 340 diff --git a/sys/arch/amiga/include/pte.h b/sys/arch/amiga/include/pte.h index ce2b1521ca71..11fba09cd37b 100644 --- a/sys/arch/amiga/include/pte.h +++ b/sys/arch/amiga/include/pte.h @@ -1,4 +1,4 @@ -/* $NetBSD: pte.h,v 1.15 1998/08/12 19:46:13 is Exp $ */ +/* $NetBSD: pte.h,v 1.16 2003/04/02 07:35:55 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -125,14 +125,14 @@ typedef u_int st_entry_t; /* segment table entry */ * AMIGA_MAX_PTSIZE the number of bytes to map everything */ #define AMIGA_MAX_COREUPT 1024 -#define AMIGA_UPTSIZE roundup(VM_MAXUSER_ADDRESS / NPTEPG, NBPG) +#define AMIGA_UPTSIZE roundup(VM_MAXUSER_ADDRESS / NPTEPG, PAGE_SIZE) #define AMIGA_UPTMAXSIZE \ - roundup((AMIGA_MAX_COREUPT * AMIGA_UPTSIZE), NBPG) + roundup((AMIGA_MAX_COREUPT * AMIGA_UPTSIZE), PAGE_SIZE) #define AMIGA_MAX_KPTSIZE \ (AMIGA_MAX_COREUPT * AMIGA_UPTSIZE / NPTEPG) #define AMIGA_KPTSIZE \ - roundup((VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / NPTEPG, NBPG) -#define AMIGA_MAX_PTSIZE roundup(0xffffffff / NPTEPG, NBPG) + roundup((VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / NPTEPG, PAGE_SIZE) +#define AMIGA_MAX_PTSIZE roundup(0xffffffff / NPTEPG, PAGE_SIZE) /* * Kernel virtual address to page table entry and to physical address. diff --git a/sys/arch/amiga/include/vmparam.h b/sys/arch/amiga/include/vmparam.h index 561f7f315e11..522d423ca3a6 100644 --- a/sys/arch/amiga/include/vmparam.h +++ b/sys/arch/amiga/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.31 2002/12/10 05:14:25 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.32 2003/04/02 07:35:55 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -68,7 +68,7 @@ #ifndef USRSTACK #define USRSTACK 0x0E000000 #endif -#define KUSER_AREA (-UPAGES*NBPG) +#define KUSER_AREA (-UPAGES*PAGE_SIZE) /* * Virtual memory related constants, all in bytes */ @@ -119,12 +119,12 @@ #define VM_MAX_ADDRESS ((vaddr_t)(USRSTACK)) /* user max */ #define VM_MAXUSER_ADDRESS ((vaddr_t)(VM_MAX_ADDRESS)) /* same */ #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0) -#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-NBPG)) +#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-PAGE_SIZE)) /* * virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* * Our bootloader currently passes up to 16 segments (but this is variable) diff --git a/sys/arch/arm/include/arm32/vmparam.h b/sys/arch/arm/include/arm32/vmparam.h index 715477d0795d..1381acfc5ea5 100644 --- a/sys/arch/arm/include/arm32/vmparam.h +++ b/sys/arch/arm/include/arm32/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.11 2002/12/10 05:14:26 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.12 2003/04/02 07:35:55 thorpej Exp $ */ /* * Copyright (c) 2001, 2002 Wasabi Systems, Inc. @@ -95,7 +95,7 @@ * Mach derived constants */ #define VM_MIN_ADDRESS ((vaddr_t) 0x00001000) -#define VM_MAXUSER_ADDRESS ((vaddr_t) (PTE_BASE - UPAGES * NBPG)) +#define VM_MAXUSER_ADDRESS ((vaddr_t) (PTE_BASE - UPAGES * PAGE_SIZE)) #define VM_MAX_ADDRESS ((vaddr_t) (PTE_BASE + \ (KERNEL_BASE >> PGSHIFT) * \ sizeof(pt_entry_t))) diff --git a/sys/arch/atari/include/iomap.h b/sys/arch/atari/include/iomap.h index 2856adf66435..cd6c99dac91e 100644 --- a/sys/arch/atari/include/iomap.h +++ b/sys/arch/atari/include/iomap.h @@ -1,4 +1,4 @@ -/* $NetBSD: iomap.h,v 1.11 2002/04/15 17:05:14 bjh21 Exp $ */ +/* $NetBSD: iomap.h,v 1.12 2003/04/02 07:35:55 thorpej Exp $ */ /* * Copyright (c) 1995 Leo Weppelman. @@ -48,7 +48,7 @@ vaddr_t stio_addr; /* Where the st io-area is mapped */ * PCI KVA addresses. These are determined in atari_init.c. Except for * the config-space, they should be used for a PCI-console only. Other * cards should use the bus-functions to map io & mem spaces. - * Each card gets an config area of NBPG bytes. + * Each card gets an config area of PAGE_SIZE bytes. * 'pci_mem_uncached' is used by the Milan interrupt handler that frobs * with the PLX. Also, the Milan uses the first page of 'pci_io_addr' for * access to some of it's ISA I/O devices (RTC, Interrupt controller, etc.) @@ -83,9 +83,9 @@ vaddr_t pci_mem_uncached; /* KVA base of an uncached PCI mem-page */ * boot-stages. * XXX: Can probably be reduced to only PCI_CONF_SIZE (Leo). */ -#define PCI_CONF_SIZE (4 * NBPG) -#define PCI_IO_SIZE (NBPG) -#define PCI_MEM_SIZE (NBPG) +#define PCI_CONF_SIZE (4 * PAGE_SIZE) +#define PCI_IO_SIZE (PAGE_SIZE) +#define PCI_MEM_SIZE (PAGE_SIZE) #define PCI_VGA_SIZE (32 * 1024) /* XXX Leo: Only used by grfabs_et now. */ diff --git a/sys/arch/atari/include/pmap.h b/sys/arch/atari/include/pmap.h index 1530efbdeb43..21ed5f5eaaf4 100644 --- a/sys/arch/atari/include/pmap.h +++ b/sys/arch/atari/include/pmap.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.29 2002/09/22 07:53:41 chs Exp $ */ +/* $NetBSD: pmap.h,v 1.30 2003/04/02 07:35:56 thorpej Exp $ */ /* * Copyright (c) 1987 Carnegie-Mellon University @@ -123,7 +123,7 @@ struct pv_page_info { /* * This is basically: - * ((NBPG - sizeof(struct pv_page_info)) / sizeof(struct pv_entry)) + * ((PAGE_SIZE - sizeof(struct pv_page_info)) / sizeof(struct pv_entry)) */ #define NPVPPG 340 diff --git a/sys/arch/atari/include/pte.h b/sys/arch/atari/include/pte.h index 22de2c76505d..66e32fa1bc54 100644 --- a/sys/arch/atari/include/pte.h +++ b/sys/arch/atari/include/pte.h @@ -1,4 +1,4 @@ -/* $NetBSD: pte.h,v 1.4 2001/04/10 19:51:00 leo Exp $ */ +/* $NetBSD: pte.h,v 1.5 2003/04/02 07:35:56 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -130,15 +130,15 @@ typedef u_int st_entry_t; * ATARI_MAX_PTSIZE the number of bytes to map everything */ #define ATARI_MAX_COREUPT 1024 -#define ATARI_UPTSIZE roundup(VM_MAXUSER_ADDRESS / NPTEPG, NBPG) +#define ATARI_UPTSIZE roundup(VM_MAXUSER_ADDRESS / NPTEPG, PAGE_SIZE) #define ATARI_UPTBASE 0x10000000 #define ATARI_UPTMAXSIZE \ - roundup((ATARI_MAX_COREUPT * ATARI_UPTSIZE), NBPG) + roundup((ATARI_MAX_COREUPT * ATARI_UPTSIZE), PAGE_SIZE) #define ATARI_MAX_KPTSIZE \ (ATARI_MAX_COREUPT * ATARI_UPTSIZE / NPTEPG) #define ATARI_KPTSIZE \ - roundup((VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / NPTEPG, NBPG) -#define ATARI_MAX_PTSIZE roundup(0xffffffff / NPTEPG, NBPG) + roundup((VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / NPTEPG, PAGE_SIZE) +#define ATARI_MAX_PTSIZE roundup(0xffffffff / NPTEPG, PAGE_SIZE) /* * Kernel virtual address to page table entry and to physical address. diff --git a/sys/arch/atari/include/vmparam.h b/sys/arch/atari/include/vmparam.h index c7fcae39889d..4e1e84081b90 100644 --- a/sys/arch/atari/include/vmparam.h +++ b/sys/arch/atari/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.18 2002/12/10 05:14:26 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.19 2003/04/02 07:35:56 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -67,7 +67,7 @@ /* Sun settings. Still hope, that I might get sun3 binaries to work... */ #define USRSTACK 0x0E000000 -#define KUSER_AREA (-UPAGES*NBPG) +#define KUSER_AREA (-UPAGES*PAGE_SIZE) /* * Virtual memory related constants, all in bytes */ @@ -118,12 +118,12 @@ #define VM_MAX_ADDRESS ((vaddr_t)(USRSTACK)) #define VM_MAXUSER_ADDRESS ((vaddr_t)(VM_MAX_ADDRESS)) #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0) -#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-NBPG)) +#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-PAGE_SIZE)) /* * virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* * Our bootloader currently passes up to 2 segments (ST and TT ram). diff --git a/sys/arch/cats/include/vmparam.h b/sys/arch/cats/include/vmparam.h index 164c74588ff7..0cb92a4e4768 100644 --- a/sys/arch/cats/include/vmparam.h +++ b/sys/arch/cats/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.16 2002/09/14 15:54:01 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.17 2003/04/02 07:35:56 thorpej Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -93,7 +93,7 @@ /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* * max number of non-contig chunks of physical RAM you can have diff --git a/sys/arch/cesfic/include/vmparam.h b/sys/arch/cesfic/include/vmparam.h index a753ca7bedbf..20e63344315f 100644 --- a/sys/arch/cesfic/include/vmparam.h +++ b/sys/arch/cesfic/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.5 2002/12/10 05:14:27 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.6 2003/04/02 07:35:56 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -65,10 +65,10 @@ * have the user's stack hard-wired at FFF00000 for post-mortems, * and we must be compatible... */ -#define USRSTACK (-HIGHPAGES*NBPG) /* Start of user stack */ +#define USRSTACK (-HIGHPAGES*PAGE_SIZE) /* Start of user stack */ #define BTOPUSRSTACK (0x100000-HIGHPAGES) /* btop(USRSTACK) */ #define P1PAGES 0x100000 -#define HIGHPAGES (0x100000/NBPG) +#define HIGHPAGES (0x100000/PAGE_SIZE) /* * Virtual memory related constants, all in bytes @@ -134,7 +134,7 @@ #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xFFFFF000) /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* # of kernel PT pages (initial only, can grow dynamically) */ #define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ diff --git a/sys/arch/evbarm/include/vmparam.h b/sys/arch/evbarm/include/vmparam.h index 1584d261c99b..1e7ca39fbf2b 100644 --- a/sys/arch/evbarm/include/vmparam.h +++ b/sys/arch/evbarm/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.13 2002/09/14 15:54:01 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.14 2003/04/02 07:35:57 thorpej Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -88,7 +88,7 @@ /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* * max number of non-contig chunks of physical RAM you can have diff --git a/sys/arch/hp300/include/vmparam.h b/sys/arch/hp300/include/vmparam.h index 8f2837f78609..861b19321d60 100644 --- a/sys/arch/hp300/include/vmparam.h +++ b/sys/arch/hp300/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.28 2002/12/10 05:14:27 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.29 2003/04/02 07:35:57 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -65,10 +65,10 @@ * have the user's stack hard-wired at FFF00000 for post-mortems, * and we must be compatible... */ -#define USRSTACK (-HIGHPAGES*NBPG) /* Start of user stack */ +#define USRSTACK (-HIGHPAGES*PAGE_SIZE) /* Start of user stack */ #define BTOPUSRSTACK (0x100000-HIGHPAGES) /* btop(USRSTACK) */ #define P1PAGES 0x100000 -#define HIGHPAGES (0x100000/NBPG) +#define HIGHPAGES (0x100000/PAGE_SIZE) /* * Virtual memory related constants, all in bytes @@ -134,7 +134,7 @@ #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xFFFFF000) /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* # of kernel PT pages (initial only, can grow dynamically) */ #define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ diff --git a/sys/arch/hp700/include/cpu.h b/sys/arch/hp700/include/cpu.h index aa90c956d957..e17600ce9c88 100644 --- a/sys/arch/hp700/include/cpu.h +++ b/sys/arch/hp700/include/cpu.h @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.4 2002/08/19 18:58:31 fredette Exp $ */ +/* $NetBSD: cpu.h,v 1.5 2003/04/02 07:35:57 thorpej Exp $ */ /* $OpenBSD: cpu.h,v 1.20 2001/01/29 00:01:58 mickey Exp $ */ @@ -224,7 +224,7 @@ int cpu_dump __P((void)); * Boot arguments stuff */ -#define BOOTARG_LEN (NBPG) +#define BOOTARG_LEN (PAGE_SIZE) #define BOOTARG_OFF (0x10000) /* diff --git a/sys/arch/hpcarm/include/vmparam.h b/sys/arch/hpcarm/include/vmparam.h index 1e17b3c2f58a..22c641ca6b96 100644 --- a/sys/arch/hpcarm/include/vmparam.h +++ b/sys/arch/hpcarm/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.18 2002/09/14 15:54:01 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.19 2003/04/02 07:35:58 thorpej Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -85,7 +85,7 @@ /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* * max number of non-contig chunks of physical RAM you can have diff --git a/sys/arch/hppa/include/vmparam.h b/sys/arch/hppa/include/vmparam.h index 46a8a9cf0f9e..89328c5625fa 100644 --- a/sys/arch/hppa/include/vmparam.h +++ b/sys/arch/hppa/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.4 2003/04/01 20:47:25 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.5 2003/04/02 07:35:58 thorpej Exp $ */ /* $OpenBSD: vmparam.h,v 1.17 2001/09/22 18:00:09 miod Exp $ */ @@ -47,7 +47,7 @@ #define SYSCALLGATE 0xC0000000 /* syscall gateway page */ /* Alignment requirement for a uspace. */ -#define USPACE_ALIGN NBPG +#define USPACE_ALIGN PAGE_SIZE /* * Virtual memory related constants, all in bytes @@ -77,7 +77,7 @@ * This is basically slop for kmempt which we actually allocate (malloc) from. */ #ifndef SHMMAXPGS -#define SHMMAXPGS ((1024*1024*10)/NBPG) /* 10mb */ +#define SHMMAXPGS ((1024*1024*10)/PAGE_SIZE) /* 10mb */ #endif /* diff --git a/sys/arch/i386/i386/bioscall.S b/sys/arch/i386/i386/bioscall.S index addbc23e9912..73d01f18371c 100644 --- a/sys/arch/i386/i386/bioscall.S +++ b/sys/arch/i386/i386/bioscall.S @@ -1,4 +1,4 @@ -/* $NetBSD: bioscall.S,v 1.1 2002/11/22 15:01:16 fvdl Exp $ */ +/* $NetBSD: bioscall.S,v 1.2 2003/04/02 07:35:58 thorpej Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -35,11 +35,14 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + #include #include #include +#include "assym.h" + /* LINTSTUB: include */ /* LINTSTUB: include */ diff --git a/sys/arch/i386/i386/genassym.cf b/sys/arch/i386/i386/genassym.cf index 3b75a9c9b409..f5eff560ce65 100644 --- a/sys/arch/i386/i386/genassym.cf +++ b/sys/arch/i386/i386/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.35 2003/01/17 23:10:30 thorpej Exp $ +# $NetBSD: genassym.cf,v 1.36 2003/04/02 07:35:58 thorpej Exp $ # # Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -139,6 +139,9 @@ include endif include + +define PAGE_SIZE PAGE_SIZE + define LSRUN LSRUN define LSONPROC LSONPROC diff --git a/sys/arch/i386/include/apmvar.h b/sys/arch/i386/include/apmvar.h index 56b5d97109f1..fc8c7e199af2 100644 --- a/sys/arch/i386/include/apmvar.h +++ b/sys/arch/i386/include/apmvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: apmvar.h,v 1.16 2002/10/14 02:08:39 takemura Exp $ */ +/* $NetBSD: apmvar.h,v 1.17 2003/04/02 07:35:59 thorpej Exp $ */ /*- * Copyright (c) 1995 The NetBSD Foundation, Inc. * All rights reserved. @@ -44,7 +44,7 @@ * virtual & physical address of the trampoline * that we use: page 1. */ -#define APM_BIOSTRAMP NBPG +#define APM_BIOSTRAMP PAGE_SIZE /* filled in by apmcall */ diff --git a/sys/arch/i386/include/bioscall.h b/sys/arch/i386/include/bioscall.h index 5bc8e6ade751..a5c659ec4700 100644 --- a/sys/arch/i386/include/bioscall.h +++ b/sys/arch/i386/include/bioscall.h @@ -1,4 +1,4 @@ -/* $NetBSD: bioscall.h,v 1.7 2001/05/02 13:12:46 jdolecek Exp $ */ +/* $NetBSD: bioscall.h,v 1.8 2003/04/02 07:35:59 thorpej Exp $ */ /*- * Copyright (c) 1997, 2000 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ * virtual & physical address of the trampoline * that we use: page 1. */ -#define BIOSTRAMP_BASE NBPG +#define BIOSTRAMP_BASE PAGE_SIZE #ifndef _LOCORE #define BIOSREG_LO 0 diff --git a/sys/arch/i386/include/pmap.h b/sys/arch/i386/include/pmap.h index ba4de729c099..d6cdbd01b99b 100644 --- a/sys/arch/i386/include/pmap.h +++ b/sys/arch/i386/include/pmap.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.70 2003/03/03 22:13:16 fvdl Exp $ */ +/* $NetBSD: pmap.h,v 1.71 2003/04/02 07:35:59 thorpej Exp $ */ /* * @@ -87,7 +87,7 @@ * point (slot #767 as show above). when the pmap code wants to find the * PTE for a virtual address, all it has to do is the following: * - * address of PTE = (767 * 4MB) + (VA / NBPG) * sizeof(pt_entry_t) + * address of PTE = (767 * 4MB) + (VA / PAGE_SIZE) * sizeof(pt_entry_t) * = 0xbfc00000 + (VA / 4096) * 4 * * what happens if the pmap layer is asked to perform an operation @@ -160,8 +160,8 @@ #define PTE_BASE ((pt_entry_t *) (PDSLOT_PTE * NBPD) ) #define APTE_BASE ((pt_entry_t *) (PDSLOT_APTE * NBPD) ) -#define PDP_BASE ((pd_entry_t *)(((char *)PTE_BASE) + (PDSLOT_PTE * NBPG))) -#define APDP_BASE ((pd_entry_t *)(((char *)APTE_BASE) + (PDSLOT_APTE * NBPG))) +#define PDP_BASE ((pd_entry_t *)(((char *)PTE_BASE) + (PDSLOT_PTE * PAGE_SIZE))) +#define APDP_BASE ((pd_entry_t *)(((char *)APTE_BASE) + (PDSLOT_APTE * PAGE_SIZE))) #define PDP_PDE (PDP_BASE + PDSLOT_PTE) #define APDP_PDE (PDP_BASE + PDSLOT_APTE) @@ -191,12 +191,12 @@ * a PTP's offset is the byte-offset in the PTE space that this PTP is at * a PTP's VA is the first VA mapped by that PTP * - * note that NBPG == number of bytes in a PTP (4096 bytes == 1024 entries) + * note that PAGE_SIZE == number of bytes in a PTP (4096 bytes == 1024 entries) * NBPD == number of bytes a PTP can map (4MB) */ -#define ptp_i2o(I) ((I) * NBPG) /* index => offset */ -#define ptp_o2i(O) ((O) / NBPG) /* offset => index */ +#define ptp_i2o(I) ((I) * PAGE_SIZE) /* index => offset */ +#define ptp_o2i(O) ((O) / PAGE_SIZE) /* offset => index */ #define ptp_i2v(I) ((I) * NBPD) /* index => VA */ #define ptp_v2i(V) ((V) / NBPD) /* VA => index (same as pdei) */ @@ -298,7 +298,7 @@ struct pv_page_info { * (note: won't work on systems where NPBG isn't a constant) */ -#define PVE_PER_PVPAGE ((NBPG - sizeof(struct pv_page_info)) / \ +#define PVE_PER_PVPAGE ((PAGE_SIZE - sizeof(struct pv_page_info)) / \ sizeof(struct pv_entry)) /* @@ -504,5 +504,10 @@ void pmap_ldt_cleanup __P((struct lwp *)); #define PMAP_FORK #endif /* USER_LDT */ +/* + * Hooks for the pool allocator. + */ +#define POOL_VTOPHYS(va) vtophys((vaddr_t) (va)) + #endif /* _KERNEL */ #endif /* _I386_PMAP_H_ */ diff --git a/sys/arch/i386/include/proc.h b/sys/arch/i386/include/proc.h index 43f83d7515a0..80b6acd6f60b 100644 --- a/sys/arch/i386/include/proc.h +++ b/sys/arch/i386/include/proc.h @@ -1,4 +1,4 @@ -/* $NetBSD: proc.h,v 1.17 2003/01/17 23:10:29 thorpej Exp $ */ +/* $NetBSD: proc.h,v 1.18 2003/04/02 07:35:59 thorpej Exp $ */ /* * Copyright (c) 1991 Regents of the University of California. @@ -69,7 +69,7 @@ struct mdproc { #ifndef NOREDZONE /* override default for redzone */ #define KSTACK_LOWEST_ADDR(l) \ - ((caddr_t)(l)->l_addr + NBPG*2) + ((caddr_t)(l)->l_addr + PAGE_SIZE*2) #define KSTACK_SIZE \ - (USPACE - NBPG*2) + (USPACE - PAGE_SIZE*2) #endif diff --git a/sys/arch/i386/include/pte.h b/sys/arch/i386/include/pte.h index b5bf356d6008..e085955fe178 100644 --- a/sys/arch/i386/include/pte.h +++ b/sys/arch/i386/include/pte.h @@ -1,4 +1,4 @@ -/* $NetBSD: pte.h,v 1.12 2000/09/05 21:52:16 thorpej Exp $ */ +/* $NetBSD: pte.h,v 1.13 2003/04/02 07:35:59 thorpej Exp $ */ /* * @@ -146,9 +146,9 @@ typedef u_int32_t pt_entry_t; /* PTE */ #define NBPD (1 << PDSHIFT) /* # bytes mapped by PD (4MB) */ #define PDOFSET (NBPD-1) /* mask for non-PD part of VA */ #if 0 /* not used? */ -#define NPTEPD (NBPD / NBPG) /* # of PTEs in a PD */ +#define NPTEPD (NBPD / PAGE_SIZE) /* # of PTEs in a PD */ #else -#define PTES_PER_PTP (NBPD / NBPG) /* # of PTEs in a PTP */ +#define PTES_PER_PTP (NBPD / PAGE_SIZE) /* # of PTEs in a PTP */ #endif #define PD_MASK 0xffc00000 /* page directory address bits */ #define PT_MASK 0x003ff000 /* page table address bits */ diff --git a/sys/arch/i386/include/vmparam.h b/sys/arch/i386/include/vmparam.h index 3ca92cf349bf..1299f22e1ae2 100644 --- a/sys/arch/i386/include/vmparam.h +++ b/sys/arch/i386/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.50 2003/03/16 19:42:09 cjep Exp $ */ +/* $NetBSD: vmparam.h,v 1.51 2003/04/02 07:35:59 thorpej Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -120,7 +120,7 @@ #endif /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) #define VM_PHYSSEG_MAX 5 /* 1 "hole" + 4 free lists */ #define VM_PHYSSEG_STRAT VM_PSTRAT_BIGFIRST diff --git a/sys/arch/luna68k/include/vmparam.h b/sys/arch/luna68k/include/vmparam.h index 0eb9271aa8b6..8b1e9ad6872a 100644 --- a/sys/arch/luna68k/include/vmparam.h +++ b/sys/arch/luna68k/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.7 2003/04/02 00:03:49 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.8 2003/04/02 07:36:00 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -109,11 +109,11 @@ #define VM_MAXUSER_ADDRESS ((vaddr_t)0xFFFC0000) #define VM_MAX_ADDRESS ((vaddr_t)0xFFFC0000) #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0) -#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-NBPG)) +#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-PAGE_SIZE)) /* virtual sizes (bytes) for various kernel submaps */ #define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* # of kernel PT pages (initial only, can grow dynamically) */ #define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ diff --git a/sys/arch/m68k/include/pmap_motorola.h b/sys/arch/m68k/include/pmap_motorola.h index 3fd3f1a87d1c..b84ef3b91997 100644 --- a/sys/arch/m68k/include/pmap_motorola.h +++ b/sys/arch/m68k/include/pmap_motorola.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_motorola.h,v 1.2 2002/11/05 07:41:24 chs Exp $ */ +/* $NetBSD: pmap_motorola.h,v 1.3 2003/04/02 07:36:00 thorpej Exp $ */ /* * Copyright (c) 1987 Carnegie-Mellon University @@ -116,7 +116,7 @@ struct pv_page_info { /* * This is basically: - * ((NBPG - sizeof(struct pv_page_info)) / sizeof(struct pv_entry)) + * ((PAGE_SIZE - sizeof(struct pv_page_info)) / sizeof(struct pv_entry)) */ #define NPVPPG 170 diff --git a/sys/arch/mac68k/include/vmparam.h b/sys/arch/mac68k/include/vmparam.h index 2d93fb15b1ed..5a0e1f0b63f5 100644 --- a/sys/arch/mac68k/include/vmparam.h +++ b/sys/arch/mac68k/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.32 2002/12/10 05:14:29 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.33 2003/04/02 07:36:00 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -94,10 +94,10 @@ /* * USRSTACK is the top (end) of the user stack. * - * NOTE: HP300 uses HIGHPAGES == (0x100000/NBPG) for HP/UX compatibility. + * NOTE: HP300 uses HIGHPAGES == (0x100000/PAGE_SIZE) for HP/UX compatibility. * Do we care? Obviously not at the moment. */ -#define USRSTACK (-HIGHPAGES*NBPG) /* Start of user stack */ +#define USRSTACK (-HIGHPAGES*PAGE_SIZE) /* Start of user stack */ #define BTOPUSRSTACK (0x100000-HIGHPAGES) /* btop(USRSTACK) */ #define P1PAGES 0x100000 #define HIGHPAGES 3 /* UPAGES */ @@ -151,12 +151,12 @@ /* user/kernel map constants */ #define VM_MIN_ADDRESS ((vaddr_t)0) #define VM_MAXUSER_ADDRESS ((vaddr_t)(USRSTACK)) -#define VM_MAX_ADDRESS ((vaddr_t)(0-(UPAGES*NBPG))) +#define VM_MAX_ADDRESS ((vaddr_t)(0-(UPAGES*PAGE_SIZE))) #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0) -#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-NBPG)) +#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-PAGE_SIZE)) /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* # of kernel PT pages (initial only, can grow dynamically) */ #define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ diff --git a/sys/arch/mips/include/vmparam.h b/sys/arch/mips/include/vmparam.h index 780f549d9218..3ac48c4f2739 100644 --- a/sys/arch/mips/include/vmparam.h +++ b/sys/arch/mips/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.31 2002/12/10 05:14:30 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.32 2003/04/02 07:36:00 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -93,7 +93,7 @@ * The default PTE number is enough to cover 8 disks * MAXBSIZE. */ #ifndef USRIOSIZE -#define USRIOSIZE (MAXBSIZE/NBPG * 8) +#define USRIOSIZE (MAXBSIZE/PAGE_SIZE * 8) #endif /* @@ -120,7 +120,7 @@ #endif /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* VM_PHYSSEG_MAX defined by platform-dependent code. */ #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH diff --git a/sys/arch/mvme68k/include/vmparam.h b/sys/arch/mvme68k/include/vmparam.h index 1e33a8dc9402..f62e76ce37dd 100644 --- a/sys/arch/mvme68k/include/vmparam.h +++ b/sys/arch/mvme68k/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.23 2002/12/10 05:14:30 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.24 2003/04/02 07:36:01 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -75,10 +75,10 @@ extern int mvme68k_pager_map_size; * have the user's stack hard-wired at FFF00000 for post-mortems, * and we must be compatible... */ -#define USRSTACK (-HIGHPAGES*NBPG) /* Start of user stack */ +#define USRSTACK (-HIGHPAGES*PAGE_SIZE) /* Start of user stack */ #define BTOPUSRSTACK (0x100000-HIGHPAGES) /* btop(USRSTACK) */ #define P1PAGES 0x100000 -#define HIGHPAGES (0x100000/NBPG) +#define HIGHPAGES (0x100000/PAGE_SIZE) /* * Virtual memory related constants, all in bytes @@ -134,7 +134,7 @@ extern int mvme68k_pager_map_size; #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xFFFFF000) /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* # of kernel PT pages (initial only, can grow dynamically) */ #define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ diff --git a/sys/arch/netwinder/include/vmparam.h b/sys/arch/netwinder/include/vmparam.h index d4a611d342ee..81a5e183fba6 100644 --- a/sys/arch/netwinder/include/vmparam.h +++ b/sys/arch/netwinder/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.14 2002/09/14 15:54:02 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.15 2003/04/02 07:36:01 thorpej Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -88,7 +88,7 @@ /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* * max number of non-contig chunks of physical RAM you can have diff --git a/sys/arch/news68k/include/vmparam.h b/sys/arch/news68k/include/vmparam.h index d64406763dc5..1791b9c0a81f 100644 --- a/sys/arch/news68k/include/vmparam.h +++ b/sys/arch/news68k/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.9 2002/12/10 05:14:30 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.10 2003/04/02 07:36:01 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -65,10 +65,10 @@ * have the user's stack hard-wired at FFF00000 for post-mortems, * and we must be compatible... */ -#define USRSTACK (-HIGHPAGES*NBPG) /* Start of user stack */ +#define USRSTACK (-HIGHPAGES*PAGE_SIZE) /* Start of user stack */ #define BTOPUSRSTACK (0x100000-HIGHPAGES) /* btop(USRSTACK) */ #define P1PAGES 0x100000 -#define HIGHPAGES (0x100000/NBPG) +#define HIGHPAGES (0x100000/PAGE_SIZE) /* * Virtual memory related constants, all in bytes @@ -124,7 +124,7 @@ #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xFFFFF000) /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* # of kernel PT pages (initial only, can grow dynamically) */ #define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ diff --git a/sys/arch/next68k/include/vmparam.h b/sys/arch/next68k/include/vmparam.h index d93e5cf81495..6e2d6fbca570 100644 --- a/sys/arch/next68k/include/vmparam.h +++ b/sys/arch/next68k/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.14 2002/12/10 05:14:31 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.15 2003/04/02 07:36:01 thorpej Exp $ */ /* * This file was taken from from mvme68k/include/vmparam.h and @@ -72,10 +72,10 @@ * have the user's stack hard-wired at FFF00000 for post-mortems, * and we must be compatible... */ -#define USRSTACK (-HIGHPAGES*NBPG) /* Start of user stack */ +#define USRSTACK (-HIGHPAGES*PAGE_SIZE) /* Start of user stack */ #define BTOPUSRSTACK (0x100000-HIGHPAGES) /* btop(USRSTACK) */ #define P1PAGES 0x100000 -#define HIGHPAGES (0x100000/NBPG) +#define HIGHPAGES (0x100000/PAGE_SIZE) /* * Virtual memory related constants, all in bytes @@ -131,7 +131,7 @@ #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xFFFFF000) /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* # of kernel PT pages (initial only, can grow dynamically) */ #define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ diff --git a/sys/arch/pc532/include/pmap.h b/sys/arch/pc532/include/pmap.h index 80cb2e5ba2e5..113c301bbf95 100644 --- a/sys/arch/pc532/include/pmap.h +++ b/sys/arch/pc532/include/pmap.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.36 2002/09/22 07:53:47 chs Exp $ */ +/* $NetBSD: pmap.h,v 1.37 2003/04/02 07:36:02 thorpej Exp $ */ /* * @@ -83,7 +83,7 @@ * point (slot #895 as show above). when the pmap code wants to find the * PTE for a virtual address, all it has to do is the following: * - * address of PTE = (895 * 4MB) + (VA / NBPG) * sizeof(pt_entry_t) + * address of PTE = (895 * 4MB) + (VA / PAGE_SIZE) * sizeof(pt_entry_t) * = 0xdfc00000 + (VA / 4096) * 4 * * what happens if the pmap layer is asked to perform an operation @@ -155,8 +155,8 @@ #define PTE_BASE ((pt_entry_t *) (PDSLOT_PTE * NBPD) ) #define APTE_BASE ((pt_entry_t *) (PDSLOT_APTE * NBPD) ) -#define PDP_BASE ((pd_entry_t *)(((char *)PTE_BASE) + (PDSLOT_PTE * NBPG))) -#define APDP_BASE ((pd_entry_t *)(((char *)APTE_BASE) + (PDSLOT_APTE * NBPG))) +#define PDP_BASE ((pd_entry_t *)(((char *)PTE_BASE) + (PDSLOT_PTE * PAGE_SIZE))) +#define APDP_BASE ((pd_entry_t *)(((char *)APTE_BASE) + (PDSLOT_APTE * PAGE_SIZE))) #define PDP_PDE (PDP_BASE + PDSLOT_PTE) #define APDP_PDE (PDP_BASE + PDSLOT_APTE) @@ -193,12 +193,12 @@ * a PTP's offset is the byte-offset in the PTE space that this PTP is at * a PTP's VA is the first VA mapped by that PTP * - * note that NBPG == number of bytes in a PTP (4096 bytes == 1024 entries) + * note that PAGE_SIZE == number of bytes in a PTP (4096 bytes == 1024 entries) * NBPD == number of bytes a PTP can map (4MB) */ -#define ptp_i2o(I) ((I) * NBPG) /* index => offset */ -#define ptp_o2i(O) ((O) / NBPG) /* offset => index */ +#define ptp_i2o(I) ((I) * PAGE_SIZE) /* index => offset */ +#define ptp_o2i(O) ((O) / PAGE_SIZE) /* offset => index */ #define ptp_i2v(I) ((I) * NBPD) /* index => VA */ #define ptp_v2i(V) ((V) / NBPD) /* VA => index (same as pdei) */ @@ -281,7 +281,7 @@ struct pv_page_info { * (note: won't work on systems where NPBG isn't a constant) */ -#define PVE_PER_PVPAGE ((NBPG - sizeof(struct pv_page_info)) / \ +#define PVE_PER_PVPAGE ((PAGE_SIZE - sizeof(struct pv_page_info)) / \ sizeof(struct pv_entry)) /* diff --git a/sys/arch/pc532/include/pte.h b/sys/arch/pc532/include/pte.h index 58316961719e..0aa5be158745 100644 --- a/sys/arch/pc532/include/pte.h +++ b/sys/arch/pc532/include/pte.h @@ -1,4 +1,4 @@ -/* $NetBSD: pte.h,v 1.3 1998/03/18 21:52:02 matthias Exp $ */ +/* $NetBSD: pte.h,v 1.4 2003/04/02 07:36:02 thorpej Exp $ */ /* * @@ -138,9 +138,9 @@ typedef u_int32_t pt_entry_t; /* PTE */ #define NBPD (1 << PDSHIFT) /* # bytes mapped by PD (4MB) */ #define PDOFSET (NBPD-1) /* mask for non-PD part of VA */ #if 0 /* not used? */ -#define NPTEPD (NBPD / NBPG) /* # of PTEs in a PD */ +#define NPTEPD (NBPD / PAGE_SIZE) /* # of PTEs in a PD */ #else -#define PTES_PER_PTP (NBPD / NBPG) /* # of PTEs in a PTP */ +#define PTES_PER_PTP (NBPD / PAGE_SIZE) /* # of PTEs in a PTP */ #endif #define PD_MASK 0xffc00000 /* page directory address bits */ #define PT_MASK 0x003ff000 /* page table address bits */ diff --git a/sys/arch/pc532/include/vmparam.h b/sys/arch/pc532/include/vmparam.h index 3a829197641f..fd194e996862 100644 --- a/sys/arch/pc532/include/vmparam.h +++ b/sys/arch/pc532/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.27 2002/12/10 05:14:31 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.28 2003/04/02 07:36:02 thorpej Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -68,7 +68,7 @@ /* * INTSTACK is a temporary stack for the idle process and cpu_exit. */ -#define INTSTACK (0xffc00000 + NBPG - 4) +#define INTSTACK (0xffc00000 + PAGE_SIZE - 4) /* * Virtual memory related constants, all in bytes @@ -124,7 +124,7 @@ #endif /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) #define VM_PHYSSEG_MAX 1 /* we have contiguous memory */ #define VM_PHYSSEG_STRAT VM_PSTRAT_RANDOM diff --git a/sys/arch/powerpc/include/ibm4xx/pmap.h b/sys/arch/powerpc/include/ibm4xx/pmap.h index d4f6d8e81277..599c23a23a20 100644 --- a/sys/arch/powerpc/include/ibm4xx/pmap.h +++ b/sys/arch/powerpc/include/ibm4xx/pmap.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.5 2002/09/22 07:53:47 chs Exp $ */ +/* $NetBSD: pmap.h,v 1.6 2003/04/02 07:36:02 thorpej Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -114,14 +114,14 @@ * Definitions for sizes of 1st and 2nd level page tables. * */ -#define PTSZ (NBPG / 4) -#define PTMAP (PTSZ * NBPG) +#define PTSZ (PAGE_SIZE / 4) +#define PTMAP (PTSZ * PAGE_SIZE) #define PTMSK ((PTMAP - 1) & ~(PGOFSET)) #define PTIDX(v) (((v) & PTMSK) >> PGSHIFT) /* 2nd level tables map in any bits not mapped by 1st level tables. */ -#define STSZ ((0xffffffffU / (NBPG * PTSZ)) + 1) +#define STSZ ((0xffffffffU / (PAGE_SIZE * PTSZ)) + 1) #define STMAP (0xffffffffU) #define STMSK (~(PTMAP - 1)) diff --git a/sys/arch/powerpc/include/ibm4xx/vmparam.h b/sys/arch/powerpc/include/ibm4xx/vmparam.h index a9136b78cd7b..b45876129d4e 100644 --- a/sys/arch/powerpc/include/ibm4xx/vmparam.h +++ b/sys/arch/powerpc/include/ibm4xx/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.3 2003/04/01 23:52:35 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.4 2003/04/02 07:36:03 thorpej Exp $ */ /*- * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -82,7 +82,7 @@ * the way other PPC ports lay out their 256MB kernel address space. */ #define VM_MIN_ADDRESS ((vaddr_t)0) -#define VM_MAXUSER_ADDRESS ((vaddr_t)0xffff0000-NBPG) +#define VM_MAXUSER_ADDRESS ((vaddr_t)0xffff0000-PAGE_SIZE) #define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0x80000000) #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xff000000) @@ -91,7 +91,7 @@ * Would like to have MAX addresses = 0, but this doesn't (currently) work */ #define VM_MIN_ADDRESS ((vaddr_t)0) -#define VM_MAXUSER_ADDRESS ((vaddr_t)0x80000000-NBPG) +#define VM_MAXUSER_ADDRESS ((vaddr_t)0x80000000-PAGE_SIZE) #define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)(KERNEL_SR << ADDR_SR_SHFT)) #define VM_MAX_KERNEL_ADDRESS (VM_MIN_KERNEL_ADDRESS + SEGMENT_LENGTH - 1) @@ -107,7 +107,7 @@ #define PAGER_MAP_SIZE (4 * 1024 * 1024) #endif -#define VM_PHYS_SIZE (USRIOSIZE * NBPG) +#define VM_PHYS_SIZE (USRIOSIZE * PAGE_SIZE) #define __HAVE_PMAP_PHYSSEG diff --git a/sys/arch/sh3/include/vmparam.h b/sys/arch/sh3/include/vmparam.h index 85982285feb3..2b04b1046e01 100644 --- a/sys/arch/sh3/include/vmparam.h +++ b/sys/arch/sh3/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.15 2003/04/02 02:39:47 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.16 2003/04/02 07:36:03 thorpej Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -85,10 +85,10 @@ /* Size of user raw I/O map */ #ifndef USRIOSIZE -#define USRIOSIZE (MAXBSIZE / NBPG * 8) +#define USRIOSIZE (MAXBSIZE / PAGE_SIZE * 8) #endif -#define VM_PHYS_SIZE (USRIOSIZE * NBPG) +#define VM_PHYS_SIZE (USRIOSIZE * PAGE_SIZE) /* Physical memory segments */ #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH diff --git a/sys/arch/sh5/include/pmap.h b/sys/arch/sh5/include/pmap.h index 9bc1c1b24849..5c3e1afe0d51 100644 --- a/sys/arch/sh5/include/pmap.h +++ b/sys/arch/sh5/include/pmap.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.16 2003/04/01 10:25:09 scw Exp $ */ +/* $NetBSD: pmap.h,v 1.17 2003/04/02 07:36:03 thorpej Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -53,7 +53,7 @@ * if necessary. */ #ifndef KERNEL_IPT_SIZE -#define KERNEL_IPT_SIZE (SH5_KSEG1_SIZE / NBPG) +#define KERNEL_IPT_SIZE (SH5_KSEG1_SIZE / PAGE_SIZE) #endif struct pmap { diff --git a/sys/arch/sh5/include/pte.h b/sys/arch/sh5/include/pte.h index b417afb43d6d..0f58d394bbf0 100644 --- a/sys/arch/sh5/include/pte.h +++ b/sys/arch/sh5/include/pte.h @@ -1,4 +1,4 @@ -/* $NetBSD: pte.h,v 1.4 2002/12/06 10:10:48 scw Exp $ */ +/* $NetBSD: pte.h,v 1.5 2003/04/02 07:36:03 thorpej Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -152,7 +152,7 @@ typedef struct kpte { /* * The pmap_pteg_table consists of an array of Hash Buckets, called PTE Groups, * where each group is 8 PTEs in size. The number of groups is calculated - * at boot time such that there is one group for every two NBPG-sized pages + * at boot time such that there is one group for every two PAGE_SIZE-sized pages * of physical RAM. */ #define SH5_PTEG_SIZE 8 diff --git a/sys/arch/sh5/include/vmparam.h b/sys/arch/sh5/include/vmparam.h index a8e341686143..059ccd0267a1 100644 --- a/sys/arch/sh5/include/vmparam.h +++ b/sys/arch/sh5/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.5 2003/04/02 02:44:06 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.6 2003/04/02 07:36:03 thorpej Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -106,9 +106,9 @@ #define VM_MIN_ADDRESS (0) #ifdef _LP64 -#define VM_MAXUSER_ADDRESS (0xffffffffc0000000UL - NBPG) +#define VM_MAXUSER_ADDRESS (0xffffffffc0000000UL - PAGE_SIZE) #else -#define VM_MAXUSER_ADDRESS (0xc0000000UL - NBPG) +#define VM_MAXUSER_ADDRESS (0xc0000000UL - PAGE_SIZE) #endif #define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS @@ -145,10 +145,10 @@ /* Size of user raw I/O map */ #ifndef USRIOSIZE -#define USRIOSIZE (MAXBSIZE / NBPG * 8) +#define USRIOSIZE (MAXBSIZE / PAGE_SIZE * 8) #endif -#define VM_PHYS_SIZE (USRIOSIZE * NBPG) +#define VM_PHYS_SIZE (USRIOSIZE * PAGE_SIZE) /* * Physical memory segments diff --git a/sys/arch/shark/include/vmparam.h b/sys/arch/shark/include/vmparam.h index cf2e08d95981..4ba4889cf1e1 100644 --- a/sys/arch/shark/include/vmparam.h +++ b/sys/arch/shark/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.6 2002/09/14 15:54:02 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.7 2003/04/02 07:36:03 thorpej Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -80,7 +80,7 @@ /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* * max number of non-contig chunks of physical RAM you can have diff --git a/sys/arch/sparc64/include/pmap.h b/sys/arch/sparc64/include/pmap.h index 55572dd95e48..7516025f01d2 100644 --- a/sys/arch/sparc64/include/pmap.h +++ b/sys/arch/sparc64/include/pmap.h @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.25 2003/01/31 19:05:55 martin Exp $ */ +/* $NetBSD: pmap.h,v 1.26 2003/04/02 07:36:04 thorpej Exp $ */ /*- * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -73,7 +73,7 @@ #define HOLESHIFT (43) -#define PTSZ (NBPG/8) +#define PTSZ (PAGE_SIZE/8) #define PDSZ (PTSZ) #define STSZ (PTSZ)