xref: /freebsd/sys/arm/include/vmparam.h (revision e69ba7c7082e69b022377c991bc0f31b6f50faf5)
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  */
716fc729afSOlivier Houchard #define	KERNBASE		0xc0000000
726fc729afSOlivier Houchard 
736fc729afSOlivier Houchard /*
746fc729afSOlivier Houchard  * max number of non-contig chunks of physical RAM you can have
756fc729afSOlivier Houchard  */
766fc729afSOlivier Houchard 
776fc729afSOlivier Houchard #define	VM_PHYSSEG_MAX		32
786fc729afSOlivier Houchard 
796fc729afSOlivier Houchard /*
8004a18977SAlan Cox  * The physical address space is densely populated.
8104a18977SAlan Cox  */
8204a18977SAlan Cox #define	VM_PHYSSEG_DENSE
8304a18977SAlan Cox 
8404a18977SAlan Cox /*
85007aeeceSIan Lepore  * Create two free page pools.  Since the ARM kernel virtual address
86007aeeceSIan Lepore  * space does not include a mapping onto the machine's entire physical
87007aeeceSIan Lepore  * memory, VM_FREEPOOL_DIRECT is defined as an alias for the default
88007aeeceSIan Lepore  * pool, VM_FREEPOOL_DEFAULT.
899211decaSAlan Cox  */
90b603e095SAlan Cox #define	VM_NFREEPOOL		2
91b603e095SAlan Cox #define	VM_FREEPOOL_CACHE	1
92b603e095SAlan Cox #define	VM_FREEPOOL_DEFAULT	0
93007aeeceSIan Lepore #define	VM_FREEPOOL_DIRECT	0
949211decaSAlan Cox 
959211decaSAlan Cox /*
96*e69ba7c7SIan Lepore  * We need just one free list:  DEFAULT.
976fc729afSOlivier Houchard  */
98*e69ba7c7SIan Lepore #define	VM_NFREELIST		1
996fc729afSOlivier Houchard #define	VM_FREELIST_DEFAULT	0
1006fc729afSOlivier Houchard 
1019211decaSAlan Cox /*
1029211decaSAlan Cox  * The largest allocation size is 1MB.
1039211decaSAlan Cox  */
1049211decaSAlan Cox #define	VM_NFREEORDER		9
1059211decaSAlan Cox 
106b8e7fc24SAlan Cox /*
107995c2b63SRafal Jaworowski  * Enable superpage reservations: 1 level.
108b8e7fc24SAlan Cox  */
109b8e7fc24SAlan Cox #ifndef	VM_NRESERVLEVEL
110995c2b63SRafal Jaworowski #define	VM_NRESERVLEVEL		1
111995c2b63SRafal Jaworowski #endif
112995c2b63SRafal Jaworowski 
113995c2b63SRafal Jaworowski /*
114995c2b63SRafal Jaworowski  * Level 0 reservations consist of 256 pages.
115995c2b63SRafal Jaworowski  */
116995c2b63SRafal Jaworowski #ifndef	VM_LEVEL_0_ORDER
117995c2b63SRafal Jaworowski #define	VM_LEVEL_0_ORDER	8
118b8e7fc24SAlan Cox #endif
119b8e7fc24SAlan Cox 
1206fc729afSOlivier Houchard #define UPT_MAX_ADDRESS		VADDR(UPTPTDI + 3, 0)
1216fc729afSOlivier Houchard #define UPT_MIN_ADDRESS		VADDR(UPTPTDI, 0)
1226fc729afSOlivier Houchard 
1236fc729afSOlivier Houchard #define VM_MIN_ADDRESS          (0x00001000)
124cf1a573fSOleksandr Tymoshenko #ifndef VM_MAXUSER_ADDRESS
1256fc729afSOlivier Houchard #define VM_MAXUSER_ADDRESS      KERNBASE
126cf1a573fSOleksandr Tymoshenko #endif /* VM_MAXUSER_ADDRESS */
1276fc729afSOlivier Houchard #define VM_MAX_ADDRESS          VM_MAXUSER_ADDRESS
1286fc729afSOlivier Houchard 
1296fc729afSOlivier Houchard #define USRSTACK        VM_MAXUSER_ADDRESS
1306fc729afSOlivier Houchard 
1316fc729afSOlivier Houchard /* initial pagein size of beginning of executable file */
1326fc729afSOlivier Houchard #ifndef VM_INITIAL_PAGEIN
1336fc729afSOlivier Houchard #define VM_INITIAL_PAGEIN       16
1346fc729afSOlivier Houchard #endif
1356fc729afSOlivier Houchard 
1366fc729afSOlivier Houchard #ifndef VM_MIN_KERNEL_ADDRESS
1376fc729afSOlivier Houchard #define VM_MIN_KERNEL_ADDRESS KERNBASE
1386fc729afSOlivier Houchard #endif
1396fc729afSOlivier Houchard 
140fc23011bSAlan Cox #define	VM_MAX_KERNEL_ADDRESS	(vm_max_kernel_address)
1411211375fSAndre Oppermann 
1426fc729afSOlivier Houchard /*
143c70af487SAlan Cox  * How many physical pages per kmem arena virtual page.
1445b17d1f9SOlivier Houchard  */
1451211375fSAndre Oppermann #ifndef VM_KMEM_SIZE_SCALE
146219d9565SAlan Cox #define	VM_KMEM_SIZE_SCALE	(3)
1471211375fSAndre Oppermann #endif
1486fc729afSOlivier Houchard 
149837a2c51SAlan Cox /*
150c70af487SAlan Cox  * Optional floor (in bytes) on the size of the kmem arena.
151c70af487SAlan Cox  */
152c70af487SAlan Cox #ifndef VM_KMEM_SIZE_MIN
153c70af487SAlan Cox #define	VM_KMEM_SIZE_MIN	(12 * 1024 * 1024)
154c70af487SAlan Cox #endif
155c70af487SAlan Cox 
156c70af487SAlan Cox /*
157c70af487SAlan Cox  * Optional ceiling (in bytes) on the size of the kmem arena: 40% of the
158c70af487SAlan Cox  * kernel map.
159837a2c51SAlan Cox  */
160837a2c51SAlan Cox #ifndef VM_KMEM_SIZE_MAX
161e137643eSOlivier Houchard #define	VM_KMEM_SIZE_MAX	((vm_max_kernel_address - \
162e137643eSOlivier Houchard     VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5)
163837a2c51SAlan Cox #endif
164837a2c51SAlan Cox 
165fc23011bSAlan Cox extern vm_offset_t vm_max_kernel_address;
166fc23011bSAlan Cox 
167cfb00e5aSMatthew D Fleming #define	ZERO_REGION_SIZE	(64 * 1024)	/* 64KB */
168cfb00e5aSMatthew D Fleming 
16999c89998SAlan Cox #ifndef VM_MAX_AUTOTUNE_MAXUSERS
17099c89998SAlan Cox #define	VM_MAX_AUTOTUNE_MAXUSERS	384
17199c89998SAlan Cox #endif
17299c89998SAlan Cox 
1736fc729afSOlivier Houchard #endif	/* _MACHINE_VMPARAM_H_ */
174