vmparam.h revision 1.6
11.5Smycroft/*	$NetBSD: vmparam.h,v 1.6 2002/09/14 15:54:02 thorpej Exp $	*/
21.1Sthorpej
31.1Sthorpej/*
41.1Sthorpej * Copyright (c) 1988 The Regents of the University of California.
51.1Sthorpej * All rights reserved.
61.1Sthorpej *
71.1Sthorpej * Redistribution and use in source and binary forms, with or without
81.1Sthorpej * modification, are permitted provided that the following conditions
91.1Sthorpej * are met:
101.1Sthorpej * 1. Redistributions of source code must retain the above copyright
111.1Sthorpej *    notice, this list of conditions and the following disclaimer.
121.1Sthorpej * 2. Redistributions in binary form must reproduce the above copyright
131.1Sthorpej *    notice, this list of conditions and the following disclaimer in the
141.1Sthorpej *    documentation and/or other materials provided with the distribution.
151.1Sthorpej * 3. All advertising materials mentioning features or use of this software
161.1Sthorpej *    must display the following acknowledgement:
171.1Sthorpej *	This product includes software developed by the University of
181.1Sthorpej *	California, Berkeley and its contributors.
191.1Sthorpej * 4. Neither the name of the University nor the names of its contributors
201.1Sthorpej *    may be used to endorse or promote products derived from this software
211.1Sthorpej *    without specific prior written permission.
221.1Sthorpej *
231.1Sthorpej * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
241.1Sthorpej * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
251.1Sthorpej * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
261.1Sthorpej * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
271.1Sthorpej * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
281.1Sthorpej * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
291.1Sthorpej * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
301.1Sthorpej * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
311.1Sthorpej * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
321.1Sthorpej * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
331.1Sthorpej * SUCH DAMAGE.
341.1Sthorpej */
351.1Sthorpej
361.1Sthorpej#ifndef	_ARM32_VMPARAM_H_
371.1Sthorpej#define	_ARM32_VMPARAM_H_
381.1Sthorpej
391.1Sthorpej#ifdef _KERNEL
401.1Sthorpej
411.1Sthorpej#include <arm/arm32/vmparam.h>
421.1Sthorpej
431.1Sthorpej/*
441.1Sthorpej * Address space constants
451.1Sthorpej */
461.1Sthorpej
471.1Sthorpej/*
481.1Sthorpej * The line between user space and kernel space
491.4Sthorpej * Mappings >= KERNEL_BASE are constant across all processes
501.1Sthorpej */
511.4Sthorpej#define	KERNEL_BASE		0xf0000000
521.1Sthorpej
531.1Sthorpej/* Various constants used by the MD code */
541.1Sthorpej#define	KERNEL_TEXT_BASE	(KERNEL_BASE + 0x00000000)
551.3Sthorpej#define	APTE_BASE		(KERNEL_BASE + 0x00c00000)
561.1Sthorpej#define	KERNEL_VM_BASE		(KERNEL_BASE + 0x01000000)
571.1Sthorpej
581.1Sthorpej/*
591.1Sthorpej * The range 0xf1000000 - 0xf6ffffff is available for kernel VM space
601.1Sthorpej * OFW sits at 0xf7000000
611.1Sthorpej */
621.1Sthorpej#define	KERNEL_VM_SIZE		0x06000000
631.1Sthorpej
641.1Sthorpej/*
651.1Sthorpej * Override the default pager_map size, there's not enough KVA.
661.1Sthorpej */
671.1Sthorpej#define PAGER_MAP_SIZE		(4 * 1024 * 1024)
681.1Sthorpej
691.1Sthorpej/*
701.1Sthorpej * Size of User Raw I/O map
711.1Sthorpej */
721.1Sthorpej
731.1Sthorpej#define USRIOSIZE       300
741.1Sthorpej
751.1Sthorpej/* XXX max. amount of KVM to be used by buffers. */
761.1Sthorpej#ifndef VM_MAX_KERNEL_BUF
771.1Sthorpej#define VM_MAX_KERNEL_BUF \
781.2Schris	((KERNEL_VM_SIZE) * 4 / 10)
791.1Sthorpej#endif
801.1Sthorpej
811.1Sthorpej/* virtual sizes (bytes) for various kernel submaps */
821.1Sthorpej
831.1Sthorpej#define VM_PHYS_SIZE		(USRIOSIZE*NBPG)
841.1Sthorpej
851.1Sthorpej/*
861.1Sthorpej * max number of non-contig chunks of physical RAM you can have
871.1Sthorpej */
881.1Sthorpej
891.1Sthorpej#define	VM_PHYSSEG_MAX		32
901.1Sthorpej
911.1Sthorpej/*
921.1Sthorpej * when converting a physical address to a vm_page structure, we
931.1Sthorpej * want to use a binary search on the chunks of physical memory
941.1Sthorpej * to find our RAM
951.1Sthorpej */
961.1Sthorpej
971.1Sthorpej#define	VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
981.1Sthorpej
991.1Sthorpej/*
1001.1Sthorpej * this indicates that we can't add RAM to the VM system after the
1011.1Sthorpej * vm system is init'd.
1021.1Sthorpej */
1031.1Sthorpej
1041.1Sthorpej#define	VM_PHYSSEG_NOADD
1051.1Sthorpej
1061.1Sthorpej/*
1071.1Sthorpej * we support 2 free lists:
1081.1Sthorpej *
1091.1Sthorpej *	- DEFAULT for all systems
1101.1Sthorpej *	- ISADMA for the ISA DMA range on Sharks only
1111.1Sthorpej *	- RPCDMA for the DMA range on RiscPC's + Kinetic cards
1121.1Sthorpej */
1131.1Sthorpej
1141.1Sthorpej#define	VM_NFREELIST		2
1151.1Sthorpej#define	VM_FREELIST_DEFAULT	0
1161.1Sthorpej#define	VM_FREELIST_ISADMA	1
1171.1Sthorpej#define VM_FREELIST_RPCDMA	1
1181.6Sthorpej
1191.6Sthorpej#endif /* _KERNEL */
1201.1Sthorpej
1211.1Sthorpej#endif	/* _ARM32_VMPARAM_H_ */
122