vmparam.h revision 232449
129759Swollman/*	$OpenBSD: vmparam.h,v 1.2 1998/09/15 10:50:12 pefo Exp $	*/
229759Swollman/*	$NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp $	*/
329759Swollman
429759Swollman/*
529759Swollman * Copyright (c) 1988 University of Utah.
629759Swollman * Copyright (c) 1992, 1993
729759Swollman *	The Regents of the University of California.  All rights reserved.
829759Swollman *
929759Swollman * This code is derived from software contributed to Berkeley by
1029759Swollman * the Systems Programming Group of the University of Utah Computer
1129759Swollman * Science Department and Ralph Campbell.
1229759Swollman *
1329759Swollman * Redistribution and use in source and binary forms, with or without
1429759Swollman * modification, are permitted provided that the following conditions
15226396Sed * are met:
1629759Swollman * 1. Redistributions of source code must retain the above copyright
1729759Swollman *    notice, this list of conditions and the following disclaimer.
1829759Swollman * 2. Redistributions in binary form must reproduce the above copyright
1929759Swollman *    notice, this list of conditions and the following disclaimer in the
2029759Swollman *    documentation and/or other materials provided with the distribution.
2129759Swollman * 4. Neither the name of the University nor the names of its contributors
2229759Swollman *    may be used to endorse or promote products derived from this software
2329759Swollman *    without specific prior written permission.
2429759Swollman *
2529759Swollman * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2629759Swollman * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2729759Swollman * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2829759Swollman * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2950477Speter * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3029759Swollman * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3129759Swollman * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3229759Swollman * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3329759Swollman * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3429759Swollman * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3529759Swollman * SUCH DAMAGE.
3629759Swollman *
3729759Swollman *	from: Utah Hdr: vmparam.h 1.16 91/01/18
3829759Swollman *	@(#)vmparam.h	8.2 (Berkeley) 4/22/94
3929759Swollman *	JNPR: vmparam.h,v 1.3.2.1 2007/09/10 06:01:28 girish
4029759Swollman * $FreeBSD: head/sys/mips/include/vmparam.h 232449 2012-03-03 08:19:18Z jmallett $
4187715Smarkm */
4229759Swollman
4329759Swollman#ifndef _MACHINE_VMPARAM_H_
4429759Swollman#define	_MACHINE_VMPARAM_H_
45
46/*
47 * Machine dependent constants mips processors.
48 */
49
50/*
51 * Virtual memory related constants, all in bytes
52 */
53#ifndef MAXTSIZ
54#define	MAXTSIZ		(128UL*1024*1024)	/* max text size */
55#endif
56#ifndef DFLDSIZ
57#define	DFLDSIZ		(128UL*1024*1024)	/* initial data size limit */
58#endif
59#ifndef MAXDSIZ
60#define	MAXDSIZ		(1*1024UL*1024*1024)	/* max data size */
61#endif
62#ifndef DFLSSIZ
63#define	DFLSSIZ		(8UL*1024*1024)		/* initial stack size limit */
64#endif
65#ifndef MAXSSIZ
66#define	MAXSSIZ		(64UL*1024*1024)	/* max stack size */
67#endif
68#ifndef SGROWSIZ
69#define	SGROWSIZ	(128UL*1024)		/* amount to grow stack */
70#endif
71
72/*
73 * Mach derived constants
74 */
75
76/* user/kernel map constants */
77#define	VM_MIN_ADDRESS		((vm_offset_t)0x00000000)
78#define	VM_MAX_ADDRESS		((vm_offset_t)(intptr_t)(int32_t)0xffffffff)
79
80#define	VM_MINUSER_ADDRESS	((vm_offset_t)0x00000000)
81
82#ifdef __mips_n64
83#define	VM_MAXUSER_ADDRESS	(VM_MINUSER_ADDRESS + (NPDEPG * NBSEG))
84#define	VM_MIN_KERNEL_ADDRESS	((vm_offset_t)0xc000000000000000)
85#define	VM_MAX_KERNEL_ADDRESS	(VM_MIN_KERNEL_ADDRESS + (NPDEPG * NBSEG))
86#else
87#define	VM_MAXUSER_ADDRESS	((vm_offset_t)0x80000000)
88#define	VM_MIN_KERNEL_ADDRESS	((vm_offset_t)0xC0000000)
89#define	VM_MAX_KERNEL_ADDRESS	((vm_offset_t)0xFFFFC000)
90#endif
91
92#define	KERNBASE		((vm_offset_t)(intptr_t)(int32_t)0x80000000)
93/*
94 * USRSTACK needs to start a little below 0x8000000 because the R8000
95 * and some QED CPUs perform some virtual address checks before the
96 * offset is calculated.
97 */
98#define	USRSTACK		(VM_MAXUSER_ADDRESS - PAGE_SIZE)
99#ifdef __mips_n64
100#define	FREEBSD32_USRSTACK	(((vm_offset_t)0x80000000) - PAGE_SIZE)
101#endif
102
103/*
104 * Only one memory domain.
105 */
106#ifndef VM_NDOMAIN
107#define	VM_NDOMAIN		1
108#endif
109
110/*
111 * Disable superpage reservations. (not sure if this is right
112 * I copied it from ARM)
113 */
114#ifndef	VM_NRESERVLEVEL
115#define	VM_NRESERVLEVEL		0
116#endif
117
118/* virtual sizes (bytes) for various kernel submaps */
119#ifndef VM_KMEM_SIZE
120#define	VM_KMEM_SIZE		(12 * 1024 * 1024)
121#endif
122
123/*
124 * How many physical pages per KVA page allocated.
125 * min(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), VM_KMEM_SIZE_MAX)
126 * is the total KVA space allocated for kmem_map.
127 */
128#ifndef VM_KMEM_SIZE_SCALE
129#define	VM_KMEM_SIZE_SCALE	(3)
130#endif
131
132/*
133 * Ceiling on amount of kmem_map kva space.
134 */
135#ifndef VM_KMEM_SIZE_MAX
136#define	VM_KMEM_SIZE_MAX	(200 * 1024 * 1024)
137#endif
138
139/* initial pagein size of beginning of executable file */
140#ifndef VM_INITIAL_PAGEIN
141#define	VM_INITIAL_PAGEIN	16
142#endif
143
144#define	UMA_MD_SMALL_ALLOC
145
146/*
147 * max number of non-contig chunks of physical RAM you can have
148 */
149#define	VM_PHYSSEG_MAX		32
150
151/*
152 * The physical address space is sparsely populated.
153 */
154#define	VM_PHYSSEG_SPARSE
155
156/*
157 * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool
158 * from which physical pages are allocated and VM_FREEPOOL_DIRECT is
159 * the pool from which physical pages for small UMA objects are
160 * allocated.
161 */
162#define	VM_NFREEPOOL		3
163#define	VM_FREEPOOL_CACHE	2
164#define	VM_FREEPOOL_DEFAULT	0
165#define	VM_FREEPOOL_DIRECT	1
166
167/*
168 * we support 2 free lists:
169 *
170 *	- DEFAULT for direct mapped (KSEG0) pages.
171 *	  Note: This usage of DEFAULT may be misleading because we use
172 *	  DEFAULT for allocating direct mapped pages. The normal page
173 *	  allocations use HIGHMEM if available, and then DEFAULT.
174 *	- HIGHMEM for other pages
175 */
176#ifdef __mips_n64
177#define	VM_NFREELIST		1
178#define	VM_FREELIST_DEFAULT	0
179#define	VM_FREELIST_DIRECT	VM_FREELIST_DEFAULT
180#else
181#define	VM_NFREELIST		2
182#define	VM_FREELIST_DEFAULT	1
183#define	VM_FREELIST_HIGHMEM	0
184#define	VM_FREELIST_DIRECT	VM_FREELIST_DEFAULT
185#define	VM_HIGHMEM_ADDRESS	((vm_paddr_t)0x20000000)
186#endif
187
188/*
189 * The largest allocation size is 1MB.
190 */
191#define	VM_NFREEORDER		9
192
193#define	ZERO_REGION_SIZE	(64 * 1024)	/* 64KB */
194
195#endif /* !_MACHINE_VMPARAM_H_ */
196