vmparam.h revision 210627
198121Sgshapiro/*	$OpenBSD: vmparam.h,v 1.2 1998/09/15 10:50:12 pefo Exp $	*/
264562Sgshapiro/*	$NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp $	*/
364562Sgshapiro
464562Sgshapiro/*
564562Sgshapiro * Copyright (c) 1988 University of Utah.
664562Sgshapiro * Copyright (c) 1992, 1993
764562Sgshapiro *	The Regents of the University of California.  All rights reserved.
864562Sgshapiro *
964562Sgshapiro * This code is derived from software contributed to Berkeley by
1064562Sgshapiro * the Systems Programming Group of the University of Utah Computer
1164562Sgshapiro * Science Department and Ralph Campbell.
1264562Sgshapiro *
1364562Sgshapiro * Redistribution and use in source and binary forms, with or without
1464562Sgshapiro * modification, are permitted provided that the following conditions
1564562Sgshapiro * are met:
1664562Sgshapiro * 1. Redistributions of source code must retain the above copyright
1764562Sgshapiro *    notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 *    notice, this list of conditions and the following disclaimer in the
20 *    documentation and/or other materials provided with the distribution.
21 * 4. Neither the name of the University nor the names of its contributors
22 *    may be used to endorse or promote products derived from this software
23 *    without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 *	from: Utah Hdr: vmparam.h 1.16 91/01/18
38 *	@(#)vmparam.h	8.2 (Berkeley) 4/22/94
39 *	JNPR: vmparam.h,v 1.3.2.1 2007/09/10 06:01:28 girish
40 * $FreeBSD: head/sys/mips/include/vmparam.h 210627 2010-07-29 20:02:56Z jchandra $
41 */
42
43#ifndef _MACHINE_VMPARAM_H_
44#define	_MACHINE_VMPARAM_H_
45
46/*
47 * Machine dependent constants mips processors.
48 */
49/*
50 * USRTEXT is the start of the user text/data space, while USRSTACK
51 * is the top (end) of the user stack.
52 */
53#define	USRTEXT		(1*PAGE_SIZE)
54
55/*
56 * Virtual memory related constants, all in bytes
57 */
58#ifndef MAXTSIZ
59#define	MAXTSIZ		(128UL*1024*1024)	/* max text size */
60#endif
61#ifndef DFLDSIZ
62#define	DFLDSIZ		(128UL*1024*1024)	/* initial data size limit */
63#endif
64#ifndef MAXDSIZ
65#define	MAXDSIZ		(1*1024UL*1024*1024)	/* max data size */
66#endif
67#ifndef DFLSSIZ
68#define	DFLSSIZ		(8UL*1024*1024)		/* initial stack size limit */
69#endif
70#ifndef MAXSSIZ
71#define	MAXSSIZ		(64UL*1024*1024)	/* max stack size */
72#endif
73#ifndef SGROWSIZ
74#define	SGROWSIZ	(128UL*1024)		/* amount to grow stack */
75#endif
76
77/*
78 * The time for a process to be blocked before being very swappable.
79 * This is a number of seconds which the system takes as being a non-trivial
80 * amount of real time.	 You probably shouldn't change this;
81 * it is used in subtle ways (fractions and multiples of it are, that is, like
82 * half of a ``long time'', almost a long time, etc.)
83 * It is related to human patience and other factors which don't really
84 * change over time.
85 */
86#define	MAXSLP		20
87
88/*
89 * Mach derived constants
90 */
91
92/* user/kernel map constants */
93#define	VM_MIN_ADDRESS		((vm_offset_t)0x00000000)
94#define	VM_MAX_ADDRESS		((vm_offset_t)(intptr_t)(int32_t)0xffffffff)
95
96#define	VM_MINUSER_ADDRESS	((vm_offset_t)0x00000000)
97#define	VM_MAX_MMAP_ADDR	VM_MAXUSER_ADDRESS
98
99#if defined(__mips_n64)
100#define	VM_MAXUSER_ADDRESS	(VM_MINUSER_ADDRESS + (NPDEPG * NBSEG))
101#define	VM_MIN_KERNEL_ADDRESS	((vm_offset_t)0xc000000000000000)
102#define	VM_MAX_KERNEL_ADDRESS	(VM_MIN_KERNEL_ADDRESS + (NPDEPG * NBSEG))
103#else
104#define	VM_MAXUSER_ADDRESS	((vm_offset_t)0x80000000)
105#define	VM_MIN_KERNEL_ADDRESS	((vm_offset_t)0xC0000000)
106#define	VM_MAX_KERNEL_ADDRESS	((vm_offset_t)0xFFFFC000)
107#endif
108
109#define	KERNBASE		((vm_offset_t)(intptr_t)(int32_t)0x80000000)
110/*
111 * USRSTACK needs to start a little below 0x8000000 because the R8000
112 * and some QED CPUs perform some virtual address checks before the
113 * offset is calculated.
114 */
115#define	USRSTACK		(VM_MAXUSER_ADDRESS - PAGE_SIZE)
116
117/*
118 * Only one memory domain.
119 */
120#ifndef VM_NDOMAIN
121#define	VM_NDOMAIN		1
122#endif
123
124/*
125 * Disable superpage reservations. (not sure if this is right
126 * I copied it from ARM)
127 */
128#ifndef	VM_NRESERVLEVEL
129#define	VM_NRESERVLEVEL		0
130#endif
131
132/* virtual sizes (bytes) for various kernel submaps */
133#ifndef VM_KMEM_SIZE
134#define	VM_KMEM_SIZE		(12 * 1024 * 1024)
135#endif
136
137/*
138 * How many physical pages per KVA page allocated.
139 * min(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), VM_KMEM_SIZE_MAX)
140 * is the total KVA space allocated for kmem_map.
141 */
142#ifndef VM_KMEM_SIZE_SCALE
143#define	VM_KMEM_SIZE_SCALE	(3)
144#endif
145
146/*
147 * Ceiling on amount of kmem_map kva space.
148 */
149#ifndef VM_KMEM_SIZE_MAX
150#define	VM_KMEM_SIZE_MAX	(200 * 1024 * 1024)
151#endif
152
153/* initial pagein size of beginning of executable file */
154#ifndef VM_INITIAL_PAGEIN
155#define	VM_INITIAL_PAGEIN	16
156#endif
157
158/*
159 * max number of non-contig chunks of physical RAM you can have
160 */
161#define	VM_PHYSSEG_MAX		32
162
163/*
164 * The physical address space is sparsely populated.
165 */
166#define	VM_PHYSSEG_SPARSE
167
168/*
169 * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool
170 * from which physical pages are allocated and VM_FREEPOOL_DIRECT is
171 * the pool from which physical pages for small UMA objects are
172 * allocated.
173 */
174#define	VM_NFREEPOOL		3
175#define	VM_FREEPOOL_CACHE	2
176#define	VM_FREEPOOL_DEFAULT	0
177#define	VM_FREEPOOL_DIRECT	1
178
179/*
180 * we support 2 free lists:
181 *
182 *	- DEFAULT for direct mapped (KSEG0) pages.
183 *	  Note: This usage of DEFAULT may be misleading because we use
184 *	  DEFAULT for allocating direct mapped pages. The normal page
185 *	  allocations use HIGHMEM if available, and then DEFAULT.
186 *	- HIGHMEM for other pages
187 */
188#ifdef __mips_n64
189#define	VM_NFREELIST		1
190#define	VM_FREELIST_DEFAULT	0
191#define	VM_FREELIST_DIRECT	VM_FREELIST_DEFAULT
192#else
193#define	VM_NFREELIST		2
194#define	VM_FREELIST_DEFAULT	1
195#define	VM_FREELIST_HIGHMEM	0
196#define	VM_FREELIST_DIRECT	VM_FREELIST_DEFAULT
197#define	VM_HIGHMEM_ADDRESS	((vm_paddr_t)0x20000000)
198#endif
199
200/*
201 * The largest allocation size is 1MB.
202 */
203#define	VM_NFREEORDER		9
204
205#endif /* !_MACHINE_VMPARAM_H_ */
206