xref: /freebsd/sys/arm/include/vmparam.h (revision e40f53aa44eb364936dec7c633c1a3ac044add9c)
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 
37*e40f53aaSAndrew Turner /*
38*e40f53aaSAndrew Turner  * Machine dependent constants for ARM.
396fc729afSOlivier Houchard  */
40*e40f53aaSAndrew Turner 
41*e40f53aaSAndrew Turner /*
42*e40f53aaSAndrew Turner  * Virtual memory related constants, all in bytes
43*e40f53aaSAndrew Turner  */
44*e40f53aaSAndrew Turner #ifndef	MAXTSIZ
45*e40f53aaSAndrew Turner #define	MAXTSIZ		(64UL*1024*1024)	/* max text size */
46*e40f53aaSAndrew Turner #endif
47*e40f53aaSAndrew Turner #ifndef	DFLDSIZ
48*e40f53aaSAndrew Turner #define	DFLDSIZ		(128UL*1024*1024)	/* initial data size limit */
49*e40f53aaSAndrew Turner #endif
50*e40f53aaSAndrew Turner #ifndef	MAXDSIZ
51*e40f53aaSAndrew Turner #define	MAXDSIZ		(512UL*1024*1024)	/* max data size */
52*e40f53aaSAndrew Turner #endif
53*e40f53aaSAndrew Turner #ifndef	DFLSSIZ
54*e40f53aaSAndrew Turner #define	DFLSSIZ		(2UL*1024*1024)		/* initial stack size limit */
55*e40f53aaSAndrew Turner #endif
56*e40f53aaSAndrew Turner #ifndef	MAXSSIZ
57*e40f53aaSAndrew Turner #define	MAXSSIZ		(8UL*1024*1024)		/* max stack size */
58*e40f53aaSAndrew Turner #endif
59*e40f53aaSAndrew Turner #ifndef	SGROWSIZ
60*e40f53aaSAndrew Turner #define	SGROWSIZ	(128UL*1024)		/* amount to grow stack */
61*e40f53aaSAndrew Turner #endif
62*e40f53aaSAndrew 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 /*
857bfda801SAlan Cox  * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool
869211decaSAlan Cox  * from which physical pages are allocated and VM_FREEPOOL_DIRECT is
879211decaSAlan Cox  * the pool from which physical pages for small UMA objects are
889211decaSAlan Cox  * allocated.
899211decaSAlan Cox  */
907bfda801SAlan Cox #define	VM_NFREEPOOL		3
917bfda801SAlan Cox #define	VM_FREEPOOL_CACHE	2
929211decaSAlan Cox #define	VM_FREEPOOL_DEFAULT	0
939211decaSAlan Cox #define	VM_FREEPOOL_DIRECT	1
949211decaSAlan Cox 
959211decaSAlan Cox /*
966fc729afSOlivier Houchard  * we support 2 free lists:
976fc729afSOlivier Houchard  *
986fc729afSOlivier Houchard  *	- DEFAULT for all systems
996fc729afSOlivier Houchard  *	- ISADMA for the ISA DMA range on Sharks only
1006fc729afSOlivier Houchard  */
1016fc729afSOlivier Houchard 
1026fc729afSOlivier Houchard #define	VM_NFREELIST		2
1036fc729afSOlivier Houchard #define	VM_FREELIST_DEFAULT	0
1046fc729afSOlivier Houchard #define	VM_FREELIST_ISADMA	1
1056fc729afSOlivier Houchard 
1069211decaSAlan Cox /*
1079211decaSAlan Cox  * The largest allocation size is 1MB.
1089211decaSAlan Cox  */
1099211decaSAlan Cox #define	VM_NFREEORDER		9
1109211decaSAlan Cox 
111b8e7fc24SAlan Cox /*
112a3870a18SJohn Baldwin  * Only one memory domain.
113a3870a18SJohn Baldwin  */
114a3870a18SJohn Baldwin #ifndef VM_NDOMAIN
115a3870a18SJohn Baldwin #define	VM_NDOMAIN		1
116a3870a18SJohn Baldwin #endif
117a3870a18SJohn Baldwin 
118a3870a18SJohn Baldwin /*
119b8e7fc24SAlan Cox  * Disable superpage reservations.
120b8e7fc24SAlan Cox  */
121b8e7fc24SAlan Cox #ifndef	VM_NRESERVLEVEL
122b8e7fc24SAlan Cox #define	VM_NRESERVLEVEL		0
123b8e7fc24SAlan Cox #endif
124b8e7fc24SAlan Cox 
1256fc729afSOlivier Houchard #define UPT_MAX_ADDRESS		VADDR(UPTPTDI + 3, 0)
1266fc729afSOlivier Houchard #define UPT_MIN_ADDRESS		VADDR(UPTPTDI, 0)
1276fc729afSOlivier Houchard 
1286fc729afSOlivier Houchard #define VM_MIN_ADDRESS          (0x00001000)
12949953e11SOlivier Houchard #ifdef ARM_USE_SMALL_ALLOC
1307202abb6SOlivier Houchard /*
1317202abb6SOlivier Houchard  * ARM_KERN_DIRECTMAP is used to make sure there's enough space between
1327202abb6SOlivier Houchard  * VM_MAXUSER_ADDRESS and KERNBASE to map the whole memory.
1337202abb6SOlivier Houchard  * It has to be a compile-time constant, even if arm_init_smallalloc(),
1347202abb6SOlivier Houchard  * which will do the mapping, gets the real amount of memory at runtime,
1357202abb6SOlivier Houchard  * because VM_MAXUSER_ADDRESS is a constant.
1367202abb6SOlivier Houchard  */
13749953e11SOlivier Houchard #ifndef ARM_KERN_DIRECTMAP
13849953e11SOlivier Houchard #define ARM_KERN_DIRECTMAP 512 * 1024 * 1024 /* 512 MB */
13949953e11SOlivier Houchard #endif
14049953e11SOlivier Houchard #define VM_MAXUSER_ADDRESS	KERNBASE - ARM_KERN_DIRECTMAP
14149953e11SOlivier Houchard #else /* ARM_USE_SMALL_ALLOC */
142cf1a573fSOleksandr Tymoshenko #ifndef VM_MAXUSER_ADDRESS
1436fc729afSOlivier Houchard #define VM_MAXUSER_ADDRESS      KERNBASE
144cf1a573fSOleksandr Tymoshenko #endif /* VM_MAXUSER_ADDRESS */
14549953e11SOlivier Houchard #endif /* ARM_USE_SMALL_ALLOC */
1466fc729afSOlivier Houchard #define VM_MAX_ADDRESS          VM_MAXUSER_ADDRESS
1476fc729afSOlivier Houchard 
1486fc729afSOlivier Houchard #define USRSTACK        VM_MAXUSER_ADDRESS
1496fc729afSOlivier Houchard 
1506fc729afSOlivier Houchard /* initial pagein size of beginning of executable file */
1516fc729afSOlivier Houchard #ifndef VM_INITIAL_PAGEIN
1526fc729afSOlivier Houchard #define VM_INITIAL_PAGEIN       16
1536fc729afSOlivier Houchard #endif
1546fc729afSOlivier Houchard 
1556fc729afSOlivier Houchard #ifndef VM_MIN_KERNEL_ADDRESS
1566fc729afSOlivier Houchard #define VM_MIN_KERNEL_ADDRESS KERNBASE
1576fc729afSOlivier Houchard #endif
1586fc729afSOlivier Houchard 
159fc23011bSAlan Cox #define	VM_MAX_KERNEL_ADDRESS	(vm_max_kernel_address)
1601211375fSAndre Oppermann 
1616fc729afSOlivier Houchard /*
1625b17d1f9SOlivier Houchard  * Virtual size (bytes) for various kernel submaps.
1635b17d1f9SOlivier Houchard  */
1646fc729afSOlivier Houchard #ifndef VM_KMEM_SIZE
1656fc729afSOlivier Houchard #define VM_KMEM_SIZE		(12*1024*1024)
1666fc729afSOlivier Houchard #endif
1671211375fSAndre Oppermann #ifndef VM_KMEM_SIZE_SCALE
168219d9565SAlan Cox #define VM_KMEM_SIZE_SCALE	(3)
1691211375fSAndre Oppermann #endif
1706fc729afSOlivier Houchard 
171837a2c51SAlan Cox /*
172219d9565SAlan Cox  * Ceiling on the size of the kmem submap: 40% of the kernel map.
173837a2c51SAlan Cox  */
174837a2c51SAlan Cox #ifndef VM_KMEM_SIZE_MAX
175837a2c51SAlan Cox #define	VM_KMEM_SIZE_MAX	((vm_max_kernel_address - \
176219d9565SAlan Cox     VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5)
177837a2c51SAlan Cox #endif
178837a2c51SAlan Cox 
17956e472e2SOlivier Houchard #ifdef ARM_USE_SMALL_ALLOC
18056e472e2SOlivier Houchard #define UMA_MD_SMALL_ALLOC
18156e472e2SOlivier Houchard #endif /* ARM_USE_SMALL_ALLOC */
182cfb00e5aSMatthew D Fleming 
183fc23011bSAlan Cox extern vm_offset_t vm_max_kernel_address;
184fc23011bSAlan Cox 
185cfb00e5aSMatthew D Fleming #define	ZERO_REGION_SIZE	(64 * 1024)	/* 64KB */
186cfb00e5aSMatthew D Fleming 
18799c89998SAlan Cox #ifndef VM_MAX_AUTOTUNE_MAXUSERS
18899c89998SAlan Cox #define	VM_MAX_AUTOTUNE_MAXUSERS	384
18999c89998SAlan Cox #endif
19099c89998SAlan Cox 
1916fc729afSOlivier Houchard #endif	/* _MACHINE_VMPARAM_H_ */
192