vmparam3.h revision 1.10
11.9Scgd/*	$NetBSD: vmparam3.h,v 1.10 1994/11/21 21:34:30 gwr Exp $	*/
21.9Scgd
31.7Sglass/*
41.10Sgwr * Copyright (c) 1994 Gordon W. Ross
51.7Sglass * Copyright (c) 1993 Adam Glass
61.7Sglass * Copyright (c) 1988 University of Utah.
71.7Sglass * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
81.7Sglass * All rights reserved.
91.7Sglass *
101.7Sglass * This code is derived from software contributed to Berkeley by
111.7Sglass * the Systems Programming Group of the University of Utah Computer
121.7Sglass * Science Department.
131.7Sglass *
141.7Sglass * Redistribution and use in source and binary forms, with or without
151.7Sglass * modification, are permitted provided that the following conditions
161.7Sglass * are met:
171.7Sglass * 1. Redistributions of source code must retain the above copyright
181.7Sglass *    notice, this list of conditions and the following disclaimer.
191.7Sglass * 2. Redistributions in binary form must reproduce the above copyright
201.7Sglass *    notice, this list of conditions and the following disclaimer in the
211.7Sglass *    documentation and/or other materials provided with the distribution.
221.7Sglass * 3. All advertising materials mentioning features or use of this software
231.7Sglass *    must display the following acknowledgement:
241.7Sglass *	This product includes software developed by the University of
251.7Sglass *	California, Berkeley and its contributors.
261.7Sglass * 4. Neither the name of the University nor the names of its contributors
271.7Sglass *    may be used to endorse or promote products derived from this software
281.7Sglass *    without specific prior written permission.
291.7Sglass *
301.7Sglass * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
311.7Sglass * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
321.7Sglass * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
331.7Sglass * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
341.7Sglass * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
351.7Sglass * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
361.7Sglass * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
371.7Sglass * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
381.7Sglass * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
391.7Sglass * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
401.7Sglass * SUCH DAMAGE.
411.7Sglass *
421.10Sgwr *	from: Utah $Hdr: vmparam.h 1.16 91/01/18$
431.10Sgwr *	from: @(#)vmparam.h	7.3 (Berkeley) 5/7/91
441.10Sgwr *	vmparam.h,v 1.2 1993/05/22 07:58:38 cgd Exp
451.7Sglass */
461.1Sglass
471.10Sgwr/*
481.10Sgwr * Machine dependent constants for Sun-4c SPARC
491.10Sgwr */
501.10Sgwr
511.10Sgwr/*
521.10Sgwr * USRTEXT is the start of the user text/data space, while USRSTACK
531.10Sgwr * is the top (end) of the user stack.
541.10Sgwr */
551.10Sgwr#define	USRTEXT 	NBPG		/* Start of user text */
561.10Sgwr#define	USRSTACK	KERNBASE	/* High end of user stack */
571.1Sglass
581.1Sglass/*
591.1Sglass * Virtual memory related constants, all in bytes
601.1Sglass */
611.1Sglass#ifndef MAXTSIZ
621.6Sglass#define	MAXTSIZ		(8*1024*1024)		/* max text size */
631.1Sglass#endif
641.1Sglass#ifndef DFLDSIZ
651.1Sglass#define	DFLDSIZ		(8*1024*1024)		/* initial data size limit */
661.1Sglass#endif
671.1Sglass#ifndef MAXDSIZ
681.6Sglass#define	MAXDSIZ		(32*1024*1024)		/* max data size */
691.1Sglass#endif
701.1Sglass#ifndef	DFLSSIZ
711.1Sglass#define	DFLSSIZ		(512*1024)		/* initial stack size limit */
721.1Sglass#endif
731.1Sglass#ifndef	MAXSSIZ
741.10Sgwr#define	MAXSSIZ		MAXDSIZ			/* max stack size */
751.1Sglass#endif
761.1Sglass
771.1Sglass/*
781.1Sglass * Default sizes of swap allocation chunks (see dmap.h).
791.1Sglass * The actual values may be changed in vminit() based on MAXDSIZ.
801.1Sglass * With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024.
811.1Sglass * DMMIN should be at least ctod(1) so that vtod() works.
821.1Sglass * vminit() insures this.
831.1Sglass */
841.1Sglass#define	DMMIN	32			/* smallest swap allocation */
851.1Sglass#define	DMMAX	4096			/* largest potential swap allocation */
861.1Sglass
871.1Sglass/*
881.4Sglass * PTEs for mapping user space into the kernel for phyio operations.
891.4Sglass * [this figure is based on the assumption that you can put ptes in real
901.4Sglass *  memory.  this is a false assumption on a sun3]
911.4Sglass *
921.4Sglass */
931.4Sglass#ifndef USRIOSIZE
941.4Sglass#define USRIOSIZE	1
951.4Sglass#endif
961.4Sglass
971.4Sglass/*
981.1Sglass * The time for a process to be blocked before being very swappable.
991.1Sglass * This is a number of seconds which the system takes as being a non-trivial
1001.1Sglass * amount of real time.  You probably shouldn't change this;
1011.1Sglass * it is used in subtle ways (fractions and multiples of it are, that is, like
1021.1Sglass * half of a ``long time'', almost a long time, etc.)
1031.1Sglass * It is related to human patience and other factors which don't really
1041.1Sglass * change over time.
1051.1Sglass */
1061.1Sglass#define	MAXSLP 		20
1071.1Sglass
1081.1Sglass/*
1091.1Sglass * A swapped in process is given a small amount of core without being bothered
1101.1Sglass * by the page replacement algorithm.  Basically this says that if you are
1111.1Sglass * swapped in you deserve some resources.  We protect the last SAFERSS
1121.1Sglass * pages against paging and will just swap you out rather than paging you.
1131.1Sglass * Note that each process has at least UPAGES+CLSIZE pages which are not
1141.1Sglass * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this
1151.1Sglass * number just means a swapped in process is given around 25k bytes.
1161.1Sglass * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81),
1171.1Sglass * so we loan each swapped in process memory worth 100$, or just admit
1181.1Sglass * that we don't consider it worthwhile and swap it out to disk which costs
1191.1Sglass * $30/mb or about $0.75.
1201.1Sglass */
1211.1Sglass#define	SAFERSS		4		/* nominal ``small'' resident set size
1221.1Sglass					   protected against replacement */
1231.1Sglass
1241.5Sglass#define DVMA_SPACE_SIZE  0x00100000
1251.10Sgwr#define DVMA_SPACE_START 0x0FD00000
1261.5Sglass#define DVMA_SPACE_END   0x0FE00000 /* mon start */
1271.1Sglass
1281.1Sglass/*
1291.10Sgwr * Kernel VA of kernel u-area for current process
1301.10Sgwr */
1311.10Sgwr#define	UADDR	0x0FFE0000	/* mon shortseg */
1321.10Sgwr
1331.10Sgwr/*
1341.1Sglass * Mach derived constants
1351.1Sglass */
1361.1Sglass
1371.1Sglass/* user/kernel map constants */
1381.1Sglass#define VM_MIN_ADDRESS		((vm_offset_t)0)
1391.10Sgwr#define VM_MAX_ADDRESS		((vm_offset_t)KERNBASE)
1401.10Sgwr#define VM_MAXUSER_ADDRESS	((vm_offset_t)KERNBASE)
1411.10Sgwr#define VM_MIN_KERNEL_ADDRESS	((vm_offset_t)KERNBASE)
1421.10Sgwr#define VM_MAX_KERNEL_ADDRESS	((vm_offset_t)DVMA_SPACE_START)
1431.1Sglass
1441.1Sglass/* virtual sizes (bytes) for various kernel submaps */
1451.1Sglass#define VM_MBUF_SIZE		(NMBCLUSTERS*MCLBYTES)
1461.1Sglass#define VM_KMEM_SIZE		(NKMEMCLUSTERS*CLBYTES)
1471.1Sglass#define VM_PHYS_SIZE		(USRIOSIZE*CLBYTES)
148