From 04269f64453044140accaa28a6dd8d75a320932c Mon Sep 17 00:00:00 2001 From: thorpej Date: Tue, 8 Apr 2003 23:35:48 +0000 Subject: [PATCH] Make PAGE_SIZE, PAGE_SHIFT, and PAGE_MASK compile time constants; we only support 8K page models at the moment anyway. --- sys/arch/alpha/alpha/machdep.c | 18 ++++++++---------- sys/arch/alpha/include/vmparam.h | 12 ++++++++++-- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c index 555ab04d7d0c..23f99adc5fa6 100644 --- a/sys/arch/alpha/alpha/machdep.c +++ b/sys/arch/alpha/alpha/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.262 2003/04/01 02:18:51 thorpej Exp $ */ +/* $NetBSD: machdep.c,v 1.263 2003/04/08 23:35:48 thorpej Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -75,7 +75,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.262 2003/04/01 02:18:51 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.263 2003/04/08 23:35:48 thorpej Exp $"); #include #include @@ -363,15 +363,13 @@ nobootinfo: trap_init(); /* - * find out this system's page size - */ - PAGE_SIZE = hwrpb->rpb_page_size; - if (PAGE_SIZE != 8192) - panic("page size %d != 8192?!", PAGE_SIZE); - - /* - * Initialize PAGE_SIZE-dependent variables. + * Find out this system's page size, and initialize + * PAGE_SIZE-dependent variables. */ + if (hwrpb->rpb_page_size != ALPHA_PGBYTES) + panic("page size %lu != %d?!", hwrpb->rpb_page_size, + ALPHA_PGBYTES); + uvmexp.pagesize = hwrpb->rpb_page_size; uvm_setpagesize(); /* diff --git a/sys/arch/alpha/include/vmparam.h b/sys/arch/alpha/include/vmparam.h index 9bf048ce2931..a687ea4c8409 100644 --- a/sys/arch/alpha/include/vmparam.h +++ b/sys/arch/alpha/include/vmparam.h @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.25 2002/12/10 05:14:25 thorpej Exp $ */ +/* $NetBSD: vmparam.h,v 1.26 2003/04/08 23:35:48 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -49,6 +49,14 @@ * Machine dependent constants for Alpha. */ +/* + * All systypes currently supported by NetBSD/alpha have an 8K pages. + * Override the PAGE_* definitions to be compile-time constants. + */ +#define PAGE_SHIFT 13 +#define PAGE_SIZE (1 << PAGE_SHIFT) +#define PAGE_MASK (PAGE_SIZE - 1) + /* * USRSTACK is the top (end) of the user stack. * @@ -106,7 +114,7 @@ #define VM_MAX_KERNEL_ADDRESS trunc_page((vaddr_t)ALPHA_K1SEG_END) /* virtual sizes (bytes) for various kernel submaps */ -#define VM_PHYS_SIZE (USRIOSIZE*NBPG) +#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) /* some Alpha-specific constants */ #define VPTBASE ((vaddr_t)0xfffffffc00000000) /* Virt. pg table */