Module Name: src Committed By: matt Date: Sun Aug 9 04:02:41 UTC 2009
Modified Files: src/sys/arch/mips/include: mips_param.h vmparam.h Log Message: Beginning of large-page support. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mips/include/mips_param.h cvs rdiff -u -r1.42 -r1.43 src/sys/arch/mips/include/vmparam.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/mips/include/mips_param.h diff -u src/sys/arch/mips/include/mips_param.h:1.23 src/sys/arch/mips/include/mips_param.h:1.24 --- src/sys/arch/mips/include/mips_param.h:1.23 Mon Aug 28 13:43:35 2006 +++ src/sys/arch/mips/include/mips_param.h Sun Aug 9 04:02:40 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_param.h,v 1.23 2006/08/28 13:43:35 yamt Exp $ */ +/* $NetBSD: mips_param.h,v 1.24 2009/08/09 04:02:40 matt Exp $ */ #ifdef _KERNEL #include <machine/cpu.h> @@ -12,8 +12,15 @@ #define SSIZE 1 /* initial stack size/NBPG */ #define SINCR 1 /* increment of stack/NBPG */ +#ifdef ENABLE_MIPS_16KB_PAGE +#define UPAGES 1 /* pages of u-area */ +#define USPACE (UPAGES*NBPG) /* size of u-area in bytes */ +#elif defined(ENABLE_MIPS_4KB_PAGE) || 1 #define UPAGES 2 /* pages of u-area */ #define USPACE (UPAGES*NBPG) /* size of u-area in bytes */ +#else +#error ENABLE_MIPS_xKB_PAGE not defined +#endif #ifndef MSGBUFSIZE #define MSGBUFSIZE NBPG /* default message buffer size */ @@ -34,14 +41,19 @@ #define ALIGN(p) (((uintptr_t)(p) + ALIGNBYTES) & ~ALIGNBYTES) #define ALIGNED_POINTER(p,t) ((((uintptr_t)(p)) & (sizeof(t)-1)) == 0) +#ifdef ENABLE_MIPS_16KB_PAGE +#define NBPG 16384 /* bytes/page */ +#define PGSHIFT 14 /* LOG2(NBPG) */ +#else #define NBPG 4096 /* bytes/page */ -#define PGOFSET (NBPG-1) /* byte offset into page */ #define PGSHIFT 12 /* LOG2(NBPG) */ +#endif +#define PGOFSET (NBPG-1) /* byte offset into page */ #define NPTEPG (NBPG/4) -#define NBSEG 0x400000 /* bytes/segment */ +#define NBSEG (NBPG*NPTEPG) /* bytes/segment */ #define SEGOFSET (NBSEG-1) /* byte offset into segment */ -#define SEGSHIFT 22 /* LOG2(NBSEG) */ +#define SEGSHIFT (2*PGSHIFT-2) /* LOG2(NBSEG) */ /* * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized Index: src/sys/arch/mips/include/vmparam.h diff -u src/sys/arch/mips/include/vmparam.h:1.42 src/sys/arch/mips/include/vmparam.h:1.43 --- src/sys/arch/mips/include/vmparam.h:1.42 Fri Mar 6 20:31:50 2009 +++ src/sys/arch/mips/include/vmparam.h Sun Aug 9 04:02:40 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.42 2009/03/06 20:31:50 joerg Exp $ */ +/* $NetBSD: vmparam.h,v 1.43 2009/08/09 04:02:40 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -84,10 +84,16 @@ */ /* - * We use a 4K page on MIPS systems. Override PAGE_* definitions - * to compile-time constants. + * We normally use a 4K page but may use 16K on MIPS systems. + * Override PAGE_* definitions to compile-time constants. */ +#ifdef ENABLE_MIPS_16KB_PAGE +#define PAGE_SHIFT 14 +#elif defined(ENABLE_MIPS_4KB_PAGE) || 1 #define PAGE_SHIFT 12 +#else +#error ENABLE_MIPS_xKB_PAGE not defined +#endif #define PAGE_SIZE (1 << PAGE_SHIFT) #define PAGE_MASK (PAGE_SIZE - 1) @@ -98,7 +104,7 @@ * and some QED CPUs perform some virtual address checks before the * offset is calculated. */ -#define USRSTACK 0x7ffff000 /* Start of user stack */ +#define USRSTACK (0x7fffffff & ~PAGE_MASK) /* Start of user stack */ /* alignment requirement for u-area space in bytes */ #define USPACE_ALIGN USPACE