vmparam.h revision 1.7
11.7Sthorpej/*	$NetBSD: vmparam.h,v 1.7 2001/11/23 17:39:05 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.7Sthorpej#ifdef _KERNEL
401.5Sthorpej
411.5Sthorpej#include <arm/arm32/vmparam.h>
421.1Smatt
431.1Smatt#define	USRTEXT		VM_MIN_ADDRESS
441.1Smatt#define	USRSTACK	VM_MAXUSER_ADDRESS
451.1Smatt
461.1Smatt/*
471.1Smatt * Note that MAXTSIZ mustn't be greater than 32M. Otherwise you'd have
481.1Smatt * to change the compiler to not generate bl instructions
491.1Smatt */
501.1Smatt#define	MAXTSIZ		(16*1024*1024)		/* max text size */
511.1Smatt#ifndef	DFLDSIZ
521.1Smatt#define	DFLDSIZ		(128*1024*1024)		/* initial data size limit */
531.1Smatt#endif
541.1Smatt#ifndef	MAXDSIZ
551.1Smatt#define	MAXDSIZ		(512*1024*1024)		/* max data size */
561.1Smatt#endif
571.1Smatt#ifndef	DFLSSIZ
581.1Smatt#define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */
591.1Smatt#endif
601.1Smatt#ifndef	MAXSSIZ
611.1Smatt#define	MAXSSIZ		(8*1024*1024)		/* max stack size */
621.1Smatt#endif
631.1Smatt
641.1Smatt/*
651.1Smatt * Size of shared memory map
661.1Smatt */
671.1Smatt#ifndef SHMMAXPGS
681.1Smatt#define SHMMAXPGS       1024
691.1Smatt#endif
701.1Smatt
711.1Smatt/*
721.1Smatt * Address space constants
731.1Smatt */
741.1Smatt
751.1Smatt/*
761.1Smatt * The line between user space and kernel space
771.1Smatt * Mappings >= KERNEL_SPACE_START are constant across all processes
781.1Smatt */
791.1Smatt#define	KERNEL_SPACE_START	0xf0000000
801.1Smatt
811.1Smatt/* total number of page table entries to map 4GB * size of each entry*/
821.1Smatt#define	PAGE_TABLE_SPACE	((1 << (32 - PGSHIFT)) * sizeof(pt_entry_t))
831.1Smatt
841.1Smatt/* Address where the page tables are mapped */
851.1Smatt#define	PAGE_TABLE_SPACE_START	(KERNEL_SPACE_START - PAGE_TABLE_SPACE)
861.1Smatt
871.1Smatt/* Various constants used by the MD code*/
881.1Smatt#define	KERNEL_BASE		0xf0000000
891.1Smatt#define	KERNEL_TEXT_BASE	(KERNEL_BASE + 0xc000)
901.1Smatt#define	ALT_PAGE_TBLS_BASE	0xf0c00000
911.1Smatt#define	KERNEL_VM_BASE		0xf1000000
921.1Smatt/*
931.1Smatt * The Kernel VM Size varies depending on the machine depending on how
941.1Smatt * much space is needed (and where) for other mappings.
951.1Smatt * In some cases the chosen value may not be the maximum in order that
961.1Smatt * we don't waste memory with kernel pages tables as we can't currently
971.1Smatt * grow the kernel page tables after booting.
981.1Smatt * You only need to increase these values if you find that the number of
991.1Smatt * buffers is being limited due to lack of VA space.
1001.1Smatt */
1011.1Smatt/*
1021.1Smatt * The range 0xf1000000 - 0xfcffffff is available for kernel VM space
1031.1Smatt * Footbridge registers and I/O mappings occupy 0xfd000000 - 0xffffffff
1041.1Smatt */
1051.1Smatt#define KERNEL_VM_SIZE		0x06000000
1061.1Smatt#define	PROCESS_PAGE_TBLS_BASE	PAGE_TABLE_SPACE_START
1071.1Smatt
1081.1Smatt/*
1091.1Smatt * Override the default pager_map size, there's not enough KVA.
1101.1Smatt */
1111.1Smatt#define PAGER_MAP_SIZE		(4 * 1024 * 1024)
1121.1Smatt
1131.1Smatt/*
1141.1Smatt * Mach derived constants
1151.1Smatt */
1161.1Smatt
1171.1Smatt#define	VM_MIN_ADDRESS		((vm_offset_t)0x00001000)
1181.1Smatt#define	VM_MAXUSER_ADDRESS	((vm_offset_t)(PAGE_TABLE_SPACE_START - UPAGES * NBPG))
1191.1Smatt#define	VM_MAX_ADDRESS		((vm_offset_t)(PAGE_TABLE_SPACE_START + (KERNEL_SPACE_START >> PGSHIFT) * sizeof(pt_entry_t)))
1201.1Smatt
1211.1Smatt#define	VM_MIN_KERNEL_ADDRESS	((vm_offset_t)KERNEL_TEXT_BASE)
1221.1Smatt#define	VM_MAXKERN_ADDRESS	((vm_offset_t)(KERNEL_VM_BASE + KERNEL_VM_SIZE))
1231.1Smatt#define	VM_MAX_KERNEL_ADDRESS	((vm_offset_t)0xffffffff)
1241.1Smatt
1251.1Smatt/*
1261.1Smatt * Size of User Raw I/O map
1271.1Smatt */
1281.1Smatt
1291.1Smatt#define USRIOSIZE       300
1301.1Smatt
1311.1Smatt/* XXX max. amount of KVM to be used by buffers. */
1321.1Smatt#ifndef VM_MAX_KERNEL_BUF
1331.1Smatt#define VM_MAX_KERNEL_BUF \
1341.1Smatt	((VM_MAXKERN_ADDRESS - KERNEL_VM_BASE) * 4 / 10)
1351.1Smatt#endif
1361.1Smatt
1371.1Smatt/* virtual sizes (bytes) for various kernel submaps */
1381.1Smatt
1391.1Smatt#define VM_PHYS_SIZE		(USRIOSIZE*NBPG)
1401.1Smatt
1411.1Smatt/*
1421.1Smatt * max number of non-contig chunks of physical RAM you can have
1431.1Smatt */
1441.1Smatt
1451.1Smatt#define	VM_PHYSSEG_MAX		32
1461.1Smatt
1471.1Smatt/*
1481.1Smatt * when converting a physical address to a vm_page structure, we
1491.1Smatt * want to use a binary search on the chunks of physical memory
1501.1Smatt * to find our RAM
1511.1Smatt */
1521.1Smatt
1531.1Smatt#define	VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
1541.1Smatt
1551.1Smatt/*
1561.1Smatt * this indicates that we can't add RAM to the VM system after the
1571.1Smatt * vm system is init'd.
1581.1Smatt */
1591.1Smatt
1601.1Smatt#define	VM_PHYSSEG_NOADD
1611.1Smatt
1621.1Smatt/*
1631.1Smatt * we support 2 free lists:
1641.1Smatt *
1651.1Smatt *	- DEFAULT for all systems
1661.1Smatt *	- ISADMA for the ISA DMA range on Sharks only
1671.1Smatt */
1681.1Smatt
1691.1Smatt#define	VM_NFREELIST		2
1701.1Smatt#define	VM_FREELIST_DEFAULT	0
1711.1Smatt#define	VM_FREELIST_ISADMA	1
1721.1Smatt
1731.7Sthorpej#endif /* _KERNEL */
1741.1Smatt
1751.1Smatt#endif	/* _ARM32_VMPARAM_H_ */
176