Home | History | Annotate | Line # | Download | only in include
vmparam.h revision 1.21
      1 /*	$NetBSD: vmparam.h,v 1.21 2009/12/08 13:47:27 tsutsui Exp $	*/
      2 
      3 /*
      4  * This file was taken from from mvme68k/include/vmparam.h and
      5  * should probably be re-synced when needed.
      6  * Darrin B Jewell <jewell (at) mit.edu>  Fri Aug 28 03:22:07 1998
      7  * original cvs id: NetBSD: vmparam.h,v 1.9 1998/08/22 10:55:34 scw Exp
      8  */
      9 
     10 /*
     11  * Copyright (c) 1982, 1986, 1990, 1993
     12  *	The Regents of the University of California.  All rights reserved.
     13  *
     14  * This code is derived from software contributed to Berkeley by
     15  * the Systems Programming Group of the University of Utah Computer
     16  * Science Department.
     17  *
     18  * Redistribution and use in source and binary forms, with or without
     19  * modification, are permitted provided that the following conditions
     20  * are met:
     21  * 1. Redistributions of source code must retain the above copyright
     22  *    notice, this list of conditions and the following disclaimer.
     23  * 2. Redistributions in binary form must reproduce the above copyright
     24  *    notice, this list of conditions and the following disclaimer in the
     25  *    documentation and/or other materials provided with the distribution.
     26  * 3. Neither the name of the University nor the names of its contributors
     27  *    may be used to endorse or promote products derived from this software
     28  *    without specific prior written permission.
     29  *
     30  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     31  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     32  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     33  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     34  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     35  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     36  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     37  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     38  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     39  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     40  * SUCH DAMAGE.
     41  *
     42  * from: Utah $Hdr: vmparam.h 1.16 91/01/18$
     43  *
     44  *	@(#)vmparam.h	8.2 (Berkeley) 4/19/94
     45  */
     46 /*
     47  * Copyright (c) 1988 University of Utah.
     48  *
     49  * This code is derived from software contributed to Berkeley by
     50  * the Systems Programming Group of the University of Utah Computer
     51  * Science Department.
     52  *
     53  * Redistribution and use in source and binary forms, with or without
     54  * modification, are permitted provided that the following conditions
     55  * are met:
     56  * 1. Redistributions of source code must retain the above copyright
     57  *    notice, this list of conditions and the following disclaimer.
     58  * 2. Redistributions in binary form must reproduce the above copyright
     59  *    notice, this list of conditions and the following disclaimer in the
     60  *    documentation and/or other materials provided with the distribution.
     61  * 3. All advertising materials mentioning features or use of this software
     62  *    must display the following acknowledgement:
     63  *	This product includes software developed by the University of
     64  *	California, Berkeley and its contributors.
     65  * 4. Neither the name of the University nor the names of its contributors
     66  *    may be used to endorse or promote products derived from this software
     67  *    without specific prior written permission.
     68  *
     69  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     70  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     71  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     72  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     73  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     74  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     75  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     76  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     77  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     78  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     79  * SUCH DAMAGE.
     80  *
     81  * from: Utah $Hdr: vmparam.h 1.16 91/01/18$
     82  *
     83  *	@(#)vmparam.h	8.2 (Berkeley) 4/19/94
     84  */
     85 
     86 #ifndef _NEXT68K_VMPARAM_H_
     87 #define _NEXT68K_VMPARAM_H_
     88 
     89 /*
     90  * Machine dependent constants for NEXT68K
     91  */
     92 
     93 /*
     94  * We use 4K pages on the NeXT.  Override the PAGE_* definitions
     95  * to be compile-time constants.
     96  */
     97 #define	PAGE_SHIFT	PGSHIFT
     98 #define	PAGE_SIZE	(1 << PAGE_SHIFT)
     99 #define	PAGE_MASK	(PAGE_SIZE - 1)
    100 
    101 /*
    102  * USRSTACK is the top (end) of the user stack.
    103  *
    104  * NOTE: the ONLY reason that HIGHPAGES is 0x100 instead of UPAGES (3)
    105  * is for HPUX compatibility.  Why??  Because HPUX's debuggers
    106  * have the user's stack hard-wired at FFF00000 for post-mortems,
    107  * and we must be compatible...
    108  */
    109 #define	USRSTACK	(-HIGHPAGES*PAGE_SIZE)	/* Start of user stack */
    110 #define	BTOPUSRSTACK	(0x100000-HIGHPAGES)	/* btop(USRSTACK) */
    111 #define	P1PAGES		0x100000
    112 #define	HIGHPAGES	(0x100000/PAGE_SIZE)
    113 
    114 /*
    115  * Virtual memory related constants, all in bytes
    116  */
    117 #ifndef MAXTSIZ
    118 #define	MAXTSIZ		(8*1024*1024)		/* max text size */
    119 #endif
    120 #ifndef DFLDSIZ
    121 #define	DFLDSIZ		(16*1024*1024)		/* initial data size limit */
    122 #endif
    123 #ifndef MAXDSIZ
    124 #define	MAXDSIZ		(64*1024*1024)		/* max data size */
    125 #endif
    126 #ifndef	DFLSSIZ
    127 #define	DFLSSIZ		(512*1024)		/* initial stack size limit */
    128 #endif
    129 #ifndef	MAXSSIZ
    130 #define	MAXSSIZ		MAXDSIZ			/* max stack size */
    131 #endif
    132 
    133 /*
    134  * Sizes of the system and user portions of the system page table.
    135  */
    136 /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */
    137 #define	SYSPTSIZE	(2 * NPTEPG)	/* 8mb */
    138 #define	USRPTSIZE 	(1 * NPTEPG)	/* 4mb */
    139 
    140 /*
    141  * PTEs for mapping user space into the kernel for phyio operations.
    142  * One page is enough to handle 4Mb of simultaneous raw IO operations.
    143  */
    144 #ifndef USRIOSIZE
    145 #define USRIOSIZE	(1 * NPTEPG)	/* 4mb */
    146 #endif
    147 
    148 /*
    149  * Mach derived constants
    150  */
    151 
    152 /* user/kernel map constants */
    153 #define VM_MIN_ADDRESS		((vaddr_t)0)
    154 #define VM_MAXUSER_ADDRESS	((vaddr_t)0xFFF00000)
    155 #define VM_MAX_ADDRESS		((vaddr_t)0xFFF00000)
    156 #define VM_MIN_KERNEL_ADDRESS	((vaddr_t)0)
    157 #define VM_MAX_KERNEL_ADDRESS	((vaddr_t)(0-PAGE_SIZE*NPTEPG*2))
    158 
    159 /* virtual sizes (bytes) for various kernel submaps */
    160 #define VM_PHYS_SIZE		(USRIOSIZE*PAGE_SIZE)
    161 
    162 /* # of kernel PT pages (initial only, can grow dynamically) */
    163 #define VM_KERNEL_PT_PAGES	((vsize_t)2)		/* XXX: SYSPTSIZE */
    164 
    165 /*
    166  * Constants which control the way the VM system deals with memory segments.
    167  */
    168 #define	VM_PHYSSEG_MAX		5			/* @@@ should really come from N_SIMM */
    169 #define	VM_PHYSSEG_STRAT	VM_PSTRAT_RANDOM
    170 #define	VM_PHYSSEG_NOADD				/* @@@ does the NeXT really need this? */
    171 #define	VM_NFREELIST		1
    172 #define	VM_FREELIST_DEFAULT	0
    173 
    174 #define	__HAVE_PMAP_PHYSSEG
    175 
    176 /*
    177  * pmap-specific data stored in the vm_physmem[] array.
    178  */
    179 struct pmap_physseg {
    180 	struct pv_header *pvheader;	/* pv table for this seg */
    181 };
    182 
    183 #endif /* _MVME68K_VMPARAM_H_ */
    184