vmparam.h revision 1.6
11.6Sthorpej/*	$NetBSD: vmparam.h,v 1.6 2002/12/10 05:14:29 thorpej Exp $	*/
21.1Snisimura
31.1Snisimura/*
41.1Snisimura * Copyright (c) 1988 University of Utah.
51.1Snisimura * Copyright (c) 1982, 1986, 1990, 1993
61.1Snisimura *	The Regents of the University of California.  All rights reserved.
71.1Snisimura *
81.1Snisimura * This code is derived from software contributed to Berkeley by
91.1Snisimura * the Systems Programming Group of the University of Utah Computer
101.1Snisimura * Science Department.
111.1Snisimura *
121.1Snisimura * Redistribution and use in source and binary forms, with or without
131.1Snisimura * modification, are permitted provided that the following conditions
141.1Snisimura * are met:
151.1Snisimura * 1. Redistributions of source code must retain the above copyright
161.1Snisimura *    notice, this list of conditions and the following disclaimer.
171.1Snisimura * 2. Redistributions in binary form must reproduce the above copyright
181.1Snisimura *    notice, this list of conditions and the following disclaimer in the
191.1Snisimura *    documentation and/or other materials provided with the distribution.
201.1Snisimura * 3. All advertising materials mentioning features or use of this software
211.1Snisimura *    must display the following acknowledgement:
221.1Snisimura *	This product includes software developed by the University of
231.1Snisimura *	California, Berkeley and its contributors.
241.1Snisimura * 4. Neither the name of the University nor the names of its contributors
251.1Snisimura *    may be used to endorse or promote products derived from this software
261.1Snisimura *    without specific prior written permission.
271.1Snisimura *
281.1Snisimura * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
291.1Snisimura * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
301.1Snisimura * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
311.1Snisimura * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
321.1Snisimura * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
331.1Snisimura * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
341.1Snisimura * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
351.1Snisimura * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
361.1Snisimura * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
371.1Snisimura * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
381.1Snisimura * SUCH DAMAGE.
391.1Snisimura *
401.1Snisimura * from: Utah $Hdr: vmparam.h 1.16 91/01/18$
411.1Snisimura *
421.1Snisimura *	@(#)vmparam.h	8.2 (Berkeley) 4/19/94
431.1Snisimura */
441.1Snisimura
451.1Snisimura#ifndef _MACHINE_VMPARAM_H_
461.1Snisimura#define _MACHINE_VMPARAM_H_
471.1Snisimura
481.1Snisimura/*
491.6Sthorpej * USRSTACK is the top (end) of the user stack.
501.1Snisimura */
511.1Snisimura#define USRSTACK	VM_MAXUSER_ADDRESS
521.1Snisimura
531.1Snisimura/*
541.1Snisimura * Virtual memory related constants, all in bytes
551.1Snisimura */
561.1Snisimura#ifndef MAXTSIZ
571.1Snisimura#define MAXTSIZ		(8*1024*1024)		/* max text size */
581.1Snisimura#endif
591.1Snisimura#ifndef DFLDSIZ
601.1Snisimura#define DFLDSIZ		(16*1024*1024)		/* initial data size limit */
611.1Snisimura#endif
621.1Snisimura#ifndef MAXDSIZ
631.1Snisimura#define MAXDSIZ		(64*1024*1024)		/* max data size */
641.1Snisimura#endif
651.1Snisimura#ifndef	DFLSSIZ
661.1Snisimura#define DFLSSIZ		(512*1024)		/* initial stack size limit */
671.1Snisimura#endif
681.1Snisimura#ifndef	MAXSSIZ
691.1Snisimura#define MAXSSIZ		MAXDSIZ			/* max stack size */
701.1Snisimura#endif
711.1Snisimura
721.1Snisimura/*
731.1Snisimura * Sizes of the system and user portions of the system page table.
741.1Snisimura */
751.1Snisimura/* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */
761.1Snisimura#define SYSPTSIZE	(2 * NPTEPG)	/* 8mb */
771.1Snisimura#define USRPTSIZE 	(1 * NPTEPG)	/* 4mb */
781.1Snisimura
791.1Snisimura/*
801.1Snisimura * PTEs for mapping user space into the kernel for phyio operations.
811.1Snisimura * One page is enough to handle 4Mb of simultaneous raw IO operations.
821.1Snisimura */
831.1Snisimura#ifndef USRIOSIZE
841.1Snisimura#define USRIOSIZE	(1 * NPTEPG)	/* 4mb */
851.1Snisimura#endif
861.1Snisimura
871.1Snisimura/*
881.1Snisimura * PTEs for system V style shared memory.
891.1Snisimura * This is basically slop for kmempt which we actually allocate (malloc) from.
901.1Snisimura */
911.1Snisimura#ifndef SHMMAXPGS
921.1Snisimura#define SHMMAXPGS	1024		/* 8mb */
931.1Snisimura#endif
941.1Snisimura
951.5Ssoren/*
961.5Ssoren * Mach derived constants
971.1Snisimura */
981.1Snisimura
991.1Snisimura/* user/kernel map constants */
1001.1Snisimura#define VM_MIN_ADDRESS		((vaddr_t)0)
1011.1Snisimura#define VM_MAXUSER_ADDRESS	((vaddr_t)0xFFFC0000)
1021.1Snisimura#define VM_MAX_ADDRESS		((vaddr_t)0xFFFC0000)
1031.1Snisimura#define VM_MIN_KERNEL_ADDRESS	((vaddr_t)0)
1041.1Snisimura#define VM_MAX_KERNEL_ADDRESS	((vaddr_t)(0-NBPG))
1051.1Snisimura
1061.1Snisimura/* virtual sizes (bytes) for various kernel submaps */
1071.1Snisimura#define VM_MBUF_SIZE		(NMBCLUSTERS*MCLBYTES)
1081.1Snisimura#define VM_PHYS_SIZE		(USRIOSIZE*NBPG)
1091.1Snisimura
1101.1Snisimura/* # of kernel PT pages (initial only, can grow dynamically) */
1111.1Snisimura#define VM_KERNEL_PT_PAGES	((vsize_t)2)		/* XXX: SYSPTSIZE */
1121.1Snisimura
1131.1Snisimura/*
1141.1Snisimura * Constants which control the way the VM system deals with memory segments.
1151.1Snisimura * Only one physical contigous memory segment.
1161.1Snisimura */
1171.1Snisimura#define VM_PHYSSEG_MAX		1
1181.1Snisimura#define VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
1191.1Snisimura#define VM_PHYSSEG_NOADD
1201.1Snisimura
1211.1Snisimura#define VM_NFREELIST		1
1221.1Snisimura#define VM_FREELIST_DEFAULT	0
1231.3Sthorpej
1241.4Sthorpej#define	__HAVE_PMAP_PHYSSEG
1251.1Snisimura
1261.1Snisimura/*
1271.1Snisimura * pmap-specific data stored in the vm_physmem[] array.
1281.1Snisimura */
1291.1Snisimurastruct pmap_physseg {
1301.1Snisimura	struct pv_entry *pvent;		/* pv table for this seg */
1311.1Snisimura	char *attrs;			/* page attributes for this seg */
1321.1Snisimura};
1331.1Snisimura
1341.1Snisimura#endif /* _MACHINE_VMPARAM_H_ */
135