xref: /freebsd/sys/arm/include/vmparam.h (revision 966272ca336a1ef3705320e1e4d01a7aa810a853)
16fc729afSOlivier Houchard /*	$NetBSD: vmparam.h,v 1.26 2003/08/07 16:27:47 agc Exp $	*/
26fc729afSOlivier Houchard 
3d8315c79SWarner Losh /*-
46fc729afSOlivier Houchard  * Copyright (c) 1988 The Regents of the University of California.
56fc729afSOlivier Houchard  * All rights reserved.
66fc729afSOlivier Houchard  *
76fc729afSOlivier Houchard  * Redistribution and use in source and binary forms, with or without
86fc729afSOlivier Houchard  * modification, are permitted provided that the following conditions
96fc729afSOlivier Houchard  * are met:
106fc729afSOlivier Houchard  * 1. Redistributions of source code must retain the above copyright
116fc729afSOlivier Houchard  *    notice, this list of conditions and the following disclaimer.
126fc729afSOlivier Houchard  * 2. Redistributions in binary form must reproduce the above copyright
136fc729afSOlivier Houchard  *    notice, this list of conditions and the following disclaimer in the
146fc729afSOlivier Houchard  *    documentation and/or other materials provided with the distribution.
156fc729afSOlivier Houchard  * 3. Neither the name of the University nor the names of its contributors
166fc729afSOlivier Houchard  *    may be used to endorse or promote products derived from this software
176fc729afSOlivier Houchard  *    without specific prior written permission.
186fc729afSOlivier Houchard  *
196fc729afSOlivier Houchard  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
206fc729afSOlivier Houchard  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
216fc729afSOlivier Houchard  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
226fc729afSOlivier Houchard  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
236fc729afSOlivier Houchard  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
246fc729afSOlivier Houchard  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
256fc729afSOlivier Houchard  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
266fc729afSOlivier Houchard  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
276fc729afSOlivier Houchard  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
286fc729afSOlivier Houchard  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
296fc729afSOlivier Houchard  * SUCH DAMAGE.
306fc729afSOlivier Houchard  *
316fc729afSOlivier Houchard  * $FreeBSD$
326fc729afSOlivier Houchard  */
336fc729afSOlivier Houchard 
346fc729afSOlivier Houchard #ifndef	_MACHINE_VMPARAM_H_
356fc729afSOlivier Houchard #define	_MACHINE_VMPARAM_H_
366fc729afSOlivier Houchard 
37e40f53aaSAndrew Turner /*
38e40f53aaSAndrew Turner  * Machine dependent constants for ARM.
396fc729afSOlivier Houchard  */
40e40f53aaSAndrew Turner 
41e40f53aaSAndrew Turner /*
42e40f53aaSAndrew Turner  * Virtual memory related constants, all in bytes
43e40f53aaSAndrew Turner  */
44e40f53aaSAndrew Turner #ifndef	MAXTSIZ
45e40f53aaSAndrew Turner #define	MAXTSIZ		(64UL*1024*1024)	/* max text size */
46e40f53aaSAndrew Turner #endif
47e40f53aaSAndrew Turner #ifndef	DFLDSIZ
48e40f53aaSAndrew Turner #define	DFLDSIZ		(128UL*1024*1024)	/* initial data size limit */
49e40f53aaSAndrew Turner #endif
50e40f53aaSAndrew Turner #ifndef	MAXDSIZ
51e40f53aaSAndrew Turner #define	MAXDSIZ		(512UL*1024*1024)	/* max data size */
52e40f53aaSAndrew Turner #endif
53e40f53aaSAndrew Turner #ifndef	DFLSSIZ
54e40f53aaSAndrew Turner #define	DFLSSIZ		(2UL*1024*1024)		/* initial stack size limit */
55e40f53aaSAndrew Turner #endif
56e40f53aaSAndrew Turner #ifndef	MAXSSIZ
57e40f53aaSAndrew Turner #define	MAXSSIZ		(8UL*1024*1024)		/* max stack size */
58e40f53aaSAndrew Turner #endif
59e40f53aaSAndrew Turner #ifndef	SGROWSIZ
60e40f53aaSAndrew Turner #define	SGROWSIZ	(128UL*1024)		/* amount to grow stack */
61e40f53aaSAndrew Turner #endif
62e40f53aaSAndrew Turner 
636fc729afSOlivier Houchard /*
646fc729afSOlivier Houchard  * Address space constants
656fc729afSOlivier Houchard  */
666fc729afSOlivier Houchard 
676fc729afSOlivier Houchard /*
686fc729afSOlivier Houchard  * The line between user space and kernel space
696fc729afSOlivier Houchard  * Mappings >= KERNEL_BASE are constant across all processes
706fc729afSOlivier Houchard  */
7137143b98SZbigniew Bodek #ifndef KERNBASE
726fc729afSOlivier Houchard #define	KERNBASE		0xc0000000
7337143b98SZbigniew Bodek #endif
746fc729afSOlivier Houchard 
756fc729afSOlivier Houchard /*
766fc729afSOlivier Houchard  * max number of non-contig chunks of physical RAM you can have
776fc729afSOlivier Houchard  */
786fc729afSOlivier Houchard 
796fc729afSOlivier Houchard #define	VM_PHYSSEG_MAX		32
806fc729afSOlivier Houchard 
816fc729afSOlivier Houchard /*
820b7d5b8fSIan Lepore  * The physical address space may be sparsely populated on some ARM systems.
8304a18977SAlan Cox  */
840b7d5b8fSIan Lepore #define	VM_PHYSSEG_SPARSE
8504a18977SAlan Cox 
8604a18977SAlan Cox /*
87*966272caSAlan Cox  * Create one free page pool.  Since the ARM kernel virtual address
88007aeeceSIan Lepore  * space does not include a mapping onto the machine's entire physical
89007aeeceSIan Lepore  * memory, VM_FREEPOOL_DIRECT is defined as an alias for the default
90007aeeceSIan Lepore  * pool, VM_FREEPOOL_DEFAULT.
919211decaSAlan Cox  */
92*966272caSAlan Cox #define	VM_NFREEPOOL		1
93b603e095SAlan Cox #define	VM_FREEPOOL_DEFAULT	0
94007aeeceSIan Lepore #define	VM_FREEPOOL_DIRECT	0
959211decaSAlan Cox 
969211decaSAlan Cox /*
97e69ba7c7SIan Lepore  * We need just one free list:  DEFAULT.
986fc729afSOlivier Houchard  */
99e69ba7c7SIan Lepore #define	VM_NFREELIST		1
1006fc729afSOlivier Houchard #define	VM_FREELIST_DEFAULT	0
1016fc729afSOlivier Houchard 
1029211decaSAlan Cox /*
1039211decaSAlan Cox  * The largest allocation size is 1MB.
1049211decaSAlan Cox  */
1059211decaSAlan Cox #define	VM_NFREEORDER		9
1069211decaSAlan Cox 
107b8e7fc24SAlan Cox /*
108995c2b63SRafal Jaworowski  * Enable superpage reservations: 1 level.
109b8e7fc24SAlan Cox  */
110b8e7fc24SAlan Cox #ifndef	VM_NRESERVLEVEL
111995c2b63SRafal Jaworowski #define	VM_NRESERVLEVEL		1
112995c2b63SRafal Jaworowski #endif
113995c2b63SRafal Jaworowski 
114995c2b63SRafal Jaworowski /*
115995c2b63SRafal Jaworowski  * Level 0 reservations consist of 256 pages.
116995c2b63SRafal Jaworowski  */
117995c2b63SRafal Jaworowski #ifndef	VM_LEVEL_0_ORDER
118995c2b63SRafal Jaworowski #define	VM_LEVEL_0_ORDER	8
119b8e7fc24SAlan Cox #endif
120b8e7fc24SAlan Cox 
1216fc729afSOlivier Houchard #define VM_MIN_ADDRESS          (0x00001000)
122cf1a573fSOleksandr Tymoshenko #ifndef VM_MAXUSER_ADDRESS
12384233ddbSIan Lepore #define VM_MAXUSER_ADDRESS      (KERNBASE - 0x00400000) /* !!! PT2MAP_SIZE */
12484233ddbSIan Lepore #endif
1256fc729afSOlivier Houchard #define VM_MAX_ADDRESS          VM_MAXUSER_ADDRESS
1266fc729afSOlivier Houchard 
1276fc729afSOlivier Houchard #define USRSTACK        VM_MAXUSER_ADDRESS
1286fc729afSOlivier Houchard 
1296fc729afSOlivier Houchard /* initial pagein size of beginning of executable file */
1306fc729afSOlivier Houchard #ifndef VM_INITIAL_PAGEIN
1316fc729afSOlivier Houchard #define VM_INITIAL_PAGEIN       16
1326fc729afSOlivier Houchard #endif
1336fc729afSOlivier Houchard 
1346fc729afSOlivier Houchard #ifndef VM_MIN_KERNEL_ADDRESS
1356fc729afSOlivier Houchard #define VM_MIN_KERNEL_ADDRESS KERNBASE
1366fc729afSOlivier Houchard #endif
1376fc729afSOlivier Houchard 
138fc23011bSAlan Cox #define	VM_MAX_KERNEL_ADDRESS	(vm_max_kernel_address)
1391211375fSAndre Oppermann 
1406fc729afSOlivier Houchard /*
141c70af487SAlan Cox  * How many physical pages per kmem arena virtual page.
1425b17d1f9SOlivier Houchard  */
1431211375fSAndre Oppermann #ifndef VM_KMEM_SIZE_SCALE
144219d9565SAlan Cox #define	VM_KMEM_SIZE_SCALE	(3)
1451211375fSAndre Oppermann #endif
1466fc729afSOlivier Houchard 
147837a2c51SAlan Cox /*
148c70af487SAlan Cox  * Optional floor (in bytes) on the size of the kmem arena.
149c70af487SAlan Cox  */
150c70af487SAlan Cox #ifndef VM_KMEM_SIZE_MIN
151c70af487SAlan Cox #define	VM_KMEM_SIZE_MIN	(12 * 1024 * 1024)
152c70af487SAlan Cox #endif
153c70af487SAlan Cox 
154c70af487SAlan Cox /*
155c70af487SAlan Cox  * Optional ceiling (in bytes) on the size of the kmem arena: 40% of the
156c70af487SAlan Cox  * kernel map.
157837a2c51SAlan Cox  */
158837a2c51SAlan Cox #ifndef VM_KMEM_SIZE_MAX
159e137643eSOlivier Houchard #define	VM_KMEM_SIZE_MAX	((vm_max_kernel_address - \
160e137643eSOlivier Houchard     VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5)
161837a2c51SAlan Cox #endif
162837a2c51SAlan Cox 
163fc23011bSAlan Cox extern vm_offset_t vm_max_kernel_address;
164fc23011bSAlan Cox 
165cfb00e5aSMatthew D Fleming #define	ZERO_REGION_SIZE	(64 * 1024)	/* 64KB */
166cfb00e5aSMatthew D Fleming 
16799c89998SAlan Cox #ifndef VM_MAX_AUTOTUNE_MAXUSERS
16899c89998SAlan Cox #define	VM_MAX_AUTOTUNE_MAXUSERS	384
16999c89998SAlan Cox #endif
17099c89998SAlan Cox 
171c8d2ffd6SGleb Smirnoff #define	SFBUF
172c8d2ffd6SGleb Smirnoff #define	SFBUF_MAP
173c8d2ffd6SGleb Smirnoff 
1746fc729afSOlivier Houchard #endif	/* _MACHINE_VMPARAM_H_ */
175