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 $ */
5 * SPDX-License-Identifier: BSD-3-Clause
7 * Copyright (c) 1988 University of Utah.
8 * Copyright (c) 1992, 1993
9 * The Regents of the University of California. All rights reserved.
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.
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
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.
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
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
45 #ifndef _MACHINE_VMPARAM_H_
46 #define _MACHINE_VMPARAM_H_
49 * Machine dependent constants mips processors.
53 * Virtual memory related constants, all in bytes
56 #define MAXTSIZ (128UL*1024*1024) /* max text size */
59 #define DFLDSIZ (128UL*1024*1024) /* initial data size limit */
62 #define MAXDSIZ (1*1024UL*1024*1024) /* max data size */
65 #define DFLSSIZ (8UL*1024*1024) /* initial stack size limit */
68 #define MAXSSIZ (64UL*1024*1024) /* max stack size */
71 #define SGROWSIZ (128UL*1024) /* amount to grow stack */
75 * Mach derived constants
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)
82 #define VM_MINUSER_ADDRESS ((vm_offset_t)0x00000000)
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))
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)
94 #define KERNBASE ((vm_offset_t)(intptr_t)(int32_t)0x80000000)
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.
100 #define USRSTACK (VM_MAXUSER_ADDRESS - PAGE_SIZE)
102 #define FREEBSD32_USRSTACK (((vm_offset_t)0x80000000) - PAGE_SIZE)
106 * Disable superpage reservations. (not sure if this is right
107 * I copied it from ARM)
109 #ifndef VM_NRESERVLEVEL
110 #define VM_NRESERVLEVEL 0
114 * How many physical pages per kmem arena virtual page.
116 #ifndef VM_KMEM_SIZE_SCALE
117 #define VM_KMEM_SIZE_SCALE (3)
121 * Optional floor (in bytes) on the size of the kmem arena.
123 #ifndef VM_KMEM_SIZE_MIN
124 #define VM_KMEM_SIZE_MIN (12 * 1024 * 1024)
128 * Optional ceiling (in bytes) on the size of the kmem arena: 40% of the
131 #ifndef VM_KMEM_SIZE_MAX
132 #define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \
133 VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5)
136 /* initial pagein size of beginning of executable file */
137 #ifndef VM_INITIAL_PAGEIN
138 #define VM_INITIAL_PAGEIN 16
141 #define UMA_MD_SMALL_ALLOC
144 * max number of non-contig chunks of physical RAM you can have
146 #define VM_PHYSSEG_MAX 32
149 * The physical address space is sparsely populated.
151 #define VM_PHYSSEG_SPARSE
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
159 #define VM_NFREEPOOL 2
160 #define VM_FREEPOOL_DEFAULT 0
161 #define VM_FREEPOOL_DIRECT 1
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).
171 #define VM_NFREELIST 1
172 #define VM_FREELIST_DEFAULT 0
173 #define VM_FREELIST_DIRECT VM_FREELIST_DEFAULT
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)
183 * The largest allocation size is 1MB.
185 #define VM_NFREEORDER 9
187 #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */
192 #define PMAP_HAS_DMAP 0
194 #define PMAP_HAS_DMAP 1
197 #define PHYS_TO_DMAP(x) MIPS_PHYS_TO_DIRECT(x)
198 #define DMAP_TO_PHYS(x) MIPS_DIRECT_TO_PHYS(x)
201 * Need a page dump array for minidump.
203 #define MINIDUMP_PAGE_TRACKING 1
205 #endif /* !_MACHINE_VMPARAM_H_ */