Home | History | Annotate | Line # | Download | only in include
vmparam.h revision 1.14.2.2
      1  1.14.2.2  cgd /*-
      2  1.14.2.2  cgd  * Copyright (c) 1990 The Regents of the University of California.
      3  1.14.2.2  cgd  * All rights reserved.
      4  1.14.2.2  cgd  *
      5  1.14.2.2  cgd  * This code is derived from software contributed to Berkeley by
      6  1.14.2.2  cgd  * William Jolitz.
      7  1.14.2.2  cgd  *
      8  1.14.2.2  cgd  * Redistribution and use in source and binary forms, with or without
      9  1.14.2.2  cgd  * modification, are permitted provided that the following conditions
     10  1.14.2.2  cgd  * are met:
     11  1.14.2.2  cgd  * 1. Redistributions of source code must retain the above copyright
     12  1.14.2.2  cgd  *    notice, this list of conditions and the following disclaimer.
     13  1.14.2.2  cgd  * 2. Redistributions in binary form must reproduce the above copyright
     14  1.14.2.2  cgd  *    notice, this list of conditions and the following disclaimer in the
     15  1.14.2.2  cgd  *    documentation and/or other materials provided with the distribution.
     16  1.14.2.2  cgd  * 3. All advertising materials mentioning features or use of this software
     17  1.14.2.2  cgd  *    must display the following acknowledgement:
     18  1.14.2.2  cgd  *	This product includes software developed by the University of
     19  1.14.2.2  cgd  *	California, Berkeley and its contributors.
     20  1.14.2.2  cgd  * 4. Neither the name of the University nor the names of its contributors
     21  1.14.2.2  cgd  *    may be used to endorse or promote products derived from this software
     22  1.14.2.2  cgd  *    without specific prior written permission.
     23  1.14.2.2  cgd  *
     24  1.14.2.2  cgd  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     25  1.14.2.2  cgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     26  1.14.2.2  cgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     27  1.14.2.2  cgd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     28  1.14.2.2  cgd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     29  1.14.2.2  cgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     30  1.14.2.2  cgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     31  1.14.2.2  cgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     32  1.14.2.2  cgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     33  1.14.2.2  cgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     34  1.14.2.2  cgd  * SUCH DAMAGE.
     35  1.14.2.2  cgd  *
     36  1.14.2.2  cgd  *	from: @(#)vmparam.h	5.9 (Berkeley) 5/12/91
     37  1.14.2.2  cgd  *	$Id: vmparam.h,v 1.14.2.2 1994/01/16 01:36:08 cgd Exp $
     38  1.14.2.2  cgd  */
     39  1.14.2.2  cgd 
     40  1.14.2.2  cgd 
     41  1.14.2.2  cgd /*
     42  1.14.2.2  cgd  * Machine dependent constants for 386.
     43  1.14.2.2  cgd  */
     44  1.14.2.2  cgd 
     45  1.14.2.2  cgd /*
     46  1.14.2.2  cgd  * Virtual address space arrangement. On 386, both user and kernel
     47  1.14.2.2  cgd  * share the address space, not unlike the vax.
     48  1.14.2.2  cgd  * USRTEXT is the start of the user text/data space, while USRSTACK
     49  1.14.2.2  cgd  * is the top (end) of the user stack. Immediately above the user stack
     50  1.14.2.2  cgd  * resides the user structure, which is UPAGES long and contains the
     51  1.14.2.2  cgd  * kernel stack.
     52  1.14.2.2  cgd  *
     53  1.14.2.2  cgd  * Immediately after the user structure is the page table map, and then
     54  1.14.2.2  cgd  * kernal address space.
     55  1.14.2.2  cgd  */
     56  1.14.2.2  cgd #define	USRTEXT		CLBYTES
     57  1.14.2.2  cgd #define	USRSTACK	VM_MAXUSER_ADDRESS
     58  1.14.2.2  cgd 
     59  1.14.2.2  cgd /*
     60  1.14.2.2  cgd  * Virtual memory related constants, all in bytes
     61  1.14.2.2  cgd  */
     62  1.14.2.2  cgd #define	MAXTSIZ		(8*1024*1024)		/* max text size */
     63  1.14.2.2  cgd #ifndef DFLDSIZ
     64  1.14.2.2  cgd #define	DFLDSIZ		(16*1024*1024)		/* initial data size limit */
     65  1.14.2.2  cgd #endif
     66  1.14.2.2  cgd #ifndef MAXDSIZ
     67  1.14.2.2  cgd #define	MAXDSIZ		(256*1024*1024)		/* max data size */
     68  1.14.2.2  cgd #endif
     69  1.14.2.2  cgd #ifndef	DFLSSIZ
     70  1.14.2.2  cgd #define	DFLSSIZ		(512*1024)		/* initial stack size limit */
     71  1.14.2.2  cgd #endif
     72  1.14.2.2  cgd #ifndef	MAXSSIZ
     73  1.14.2.2  cgd #define	MAXSSIZ		(8*1024*1024)		/* max stack size */
     74  1.14.2.2  cgd #endif
     75  1.14.2.2  cgd 
     76  1.14.2.2  cgd /*
     77  1.14.2.2  cgd  * Default sizes of swap allocation chunks (see dmap.h).
     78  1.14.2.2  cgd  * The actual values may be changed in vminit() based on MAXDSIZ.
     79  1.14.2.2  cgd  * With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024.
     80  1.14.2.2  cgd  */
     81  1.14.2.2  cgd #define	DMMIN	32			/* smallest swap allocation */
     82  1.14.2.2  cgd #define	DMMAX	4096			/* largest potential swap allocation */
     83  1.14.2.2  cgd #define	DMTEXT	1024			/* swap allocation for text */
     84  1.14.2.2  cgd 
     85  1.14.2.2  cgd /*
     86  1.14.2.2  cgd  * Size of shared memory map
     87  1.14.2.2  cgd  */
     88  1.14.2.2  cgd #ifndef SHMMAXPGS
     89  1.14.2.2  cgd #define SHMMAXPGS	1024
     90  1.14.2.2  cgd #endif
     91  1.14.2.2  cgd 
     92  1.14.2.2  cgd /*
     93  1.14.2.2  cgd  * Size of User Raw I/O map
     94  1.14.2.2  cgd  */
     95  1.14.2.2  cgd #define	USRIOSIZE 	300
     96  1.14.2.2  cgd 
     97  1.14.2.2  cgd /*
     98  1.14.2.2  cgd  * The time for a process to be blocked before being very swappable.
     99  1.14.2.2  cgd  * This is a number of seconds which the system takes as being a non-trivial
    100  1.14.2.2  cgd  * amount of real time.  You probably shouldn't change this;
    101  1.14.2.2  cgd  * it is used in subtle ways (fractions and multiples of it are, that is, like
    102  1.14.2.2  cgd  * half of a ``long time'', almost a long time, etc.)
    103  1.14.2.2  cgd  * It is related to human patience and other factors which don't really
    104  1.14.2.2  cgd  * change over time.
    105  1.14.2.2  cgd  */
    106  1.14.2.2  cgd #define	MAXSLP 		20
    107  1.14.2.2  cgd 
    108  1.14.2.2  cgd /*
    109  1.14.2.2  cgd  * A swapped in process is given a small amount of core without being bothered
    110  1.14.2.2  cgd  * by the page replacement algorithm.  Basically this says that if you are
    111  1.14.2.2  cgd  * swapped in you deserve some resources.  We protect the last SAFERSS
    112  1.14.2.2  cgd  * pages against paging and will just swap you out rather than paging you.
    113  1.14.2.2  cgd  * Note that each process has at least UPAGES+CLSIZE pages which are not
    114  1.14.2.2  cgd  * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this
    115  1.14.2.2  cgd  * number just means a swapped in process is given around 25k bytes.
    116  1.14.2.2  cgd  * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81),
    117  1.14.2.2  cgd  * so we loan each swapped in process memory worth 100$, or just admit
    118  1.14.2.2  cgd  * that we don't consider it worthwhile and swap it out to disk which costs
    119  1.14.2.2  cgd  * $30/mb or about $0.75.
    120  1.14.2.2  cgd  * { wfj 6/16/89: Retail AT memory expansion $800/megabyte, loan of $17
    121  1.14.2.2  cgd  *   on disk costing $7/mb or $0.18 (in memory still 100:1 in cost!) }
    122  1.14.2.2  cgd  */
    123  1.14.2.2  cgd #define	SAFERSS		8		/* nominal ``small'' resident set size
    124  1.14.2.2  cgd 					   protected against replacement */
    125  1.14.2.2  cgd 
    126  1.14.2.2  cgd /*
    127  1.14.2.2  cgd  * Mach derived constants
    128  1.14.2.2  cgd  */
    129  1.14.2.2  cgd 
    130  1.14.2.2  cgd /* user/kernel map constants */
    131  1.14.2.2  cgd #define VM_MIN_ADDRESS		((vm_offset_t)0)
    132  1.14.2.2  cgd /* PTDPTDI<<PDSHIFT - UPAGES*NBPG */
    133  1.14.2.2  cgd #define VM_MAXUSER_ADDRESS	((vm_offset_t)0xf7bfe000)
    134  1.14.2.2  cgd /* PTDPTDI<<PDSHIFT + PTDPTDI<<PGSHIFT */
    135  1.14.2.2  cgd #define VM_MAX_ADDRESS		((vm_offset_t)0xf7fdf000)
    136  1.14.2.2  cgd /* KPTDI<<PDSHIFT */
    137  1.14.2.2  cgd #define VM_MIN_KERNEL_ADDRESS	((vm_offset_t)0xf8000000)
    138  1.14.2.2  cgd /* APTDPTDI<<PDSHIFT */
    139  1.14.2.2  cgd #define VM_MAX_KERNEL_ADDRESS	((vm_offset_t)0xffc00000)
    140  1.14.2.2  cgd 
    141  1.14.2.2  cgd /* virtual sizes (bytes) for various kernel submaps */
    142  1.14.2.2  cgd #define VM_MBUF_SIZE		(NMBCLUSTERS*MCLBYTES)
    143  1.14.2.2  cgd #define VM_KMEM_SIZE		(NKMEMCLUSTERS*CLBYTES)
    144  1.14.2.2  cgd #define VM_PHYS_SIZE		(USRIOSIZE*CLBYTES)
    145