1/* $OpenBSD: vmparam.h,v 1.2 1998/09/15 10:50:12 pefo Exp $ */ 2/* $NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp $ */ 3 4/* 5 * SPDX-License-Identifier: BSD-3-Clause 6 * 7 * Copyright (c) 1988 University of Utah. 8 * Copyright (c) 1992, 1993 9 * The Regents of the University of California. All rights reserved. 10 * 11 * This code is derived from software contributed to Berkeley by 12 * the Systems Programming Group of the University of Utah Computer 13 * Science Department and Ralph Campbell. 14 * 15 * Redistribution and use in source and binary forms, with or without 16 * modification, are permitted provided that the following conditions 17 * are met: 18 * 1. Redistributions of source code must retain the above copyright 19 * notice, this list of conditions and the following disclaimer. 20 * 2. Redistributions in binary form must reproduce the above copyright 21 * notice, this list of conditions and the following disclaimer in the 22 * documentation and/or other materials provided with the distribution. 23 * 3. Neither the name of the University nor the names of its contributors 24 * may be used to endorse or promote products derived from this software 25 * without specific prior written permission. 26 * 27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * from: Utah Hdr: vmparam.h 1.16 91/01/18 40 * @(#)vmparam.h 8.2 (Berkeley) 4/22/94 41 * JNPR: vmparam.h,v 1.3.2.1 2007/09/10 06:01:28 girish 42 * $FreeBSD$ 43 */ 44 45#ifndef _MACHINE_VMPARAM_H_ 46#define _MACHINE_VMPARAM_H_ 47 48/* 49 * Machine dependent constants mips processors. 50 */ 51 52/* 53 * Virtual memory related constants, all in bytes 54 */ 55#ifndef MAXTSIZ 56#define MAXTSIZ (128UL*1024*1024) /* max text size */ 57#endif 58#ifndef DFLDSIZ 59#define DFLDSIZ (128UL*1024*1024) /* initial data size limit */ 60#endif 61#ifndef MAXDSIZ 62#define MAXDSIZ (1*1024UL*1024*1024) /* max data size */ 63#endif 64#ifndef DFLSSIZ 65#define DFLSSIZ (8UL*1024*1024) /* initial stack size limit */ 66#endif 67#ifndef MAXSSIZ 68#define MAXSSIZ (64UL*1024*1024) /* max stack size */ 69#endif 70#ifndef SGROWSIZ 71#define SGROWSIZ (128UL*1024) /* amount to grow stack */ 72#endif 73 74/* 75 * Mach derived constants 76 */ 77 78/* user/kernel map constants */ 79#define VM_MIN_ADDRESS ((vm_offset_t)0x00000000) 80#define VM_MAX_ADDRESS ((vm_offset_t)(intptr_t)(int32_t)0xffffffff) 81 82#define VM_MINUSER_ADDRESS ((vm_offset_t)0x00000000) 83 84#ifdef __mips_n64 85#define VM_MAXUSER_ADDRESS (VM_MINUSER_ADDRESS + (NPDEPG * NBSEG)) 86#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)0xc000000000000000) 87#define VM_MAX_KERNEL_ADDRESS (VM_MIN_KERNEL_ADDRESS + (NPDEPG * NBSEG)) 88#else 89#define VM_MAXUSER_ADDRESS ((vm_offset_t)0x80000000) 90#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)0xC0000000) 91#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0xFFFFC000) 92#endif 93 94#define KERNBASE ((vm_offset_t)(intptr_t)(int32_t)0x80000000) 95/* 96 * USRSTACK needs to start a little below 0x8000000 because the R8000 97 * and some QED CPUs perform some virtual address checks before the 98 * offset is calculated. 99 */ 100#define USRSTACK (VM_MAXUSER_ADDRESS - PAGE_SIZE) 101#ifdef __mips_n64 102#define FREEBSD32_USRSTACK (((vm_offset_t)0x80000000) - PAGE_SIZE) 103#endif 104 105/* 106 * Disable superpage reservations. (not sure if this is right 107 * I copied it from ARM) 108 */ 109#ifndef VM_NRESERVLEVEL 110#define VM_NRESERVLEVEL 0 111#endif 112 113/* 114 * How many physical pages per kmem arena virtual page. 115 */ 116#ifndef VM_KMEM_SIZE_SCALE 117#define VM_KMEM_SIZE_SCALE (3) 118#endif 119 120/* 121 * Optional floor (in bytes) on the size of the kmem arena. 122 */ 123#ifndef VM_KMEM_SIZE_MIN 124#define VM_KMEM_SIZE_MIN (12 * 1024 * 1024) 125#endif 126 127/* 128 * Optional ceiling (in bytes) on the size of the kmem arena: 40% of the 129 * kernel map. 130 */ 131#ifndef VM_KMEM_SIZE_MAX 132#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ 133 VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) 134#endif 135 136/* initial pagein size of beginning of executable file */ 137#ifndef VM_INITIAL_PAGEIN 138#define VM_INITIAL_PAGEIN 16 139#endif 140 141#define UMA_MD_SMALL_ALLOC 142 143/* 144 * max number of non-contig chunks of physical RAM you can have 145 */ 146#define VM_PHYSSEG_MAX 32 147 148/* 149 * The physical address space is sparsely populated. 150 */ 151#define VM_PHYSSEG_SPARSE 152 153/* 154 * Create two free page pools: VM_FREEPOOL_DEFAULT is the default pool 155 * from which physical pages are allocated and VM_FREEPOOL_DIRECT is 156 * the pool from which physical pages for small UMA objects are 157 * allocated. 158 */ 159#define VM_NFREEPOOL 2 160#define VM_FREEPOOL_DEFAULT 0 161#define VM_FREEPOOL_DIRECT 1 162 163/* 164 * Create up to two free lists on !__mips_n64: VM_FREELIST_DEFAULT is for 165 * physical pages that are above the largest physical address that is 166 * accessible through the direct map (KSEG0) and VM_FREELIST_LOWMEM is for 167 * physical pages that are below that address. VM_LOWMEM_BOUNDARY is the 168 * physical address for the end of the direct map (KSEG0). 169 */ 170#ifdef __mips_n64 171#define VM_NFREELIST 1 172#define VM_FREELIST_DEFAULT 0 173#define VM_FREELIST_DIRECT VM_FREELIST_DEFAULT 174#else 175#define VM_NFREELIST 2 176#define VM_FREELIST_DEFAULT 0 177#define VM_FREELIST_LOWMEM 1 178#define VM_FREELIST_DIRECT VM_FREELIST_LOWMEM 179#define VM_LOWMEM_BOUNDARY ((vm_paddr_t)0x20000000) 180#endif 181 182/* 183 * The largest allocation size is 1MB. 184 */ 185#define VM_NFREEORDER 9 186 187#define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ 188 189#ifndef __mips_n64 190#define SFBUF 191#define SFBUF_MAP 192#define PMAP_HAS_DMAP 0 193#else 194#define PMAP_HAS_DMAP 1 195#endif 196 197#define PHYS_TO_DMAP(x) MIPS_PHYS_TO_DIRECT(x) 198#define DMAP_TO_PHYS(x) MIPS_DIRECT_TO_PHYS(x) 199 200#endif /* !_MACHINE_VMPARAM_H_ */ 201