vmparam3.h revision 1.7
11.7Sglass/*
21.7Sglass * Copyright (c) 1993 Adam Glass
31.7Sglass * Copyright (c) 1988 University of Utah.
41.7Sglass * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
51.7Sglass * All rights reserved.
61.7Sglass *
71.7Sglass * This code is derived from software contributed to Berkeley by
81.7Sglass * the Systems Programming Group of the University of Utah Computer
91.7Sglass * Science Department.
101.7Sglass *
111.7Sglass * Redistribution and use in source and binary forms, with or without
121.7Sglass * modification, are permitted provided that the following conditions
131.7Sglass * are met:
141.7Sglass * 1. Redistributions of source code must retain the above copyright
151.7Sglass *    notice, this list of conditions and the following disclaimer.
161.7Sglass * 2. Redistributions in binary form must reproduce the above copyright
171.7Sglass *    notice, this list of conditions and the following disclaimer in the
181.7Sglass *    documentation and/or other materials provided with the distribution.
191.7Sglass * 3. All advertising materials mentioning features or use of this software
201.7Sglass *    must display the following acknowledgement:
211.7Sglass *	This product includes software developed by the University of
221.7Sglass *	California, Berkeley and its contributors.
231.7Sglass * 4. Neither the name of the University nor the names of its contributors
241.7Sglass *    may be used to endorse or promote products derived from this software
251.7Sglass *    without specific prior written permission.
261.7Sglass *
271.7Sglass * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
281.7Sglass * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
291.7Sglass * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
301.7Sglass * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
311.7Sglass * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
321.7Sglass * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
331.7Sglass * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
341.7Sglass * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
351.7Sglass * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
361.7Sglass * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
371.7Sglass * SUCH DAMAGE.
381.7Sglass *
391.7Sglass * from: Utah $Hdr: vmparam.h 1.16 91/01/18$
401.7Sglass *
411.7Sglass *	from: @(#)vmparam.h	7.3 (Berkeley) 5/7/91
421.7Sglass *	vmparam.h,v 1.2 1993/05/22 07:58:38 cgd Exp
431.7Sglass */
441.1Sglass
451.1Sglass#define USRTEXT         NBPG
461.6Sglass#define USRSTACK        0x0E000000
471.1Sglass
481.1Sglass/*
491.1Sglass * Virtual memory related constants, all in bytes
501.1Sglass */
511.1Sglass#ifndef MAXTSIZ
521.6Sglass#define	MAXTSIZ		(8*1024*1024)		/* max text size */
531.1Sglass#endif
541.1Sglass#ifndef DFLDSIZ
551.1Sglass#define	DFLDSIZ		(8*1024*1024)		/* initial data size limit */
561.1Sglass#endif
571.1Sglass#ifndef MAXDSIZ
581.6Sglass#define	MAXDSIZ		(32*1024*1024)		/* max data size */
591.1Sglass#endif
601.1Sglass#ifndef	DFLSSIZ
611.1Sglass#define	DFLSSIZ		(512*1024)		/* initial stack size limit */
621.1Sglass#endif
631.1Sglass#ifndef	MAXSSIZ
641.6Sglass#define	MAXSSIZ		(MAXDSIZ)		/* max stack size */
651.1Sglass#endif
661.1Sglass
671.1Sglass/*
681.1Sglass * Default sizes of swap allocation chunks (see dmap.h).
691.1Sglass * The actual values may be changed in vminit() based on MAXDSIZ.
701.1Sglass * With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024.
711.1Sglass * DMMIN should be at least ctod(1) so that vtod() works.
721.1Sglass * vminit() insures this.
731.1Sglass */
741.1Sglass#define	DMMIN	32			/* smallest swap allocation */
751.1Sglass#define	DMMAX	4096			/* largest potential swap allocation */
761.1Sglass
771.1Sglass/*
781.4Sglass * PTEs for mapping user space into the kernel for phyio operations.
791.4Sglass * [this figure is based on the assumption that you can put ptes in real
801.4Sglass *  memory.  this is a false assumption on a sun3]
811.4Sglass *
821.4Sglass */
831.4Sglass#ifndef USRIOSIZE
841.4Sglass#define USRIOSIZE	1
851.4Sglass#endif
861.4Sglass
871.4Sglass/*
881.1Sglass * The time for a process to be blocked before being very swappable.
891.1Sglass * This is a number of seconds which the system takes as being a non-trivial
901.1Sglass * amount of real time.  You probably shouldn't change this;
911.1Sglass * it is used in subtle ways (fractions and multiples of it are, that is, like
921.1Sglass * half of a ``long time'', almost a long time, etc.)
931.1Sglass * It is related to human patience and other factors which don't really
941.1Sglass * change over time.
951.1Sglass */
961.1Sglass#define	MAXSLP 		20
971.1Sglass
981.1Sglass/*
991.1Sglass * A swapped in process is given a small amount of core without being bothered
1001.1Sglass * by the page replacement algorithm.  Basically this says that if you are
1011.1Sglass * swapped in you deserve some resources.  We protect the last SAFERSS
1021.1Sglass * pages against paging and will just swap you out rather than paging you.
1031.1Sglass * Note that each process has at least UPAGES+CLSIZE pages which are not
1041.1Sglass * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this
1051.1Sglass * number just means a swapped in process is given around 25k bytes.
1061.1Sglass * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81),
1071.1Sglass * so we loan each swapped in process memory worth 100$, or just admit
1081.1Sglass * that we don't consider it worthwhile and swap it out to disk which costs
1091.1Sglass * $30/mb or about $0.75.
1101.1Sglass */
1111.1Sglass#define	SAFERSS		4		/* nominal ``small'' resident set size
1121.1Sglass					   protected against replacement */
1131.1Sglass
1141.5Sglass#define DVMA_SPACE_SIZE  0x00100000
1151.5Sglass#define DVMA_SPACE_START 0x0FD00000
1161.5Sglass#define DVMA_SPACE_END   0x0FE00000 /* mon start */
1171.1Sglass
1181.1Sglass/*
1191.1Sglass * Mach derived constants
1201.1Sglass */
1211.1Sglass
1221.1Sglass/* user/kernel map constants */
1231.1Sglass#define VM_MIN_ADDRESS		((vm_offset_t)0)
1241.2Sglass#define VM_MAXUSER_ADDRESS	((vm_offset_t)0x0E000000)
1251.6Sglass#define VM_MAX_ADDRESS		((vm_offset_t)0x0FFF00000)
1261.1Sglass#define VM_MIN_KERNEL_ADDRESS	((vm_offset_t)0x0E004000)
1271.6Sglass#define VM_MAX_KERNEL_ADDRESS	((vm_offset_t)0x0FD00000) /* dvma start */
1281.1Sglass
1291.1Sglass/* virtual sizes (bytes) for various kernel submaps */
1301.1Sglass#define VM_MBUF_SIZE		(NMBCLUSTERS*MCLBYTES)
1311.1Sglass#define VM_KMEM_SIZE		(NKMEMCLUSTERS*CLBYTES)
1321.1Sglass#define VM_PHYS_SIZE		(USRIOSIZE*CLBYTES)
133