vmparam.h revision 106486
140561Sbrian/* $FreeBSD: head/sys/ia64/include/vmparam.h 106486 2002-11-06 04:47:38Z marcel $ */ 240561Sbrian/* From: NetBSD: vmparam.h,v 1.6 1997/09/23 23:23:23 mjacob Exp */ 340561Sbrian#ifndef _MACHINE_VMPARAM_H 440561Sbrian#define _MACHINE_VMPARAM_H 540561Sbrian/* 640561Sbrian * Copyright (c) 1988 University of Utah. 740561Sbrian * Copyright (c) 1992, 1993 840561Sbrian * The Regents of the University of California. All rights reserved. 940561Sbrian * 1040561Sbrian * This code is derived from software contributed to Berkeley by 1140561Sbrian * the Systems Programming Group of the University of Utah Computer 1240561Sbrian * Science Department and Ralph Campbell. 1340561Sbrian * 1440561Sbrian * Redistribution and use in source and binary forms, with or without 1540561Sbrian * modification, are permitted provided that the following conditions 1640561Sbrian * are met: 1740561Sbrian * 1. Redistributions of source code must retain the above copyright 1840561Sbrian * notice, this list of conditions and the following disclaimer. 1940561Sbrian * 2. Redistributions in binary form must reproduce the above copyright 2040561Sbrian * notice, this list of conditions and the following disclaimer in the 2140561Sbrian * documentation and/or other materials provided with the distribution. 2240561Sbrian * 3. All advertising materials mentioning features or use of this software 2340561Sbrian * must display the following acknowledgement: 2440561Sbrian * This product includes software developed by the University of 2540561Sbrian * California, Berkeley and its contributors. 2650479Speter * 4. Neither the name of the University nor the names of its contributors 2740561Sbrian * may be used to endorse or promote products derived from this software 2840561Sbrian * without specific prior written permission. 2958032Sbrian * 3058032Sbrian * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 3140561Sbrian * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 3281634Sbrian * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 3381634Sbrian * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 3481634Sbrian * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3540561Sbrian * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3640561Sbrian * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3740561Sbrian * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3840561Sbrian * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3940561Sbrian * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 4040561Sbrian * SUCH DAMAGE. 4178410Sbrian * 4240561Sbrian * from: Utah $Hdr: vmparam.h 1.16 91/01/18$ 4381634Sbrian * 4481634Sbrian * @(#)vmparam.h 8.2 (Berkeley) 4/22/94 4540561Sbrian */ 4640561Sbrian 4740561Sbrian/* 4881634Sbrian * Machine dependent constants for ia64. 4940561Sbrian */ 5040561Sbrian/* 5140561Sbrian * USRTEXT is the start of the user text/data space, while USRSTACK 5240561Sbrian * is the top (end) of the user stack. Immediately above the user stack 5340561Sbrian * resides the user structure, which is UPAGES long and contains the 5481634Sbrian * kernel stack. 5540561Sbrian */ 5640561Sbrian#define USRTEXT CLBYTES 5781634Sbrian#define USRSTACK VM_MAXUSER_ADDRESS 5881634Sbrian 5981634Sbrian/* 6081634Sbrian * Virtual memory related constants, all in bytes 6140561Sbrian */ 6274916Sbrian#ifndef MAXTSIZ 6374916Sbrian#define MAXTSIZ (1<<30) /* max text size (1G) */ 6440561Sbrian#endif 6558032Sbrian#ifndef DFLDSIZ 66#define DFLDSIZ (1<<27) /* initial data size (128M) */ 67#endif 68#ifndef MAXDSIZ 69#define MAXDSIZ (1<<30) /* max data size (1G) */ 70#endif 71#ifndef DFLSSIZ 72#define DFLSSIZ (1<<21) /* initial stack size (2M) */ 73#endif 74#ifndef MAXSSIZ 75#define MAXSSIZ (1<<28) /* max stack size (256M) */ 76#endif 77#ifndef SGROWSIZ 78#define SGROWSIZ (128UL*1024) /* amount to grow stack */ 79#endif 80 81/* 82 * PTEs for mapping user space into the kernel for phyio operations. 83 * 64 pte's are enough to cover 8 disks * MAXBSIZE. 84 */ 85#ifndef USRIOSIZE 86#define USRIOSIZE 64 87#endif 88 89/* 90 * Boundary at which to place first MAPMEM segment if not explicitly 91 * specified. Should be a power of two. This allows some slop for 92 * the data segment to grow underneath the first mapped segment. 93 */ 94#define MMSEG 0x200000 95 96/* 97 * The size of the clock loop. 98 */ 99#define LOOPPAGES (maxfree - firstfree) 100 101/* 102 * The time for a process to be blocked before being very swappable. 103 * This is a number of seconds which the system takes as being a non-trivial 104 * amount of real time. You probably shouldn't change this; 105 * it is used in subtle ways (fractions and multiples of it are, that is, like 106 * half of a ``long time'', almost a long time, etc.) 107 * It is related to human patience and other factors which don't really 108 * change over time. 109 */ 110#define MAXSLP 20 111 112/* 113 * A swapped in process is given a small amount of core without being bothered 114 * by the page replacement algorithm. Basically this says that if you are 115 * swapped in you deserve some resources. We protect the last SAFERSS 116 * pages against paging and will just swap you out rather than paging you. 117 * Note that each process has at least UPAGES+CLSIZE pages which are not 118 * paged anyways, in addition to SAFERSS. 119 */ 120#define SAFERSS 10 /* nominal ``small'' resident set size 121 protected against replacement */ 122 123/* 124 * We need region 7 virtual addresses for pagetables. 125 */ 126#define UMA_MD_SMALL_ALLOC 127 128/* 129 * Manipulating region bits of an address. 130 */ 131#define IA64_RR_BASE(n) (((u_int64_t) (n)) << 61) 132#define IA64_RR_MASK(x) ((x) & ((1L << 61) - 1)) 133 134#define IA64_PHYS_TO_RR6(x) ((x) | IA64_RR_BASE(6)) 135#define IA64_PHYS_TO_RR7(x) ((x) | IA64_RR_BASE(7)) 136 137/* 138 * Mach derived constants 139 */ 140 141/* user/kernel map constants */ 142#define VM_MIN_ADDRESS 0 143#define VM_MAXUSER_ADDRESS IA64_RR_BASE(5) 144#define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS 145#define VM_MIN_KERNEL_ADDRESS IA64_RR_BASE(5) 146#define VM_MAX_KERNEL_ADDRESS (IA64_RR_BASE(6) - 1) 147 148#define KERNBASE (VM_MIN_KERNEL_ADDRESS) 149 150/* virtual sizes (bytes) for various kernel submaps */ 151#ifndef VM_KMEM_SIZE 152#define VM_KMEM_SIZE (12 * 1024 * 1024) 153#endif 154 155/* 156 * How many physical pages per KVA page allocated. 157 * min(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), VM_KMEM_SIZE_MAX) 158 * is the total KVA space allocated for kmem_map. 159 */ 160#ifndef VM_KMEM_SIZE_SCALE 161#define VM_KMEM_SIZE_SCALE (4) /* XXX 8192 byte pages */ 162#endif 163 164/* initial pagein size of beginning of executable file */ 165#ifndef VM_INITIAL_PAGEIN 166#define VM_INITIAL_PAGEIN 16 167#endif 168 169#endif /* !_MACHINE_VMPARAM_H */ 170