15b81b6b3SRodney W. Grimes /*- 25b81b6b3SRodney W. Grimes * Copyright (c) 1990 The Regents of the University of California. 35b81b6b3SRodney W. Grimes * All rights reserved. 47f8cb368SDavid Greenman * Copyright (c) 1994 John S. Dyson 57f8cb368SDavid Greenman * All rights reserved. 65b81b6b3SRodney W. Grimes * 75b81b6b3SRodney W. Grimes * This code is derived from software contributed to Berkeley by 85b81b6b3SRodney W. Grimes * William Jolitz. 95b81b6b3SRodney W. Grimes * 105b81b6b3SRodney W. Grimes * Redistribution and use in source and binary forms, with or without 115b81b6b3SRodney W. Grimes * modification, are permitted provided that the following conditions 125b81b6b3SRodney W. Grimes * are met: 135b81b6b3SRodney W. Grimes * 1. Redistributions of source code must retain the above copyright 145b81b6b3SRodney W. Grimes * notice, this list of conditions and the following disclaimer. 155b81b6b3SRodney W. Grimes * 2. Redistributions in binary form must reproduce the above copyright 165b81b6b3SRodney W. Grimes * notice, this list of conditions and the following disclaimer in the 175b81b6b3SRodney W. Grimes * documentation and/or other materials provided with the distribution. 185b81b6b3SRodney W. Grimes * 4. Neither the name of the University nor the names of its contributors 195b81b6b3SRodney W. Grimes * may be used to endorse or promote products derived from this software 205b81b6b3SRodney W. Grimes * without specific prior written permission. 215b81b6b3SRodney W. Grimes * 225b81b6b3SRodney W. Grimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 235b81b6b3SRodney W. Grimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 245b81b6b3SRodney W. Grimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 255b81b6b3SRodney W. Grimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 265b81b6b3SRodney W. Grimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 275b81b6b3SRodney W. Grimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 285b81b6b3SRodney W. Grimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 295b81b6b3SRodney W. Grimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 305b81b6b3SRodney W. Grimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 315b81b6b3SRodney W. Grimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 325b81b6b3SRodney W. Grimes * SUCH DAMAGE. 335b81b6b3SRodney W. Grimes * 34d42d25c4SRodney W. Grimes * from: @(#)vmparam.h 5.9 (Berkeley) 5/12/91 35c3aac50fSPeter Wemm * $FreeBSD$ 365b81b6b3SRodney W. Grimes */ 375b81b6b3SRodney W. Grimes 385b81b6b3SRodney W. Grimes 396e393973SGarrett Wollman #ifndef _MACHINE_VMPARAM_H_ 406e393973SGarrett Wollman #define _MACHINE_VMPARAM_H_ 1 416e393973SGarrett Wollman 425b81b6b3SRodney W. Grimes /* 435b81b6b3SRodney W. Grimes * Machine dependent constants for 386. 445b81b6b3SRodney W. Grimes */ 455b81b6b3SRodney W. Grimes 462e137367SRuslan Ermilov #ifndef PAE 47d0aea04fSJohn Dyson #define VM_PROT_READ_IS_EXEC /* if you can read -- then you can exec */ 482e137367SRuslan Ermilov #endif 49d0aea04fSJohn Dyson 505b81b6b3SRodney W. Grimes /* 515b81b6b3SRodney W. Grimes * Virtual memory related constants, all in bytes 525b81b6b3SRodney W. Grimes */ 53f4fabec6SDavid Greenman #define MAXTSIZ (128UL*1024*1024) /* max text size */ 545b81b6b3SRodney W. Grimes #ifndef DFLDSIZ 55f4fabec6SDavid Greenman #define DFLDSIZ (128UL*1024*1024) /* initial data size limit */ 565b81b6b3SRodney W. Grimes #endif 575b81b6b3SRodney W. Grimes #ifndef MAXDSIZ 587416845fSJordan K. Hubbard #define MAXDSIZ (512UL*1024*1024) /* max data size */ 595b81b6b3SRodney W. Grimes #endif 605b81b6b3SRodney W. Grimes #ifndef DFLSSIZ 6129360eb0SDavid Greenman #define DFLSSIZ (8UL*1024*1024) /* initial stack size limit */ 625b81b6b3SRodney W. Grimes #endif 635b81b6b3SRodney W. Grimes #ifndef MAXSSIZ 64e10a6186SDavid Greenman #define MAXSSIZ (64UL*1024*1024) /* max stack size */ 655b81b6b3SRodney W. Grimes #endif 6629360eb0SDavid Greenman #ifndef SGROWSIZ 6729360eb0SDavid Greenman #define SGROWSIZ (128UL*1024) /* amount to grow stack */ 6829360eb0SDavid Greenman #endif 695b81b6b3SRodney W. Grimes 70e911eafcSPoul-Henning Kamp #define USRTEXT (1*PAGE_SIZE) /* base of user text XXX bogus */ 71cde72574SDavid Greenman 725b81b6b3SRodney W. Grimes /* 735b81b6b3SRodney W. Grimes * The time for a process to be blocked before being very swappable. 745b81b6b3SRodney W. Grimes * This is a number of seconds which the system takes as being a non-trivial 755b81b6b3SRodney W. Grimes * amount of real time. You probably shouldn't change this; 765b81b6b3SRodney W. Grimes * it is used in subtle ways (fractions and multiples of it are, that is, like 775b81b6b3SRodney W. Grimes * half of a ``long time'', almost a long time, etc.) 785b81b6b3SRodney W. Grimes * It is related to human patience and other factors which don't really 795b81b6b3SRodney W. Grimes * change over time. 805b81b6b3SRodney W. Grimes */ 815b81b6b3SRodney W. Grimes #define MAXSLP 20 825b81b6b3SRodney W. Grimes 8368c1eb12SPoul-Henning Kamp 845b81b6b3SRodney W. Grimes /* 8504a18977SAlan Cox * The physical address space is densely populated. 8604a18977SAlan Cox */ 8704a18977SAlan Cox #define VM_PHYSSEG_DENSE 8804a18977SAlan Cox 8904a18977SAlan Cox /* 906ccf265bSPeter Wemm * Kernel physical load address. 916ccf265bSPeter Wemm */ 926ccf265bSPeter Wemm #ifndef KERNLOAD 936ccf265bSPeter Wemm #define KERNLOAD (1 << PDRSHIFT) 946ccf265bSPeter Wemm #endif 956ccf265bSPeter Wemm 966ccf265bSPeter Wemm /* 9768c1eb12SPoul-Henning Kamp * Virtual addresses of things. Derived from the page directory and 9868c1eb12SPoul-Henning Kamp * page table indexes from pmap.h for precision. 9968c1eb12SPoul-Henning Kamp * Because of the page that is both a PD and PT, it looks a little 10068c1eb12SPoul-Henning Kamp * messy at times, but hey, we'll do anything to save a page :-) 1015b81b6b3SRodney W. Grimes */ 1025b81b6b3SRodney W. Grimes 10346ea68ddSJake Burkholder #define VM_MAX_KERNEL_ADDRESS VADDR(KPTDI+NKPDE-1, NPTEPG-1) 10468c1eb12SPoul-Henning Kamp #define VM_MIN_KERNEL_ADDRESS VADDR(PTDPTDI, PTDPTDI) 1057f8cb368SDavid Greenman 10668c1eb12SPoul-Henning Kamp #define KERNBASE VADDR(KPTDI, 0) 10768c1eb12SPoul-Henning Kamp 10868c1eb12SPoul-Henning Kamp #define UPT_MAX_ADDRESS VADDR(PTDPTDI, PTDPTDI) 10968c1eb12SPoul-Henning Kamp #define UPT_MIN_ADDRESS VADDR(PTDPTDI, 0) 11068c1eb12SPoul-Henning Kamp 1115cd612b2SJake Burkholder #define VM_MAXUSER_ADDRESS VADDR(PTDPTDI, 0) 11268c1eb12SPoul-Henning Kamp 1137f8cb368SDavid Greenman #define USRSTACK VM_MAXUSER_ADDRESS 11468c1eb12SPoul-Henning Kamp 11568c1eb12SPoul-Henning Kamp #define VM_MAX_ADDRESS VADDR(PTDPTDI, PTDPTDI) 11668c1eb12SPoul-Henning Kamp #define VM_MIN_ADDRESS ((vm_offset_t)0) 1175b81b6b3SRodney W. Grimes 1185b81b6b3SRodney W. Grimes /* virtual sizes (bytes) for various kernel submaps */ 1197bcc0f3dSTor Egge #ifndef VM_KMEM_SIZE 120d9bed5beSJohn Dyson #define VM_KMEM_SIZE (12 * 1024 * 1024) 121d9bed5beSJohn Dyson #endif 122d9bed5beSJohn Dyson 123d9bed5beSJohn Dyson /* 124d9bed5beSJohn Dyson * How many physical pages per KVA page allocated. 1250e5179e4SStephane E. Potvin * min(max(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), 1260e5179e4SStephane E. Potvin * VM_KMEM_SIZE_MIN), VM_KMEM_SIZE_MAX) 127d9bed5beSJohn Dyson * is the total KVA space allocated for kmem_map. 128d9bed5beSJohn Dyson */ 129d9bed5beSJohn Dyson #ifndef VM_KMEM_SIZE_SCALE 130d9bed5beSJohn Dyson #define VM_KMEM_SIZE_SCALE (3) 131d9bed5beSJohn Dyson #endif 132d9bed5beSJohn Dyson 133d9bed5beSJohn Dyson /* 134d9bed5beSJohn Dyson * Ceiling on amount of kmem_map kva space. 135d9bed5beSJohn Dyson */ 136d9bed5beSJohn Dyson #ifndef VM_KMEM_SIZE_MAX 1379c737de4SDavid E. O'Brien #define VM_KMEM_SIZE_MAX (320 * 1024 * 1024) 1387bcc0f3dSTor Egge #endif 1395b81b6b3SRodney W. Grimes 14095461b45SJohn Dyson /* initial pagein size of beginning of executable file */ 14195461b45SJohn Dyson #ifndef VM_INITIAL_PAGEIN 14295461b45SJohn Dyson #define VM_INITIAL_PAGEIN 16 14395461b45SJohn Dyson #endif 14495461b45SJohn Dyson 1456e393973SGarrett Wollman #endif /* _MACHINE_VMPARAM_H_ */ 146