vmparam.h revision 1.5
11.5Sthorpej/*	$NetBSD: vmparam.h,v 1.5 2001/11/11 16:44:16 thorpej Exp $	*/
21.1Smatt
31.1Smatt/*
41.1Smatt * Copyright (c) 1988 The Regents of the University of California.
51.1Smatt * All rights reserved.
61.1Smatt *
71.1Smatt * Redistribution and use in source and binary forms, with or without
81.1Smatt * modification, are permitted provided that the following conditions
91.1Smatt * are met:
101.1Smatt * 1. Redistributions of source code must retain the above copyright
111.1Smatt *    notice, this list of conditions and the following disclaimer.
121.1Smatt * 2. Redistributions in binary form must reproduce the above copyright
131.1Smatt *    notice, this list of conditions and the following disclaimer in the
141.1Smatt *    documentation and/or other materials provided with the distribution.
151.1Smatt * 3. All advertising materials mentioning features or use of this software
161.1Smatt *    must display the following acknowledgement:
171.1Smatt *	This product includes software developed by the University of
181.1Smatt *	California, Berkeley and its contributors.
191.1Smatt * 4. Neither the name of the University nor the names of its contributors
201.1Smatt *    may be used to endorse or promote products derived from this software
211.1Smatt *    without specific prior written permission.
221.1Smatt *
231.1Smatt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
241.1Smatt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
251.1Smatt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
261.1Smatt * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
271.1Smatt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
281.1Smatt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
291.1Smatt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
301.1Smatt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
311.1Smatt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
321.1Smatt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
331.1Smatt * SUCH DAMAGE.
341.1Smatt */
351.1Smatt
361.1Smatt#ifndef	_ARM32_VMPARAM_H_
371.1Smatt#define	_ARM32_VMPARAM_H_
381.1Smatt
391.1Smatt/* for pt_entry_t definition */
401.1Smatt#include <machine/pte.h>
411.5Sthorpej
421.5Sthorpej#include <arm/arm32/vmparam.h>
431.1Smatt
441.1Smatt#define	USRTEXT		VM_MIN_ADDRESS
451.1Smatt#define	USRSTACK	VM_MAXUSER_ADDRESS
461.1Smatt
471.1Smatt/*
481.1Smatt * Note that MAXTSIZ mustn't be greater than 32M. Otherwise you'd have
491.1Smatt * to change the compiler to not generate bl instructions
501.1Smatt */
511.1Smatt#define	MAXTSIZ		(16*1024*1024)		/* max text size */
521.1Smatt#ifndef	DFLDSIZ
531.1Smatt#define	DFLDSIZ		(128*1024*1024)		/* initial data size limit */
541.1Smatt#endif
551.1Smatt#ifndef	MAXDSIZ
561.1Smatt#define	MAXDSIZ		(512*1024*1024)		/* max data size */
571.1Smatt#endif
581.1Smatt#ifndef	DFLSSIZ
591.1Smatt#define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */
601.1Smatt#endif
611.1Smatt#ifndef	MAXSSIZ
621.1Smatt#define	MAXSSIZ		(8*1024*1024)		/* max stack size */
631.1Smatt#endif
641.1Smatt
651.1Smatt/*
661.1Smatt * Size of shared memory map
671.1Smatt */
681.1Smatt#ifndef SHMMAXPGS
691.1Smatt#define SHMMAXPGS       1024
701.1Smatt#endif
711.1Smatt
721.1Smatt/*
731.1Smatt * The time for a process to be blocked before being very swappable.
741.1Smatt * This is a number of seconds which the system takes as being a non-trivial
751.1Smatt * amount of real time.  You probably shouldn't change this;
761.1Smatt * it is used in subtle ways (fractions and multiples of it are, that is, like
771.1Smatt * half of a `long time'', almost a long time, etc.)
781.1Smatt * It is related to human patience and other factors which don't really
791.1Smatt * change over time.
801.1Smatt */
811.1Smatt#define	MAXSLP		20
821.1Smatt
831.1Smatt/*
841.1Smatt * Address space constants
851.1Smatt */
861.1Smatt
871.1Smatt/*
881.1Smatt * The line between user space and kernel space
891.1Smatt * Mappings >= KERNEL_SPACE_START are constant across all processes
901.1Smatt */
911.1Smatt#define	KERNEL_SPACE_START	0xf0000000
921.1Smatt
931.1Smatt/* total number of page table entries to map 4GB * size of each entry*/
941.1Smatt#define	PAGE_TABLE_SPACE	((1 << (32 - PGSHIFT)) * sizeof(pt_entry_t))
951.1Smatt
961.1Smatt/* Address where the page tables are mapped */
971.1Smatt#define	PAGE_TABLE_SPACE_START	(KERNEL_SPACE_START - PAGE_TABLE_SPACE)
981.1Smatt
991.1Smatt/* Various constants used by the MD code*/
1001.1Smatt#define	KERNEL_BASE		0xf0000000
1011.1Smatt#define	KERNEL_TEXT_BASE	(KERNEL_BASE + 0xc000)
1021.1Smatt#define	ALT_PAGE_TBLS_BASE	0xf0c00000
1031.1Smatt#define	KERNEL_VM_BASE		0xf1000000
1041.1Smatt/*
1051.1Smatt * The Kernel VM Size varies depending on the machine depending on how
1061.1Smatt * much space is needed (and where) for other mappings.
1071.1Smatt * In some cases the chosen value may not be the maximum in order that
1081.1Smatt * we don't waste memory with kernel pages tables as we can't currently
1091.1Smatt * grow the kernel page tables after booting.
1101.1Smatt * You only need to increase these values if you find that the number of
1111.1Smatt * buffers is being limited due to lack of VA space.
1121.1Smatt */
1131.1Smatt/*
1141.1Smatt * The range 0xf1000000 - 0xfcffffff is available for kernel VM space
1151.1Smatt * Footbridge registers and I/O mappings occupy 0xfd000000 - 0xffffffff
1161.1Smatt */
1171.1Smatt#define KERNEL_VM_SIZE		0x06000000
1181.1Smatt#define	PROCESS_PAGE_TBLS_BASE	PAGE_TABLE_SPACE_START
1191.1Smatt
1201.1Smatt/*
1211.1Smatt * Override the default pager_map size, there's not enough KVA.
1221.1Smatt */
1231.1Smatt#define PAGER_MAP_SIZE		(4 * 1024 * 1024)
1241.1Smatt
1251.1Smatt/*
1261.1Smatt * Mach derived constants
1271.1Smatt */
1281.1Smatt
1291.1Smatt#define	VM_MIN_ADDRESS		((vm_offset_t)0x00001000)
1301.1Smatt#define	VM_MAXUSER_ADDRESS	((vm_offset_t)(PAGE_TABLE_SPACE_START - UPAGES * NBPG))
1311.1Smatt#define	VM_MAX_ADDRESS		((vm_offset_t)(PAGE_TABLE_SPACE_START + (KERNEL_SPACE_START >> PGSHIFT) * sizeof(pt_entry_t)))
1321.1Smatt
1331.1Smatt#define	VM_MIN_KERNEL_ADDRESS	((vm_offset_t)KERNEL_TEXT_BASE)
1341.1Smatt#define	VM_MAXKERN_ADDRESS	((vm_offset_t)(KERNEL_VM_BASE + KERNEL_VM_SIZE))
1351.1Smatt#define	VM_MAX_KERNEL_ADDRESS	((vm_offset_t)0xffffffff)
1361.1Smatt
1371.1Smatt/*
1381.1Smatt * Size of User Raw I/O map
1391.1Smatt */
1401.1Smatt
1411.1Smatt#define USRIOSIZE       300
1421.1Smatt
1431.1Smatt/* XXX max. amount of KVM to be used by buffers. */
1441.1Smatt#ifndef VM_MAX_KERNEL_BUF
1451.1Smatt#define VM_MAX_KERNEL_BUF \
1461.1Smatt	((VM_MAXKERN_ADDRESS - KERNEL_VM_BASE) * 4 / 10)
1471.1Smatt#endif
1481.1Smatt
1491.1Smatt/* virtual sizes (bytes) for various kernel submaps */
1501.1Smatt
1511.1Smatt#define VM_PHYS_SIZE		(USRIOSIZE*NBPG)
1521.1Smatt
1531.1Smatt/*
1541.1Smatt * max number of non-contig chunks of physical RAM you can have
1551.1Smatt */
1561.1Smatt
1571.1Smatt#define	VM_PHYSSEG_MAX		32
1581.1Smatt
1591.1Smatt/*
1601.1Smatt * when converting a physical address to a vm_page structure, we
1611.1Smatt * want to use a binary search on the chunks of physical memory
1621.1Smatt * to find our RAM
1631.1Smatt */
1641.1Smatt
1651.1Smatt#define	VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
1661.1Smatt
1671.1Smatt/*
1681.1Smatt * this indicates that we can't add RAM to the VM system after the
1691.1Smatt * vm system is init'd.
1701.1Smatt */
1711.1Smatt
1721.1Smatt#define	VM_PHYSSEG_NOADD
1731.1Smatt
1741.1Smatt/*
1751.1Smatt * we support 2 free lists:
1761.1Smatt *
1771.1Smatt *	- DEFAULT for all systems
1781.1Smatt *	- ISADMA for the ISA DMA range on Sharks only
1791.1Smatt */
1801.1Smatt
1811.1Smatt#define	VM_NFREELIST		2
1821.1Smatt#define	VM_FREELIST_DEFAULT	0
1831.1Smatt#define	VM_FREELIST_ISADMA	1
1841.1Smatt
1851.1Smatt/*
1861.1Smatt * define structure pmap_physseg: there is one of these structures
1871.1Smatt * for each chunk of noncontig RAM you have.
1881.1Smatt */
1891.2Sthorpej
1901.3Sthorpej#define	__HAVE_PMAP_PHYSSEG
1911.1Smatt
1921.1Smattstruct pmap_physseg {
1931.4Schris	struct pv_head *pvhead;		/* pv_entry array */
1941.1Smatt	char *attrs;			/* attrs array */
1951.1Smatt};
1961.1Smatt
1971.1Smatt#endif	/* _ARM32_VMPARAM_H_ */
1981.1Smatt
1991.1Smatt/* End of vmparam.h */
200