vmparam.h revision 1.11
11.11Sthorpej/*	$NetBSD: vmparam.h,v 1.11 2002/03/23 02:35:24 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/*
441.1Smatt * Address space constants
451.1Smatt */
461.1Smatt
471.1Smatt/*
481.1Smatt * The line between user space and kernel space
491.1Smatt * Mappings >= KERNEL_SPACE_START are constant across all processes
501.1Smatt */
511.1Smatt#define	KERNEL_SPACE_START	0xf0000000
521.1Smatt
531.1Smatt/* Various constants used by the MD code*/
541.1Smatt#define	KERNEL_BASE		0xf0000000
551.11Sthorpej#define	KERNEL_TEXT_BASE	(KERNEL_BASE + 0x0000c000)
561.11Sthorpej#define	APTE_BASE		(KERNEL_BASE + 0x00c00000)
571.11Sthorpej#define	KERNEL_VM_BASE		(KERNEL_BASE + 0x01000000)
581.1Smatt/*
591.1Smatt * The Kernel VM Size varies depending on the machine depending on how
601.1Smatt * much space is needed (and where) for other mappings.
611.1Smatt * In some cases the chosen value may not be the maximum in order that
621.1Smatt * we don't waste memory with kernel pages tables as we can't currently
631.1Smatt * grow the kernel page tables after booting.
641.1Smatt * You only need to increase these values if you find that the number of
651.1Smatt * buffers is being limited due to lack of VA space.
661.1Smatt */
671.1Smatt/*
681.1Smatt * The range 0xf1000000 - 0xfcffffff is available for kernel VM space
691.1Smatt * Footbridge registers and I/O mappings occupy 0xfd000000 - 0xffffffff
701.1Smatt */
711.9Schris#define KERNEL_VM_SIZE		0x0C000000
721.1Smatt
731.1Smatt/*
741.1Smatt * Override the default pager_map size, there's not enough KVA.
751.1Smatt */
761.1Smatt#define PAGER_MAP_SIZE		(4 * 1024 * 1024)
771.1Smatt
781.1Smatt/*
791.1Smatt * Size of User Raw I/O map
801.1Smatt */
811.1Smatt
821.1Smatt#define USRIOSIZE       300
831.1Smatt
841.1Smatt/* XXX max. amount of KVM to be used by buffers. */
851.1Smatt#ifndef VM_MAX_KERNEL_BUF
861.1Smatt#define VM_MAX_KERNEL_BUF \
871.9Schris	((KERNEL_VM_SIZE) * 4 / 10)
881.1Smatt#endif
891.1Smatt
901.1Smatt/* virtual sizes (bytes) for various kernel submaps */
911.1Smatt
921.1Smatt#define VM_PHYS_SIZE		(USRIOSIZE*NBPG)
931.1Smatt
941.1Smatt/*
951.1Smatt * max number of non-contig chunks of physical RAM you can have
961.1Smatt */
971.1Smatt
981.1Smatt#define	VM_PHYSSEG_MAX		32
991.1Smatt
1001.1Smatt/*
1011.1Smatt * when converting a physical address to a vm_page structure, we
1021.1Smatt * want to use a binary search on the chunks of physical memory
1031.1Smatt * to find our RAM
1041.1Smatt */
1051.1Smatt
1061.1Smatt#define	VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
1071.1Smatt
1081.1Smatt/*
1091.1Smatt * this indicates that we can't add RAM to the VM system after the
1101.1Smatt * vm system is init'd.
1111.1Smatt */
1121.1Smatt
1131.1Smatt#define	VM_PHYSSEG_NOADD
1141.1Smatt
1151.1Smatt/*
1161.1Smatt * we support 2 free lists:
1171.1Smatt *
1181.1Smatt *	- DEFAULT for all systems
1191.1Smatt *	- ISADMA for the ISA DMA range on Sharks only
1201.1Smatt */
1211.1Smatt
1221.1Smatt#define	VM_NFREELIST		2
1231.1Smatt#define	VM_FREELIST_DEFAULT	0
1241.1Smatt#define	VM_FREELIST_ISADMA	1
1251.1Smatt
1261.7Sthorpej#endif /* _KERNEL */
1271.1Smatt
1281.1Smatt#endif	/* _ARM32_VMPARAM_H_ */
129