vmparam.h revision 1.4
11.4Sthorpej/* $NetBSD: vmparam.h,v 1.4 2001/05/01 02:19:16 thorpej Exp $ */ 21.1Snisimura 31.1Snisimura/* 41.1Snisimura * Copyright (c) 1988 University of Utah. 51.1Snisimura * Copyright (c) 1982, 1986, 1990, 1993 61.1Snisimura * The Regents of the University of California. All rights reserved. 71.1Snisimura * 81.1Snisimura * This code is derived from software contributed to Berkeley by 91.1Snisimura * the Systems Programming Group of the University of Utah Computer 101.1Snisimura * Science Department. 111.1Snisimura * 121.1Snisimura * Redistribution and use in source and binary forms, with or without 131.1Snisimura * modification, are permitted provided that the following conditions 141.1Snisimura * are met: 151.1Snisimura * 1. Redistributions of source code must retain the above copyright 161.1Snisimura * notice, this list of conditions and the following disclaimer. 171.1Snisimura * 2. Redistributions in binary form must reproduce the above copyright 181.1Snisimura * notice, this list of conditions and the following disclaimer in the 191.1Snisimura * documentation and/or other materials provided with the distribution. 201.1Snisimura * 3. All advertising materials mentioning features or use of this software 211.1Snisimura * must display the following acknowledgement: 221.1Snisimura * This product includes software developed by the University of 231.1Snisimura * California, Berkeley and its contributors. 241.1Snisimura * 4. Neither the name of the University nor the names of its contributors 251.1Snisimura * may be used to endorse or promote products derived from this software 261.1Snisimura * without specific prior written permission. 271.1Snisimura * 281.1Snisimura * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 291.1Snisimura * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 301.1Snisimura * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 311.1Snisimura * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 321.1Snisimura * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 331.1Snisimura * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 341.1Snisimura * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 351.1Snisimura * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 361.1Snisimura * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 371.1Snisimura * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 381.1Snisimura * SUCH DAMAGE. 391.1Snisimura * 401.1Snisimura * from: Utah $Hdr: vmparam.h 1.16 91/01/18$ 411.1Snisimura * 421.1Snisimura * @(#)vmparam.h 8.2 (Berkeley) 4/19/94 431.1Snisimura */ 441.1Snisimura 451.1Snisimura#ifndef _MACHINE_VMPARAM_H_ 461.1Snisimura#define _MACHINE_VMPARAM_H_ 471.1Snisimura 481.1Snisimura/* 491.1Snisimura * USRTEXT is the start of the user text/data space, while USRSTACK 501.1Snisimura * is the top (end) of the user stack. 511.1Snisimura */ 521.1Snisimura#define USRTEXT 8192 531.1Snisimura#define USRSTACK VM_MAXUSER_ADDRESS 541.1Snisimura 551.1Snisimura/* 561.1Snisimura * Virtual memory related constants, all in bytes 571.1Snisimura */ 581.1Snisimura#ifndef MAXTSIZ 591.1Snisimura#define MAXTSIZ (8*1024*1024) /* max text size */ 601.1Snisimura#endif 611.1Snisimura#ifndef DFLDSIZ 621.1Snisimura#define DFLDSIZ (16*1024*1024) /* initial data size limit */ 631.1Snisimura#endif 641.1Snisimura#ifndef MAXDSIZ 651.1Snisimura#define MAXDSIZ (64*1024*1024) /* max data size */ 661.1Snisimura#endif 671.1Snisimura#ifndef DFLSSIZ 681.1Snisimura#define DFLSSIZ (512*1024) /* initial stack size limit */ 691.1Snisimura#endif 701.1Snisimura#ifndef MAXSSIZ 711.1Snisimura#define MAXSSIZ MAXDSIZ /* max stack size */ 721.1Snisimura#endif 731.1Snisimura 741.1Snisimura/* 751.1Snisimura * Sizes of the system and user portions of the system page table. 761.1Snisimura */ 771.1Snisimura/* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */ 781.1Snisimura#define SYSPTSIZE (2 * NPTEPG) /* 8mb */ 791.1Snisimura#define USRPTSIZE (1 * NPTEPG) /* 4mb */ 801.1Snisimura 811.1Snisimura/* 821.1Snisimura * PTEs for mapping user space into the kernel for phyio operations. 831.1Snisimura * One page is enough to handle 4Mb of simultaneous raw IO operations. 841.1Snisimura */ 851.1Snisimura#ifndef USRIOSIZE 861.1Snisimura#define USRIOSIZE (1 * NPTEPG) /* 4mb */ 871.1Snisimura#endif 881.1Snisimura 891.1Snisimura/* 901.1Snisimura * PTEs for system V style shared memory. 911.1Snisimura * This is basically slop for kmempt which we actually allocate (malloc) from. 921.1Snisimura */ 931.1Snisimura#ifndef SHMMAXPGS 941.1Snisimura#define SHMMAXPGS 1024 /* 8mb */ 951.1Snisimura#endif 961.1Snisimura 971.1Snisimura/* 981.1Snisimura * The time for a process to be blocked before being very swappable. 991.1Snisimura * This is a number of seconds which the system takes as being a non-trivial 1001.1Snisimura * amount of real time. You probably shouldn't change this; 1011.1Snisimura * it is used in subtle ways (fractions and multiples of it are, that is, like 1021.1Snisimura * half of a ``long time'', almost a long time, etc.) 1031.1Snisimura * It is related to human patience and other factors which don't really 1041.1Snisimura * change over time. 1051.1Snisimura */ 1061.1Snisimura#define MAXSLP 20 1071.1Snisimura 1081.1Snisimura/* user/kernel map constants */ 1091.1Snisimura#define VM_MIN_ADDRESS ((vaddr_t)0) 1101.1Snisimura#define VM_MAXUSER_ADDRESS ((vaddr_t)0xFFFC0000) 1111.1Snisimura#define VM_MAX_ADDRESS ((vaddr_t)0xFFFC0000) 1121.1Snisimura#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0) 1131.1Snisimura#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-NBPG)) 1141.1Snisimura 1151.1Snisimura/* virtual sizes (bytes) for various kernel submaps */ 1161.1Snisimura#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) 1171.1Snisimura#define VM_PHYS_SIZE (USRIOSIZE*NBPG) 1181.1Snisimura 1191.1Snisimura/* # of kernel PT pages (initial only, can grow dynamically) */ 1201.1Snisimura#define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */ 1211.1Snisimura 1221.1Snisimura/* 1231.1Snisimura * Constants which control the way the VM system deals with memory segments. 1241.1Snisimura * Only one physical contigous memory segment. 1251.1Snisimura */ 1261.1Snisimura#define VM_PHYSSEG_MAX 1 1271.1Snisimura#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH 1281.1Snisimura#define VM_PHYSSEG_NOADD 1291.1Snisimura 1301.1Snisimura#define VM_NFREELIST 1 1311.1Snisimura#define VM_FREELIST_DEFAULT 0 1321.3Sthorpej 1331.4Sthorpej#define __HAVE_PMAP_PHYSSEG 1341.1Snisimura 1351.1Snisimura/* 1361.1Snisimura * pmap-specific data stored in the vm_physmem[] array. 1371.1Snisimura */ 1381.1Snisimurastruct pmap_physseg { 1391.1Snisimura struct pv_entry *pvent; /* pv table for this seg */ 1401.1Snisimura char *attrs; /* page attributes for this seg */ 1411.1Snisimura}; 1421.1Snisimura 1431.1Snisimura#endif /* _MACHINE_VMPARAM_H_ */ 144