vmparam.h revision 1.4
1/*	$NetBSD: vmparam.h,v 1.4 2001/05/01 02:19:19 thorpej Exp $	*/
2
3/*-
4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 *    notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 *    notice, this list of conditions and the following disclaimer in the
14 *    documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 *    must display the following acknowledgement:
17 *        This product includes software developed by the NetBSD
18 *        Foundation, Inc. and its contributors.
19 * 4. Neither the name of The NetBSD Foundation nor the names of its
20 *    contributors may be used to endorse or promote products derived
21 *    from this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
24 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
27 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36/*
37 * Machine dependent constants for Sun2
38 *
39 * The Sun2 has limited total kernel virtual space (14MB) and
40 * can not use main memory for page tables.  (All active PTEs
41 * must be installed in special translation RAM in the MMU).
42 * Therefore, parameters that would normally configure the
43 * size of various page tables are irrelevant.  Only things
44 * that consume portions of kernel virtual (KV) space matter,
45 * and those things should be chosen to conserve KV space.
46 */
47
48/*
49 * We definitely need a small pager map.
50 */
51#undef	PAGER_MAP_SIZE
52#define	PAGER_MAP_SIZE (1 * 1024 * 1024)
53
54/*
55 * USRTEXT is the start of the user text/data space, while
56 * USRSTACK is the top (end) of the user stack.
57 */
58#define	USRTEXT 	NBPG		/* Start of user text */
59#define	USRSTACK	0x1000000	/* High end of user stack */
60
61/*
62 * Virtual memory related constants, all in bytes.
63 * The Sun2 has only 16 MB of user-virtual space,
64 * so we need to be conservative with these limits.
65 */
66#ifndef MAXTSIZ
67#define	MAXTSIZ		(5*1024*1024)		/* max text size */
68#endif
69#ifndef DFLDSIZ
70#define	DFLDSIZ		(4*1024*1024)		/* initial data size limit */
71#endif
72#ifndef MAXDSIZ
73#define	MAXDSIZ		(6*1024*1024)		/* max data size */
74#endif
75#ifndef	DFLSSIZ
76#define	DFLSSIZ		(512*1024)		/* initial stack size limit */
77#endif
78#ifndef	MAXSSIZ
79#define	MAXSSIZ		(4*1024*1024)		/* max stack size */
80#endif
81
82/*
83 * PTEs for mapping user space into the kernel for phyio operations.
84 * The actual limitation for physio requests will be the DVMA space,
85 * and that is fixed by hardware design at 256K.  We could make the
86 * physio map larger than that, but it would not buy us much.
87 */
88#ifndef USRIOSIZE
89#define USRIOSIZE	128		/* 256K */
90#endif
91
92/*
93 * PTEs for system V style shared memory.
94 * This is basically slop for kmempt which we actually allocate (malloc) from.
95 */
96#ifndef SHMMAXPGS
97#define SHMMAXPGS	512 	/* 4 MB */
98#endif
99
100/*
101 * Mach-derived constants:
102 */
103
104/* user/kernel map constants */
105#define VM_MIN_ADDRESS		((vm_offset_t)0)
106#define VM_MAX_ADDRESS		((vm_offset_t)USRSTACK)
107#define VM_MAXUSER_ADDRESS	((vm_offset_t)USRSTACK)
108#define VM_MIN_KERNEL_ADDRESS	((vm_offset_t)KERNBASE)
109#define VM_MAX_KERNEL_ADDRESS	((vm_offset_t)KERN_END)
110
111/* virtual sizes (bytes) for various kernel submaps */
112#define VM_PHYS_SIZE		(USRIOSIZE*NBPG)
113
114#define VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
115#define VM_PHYSSEG_NOADD	/* can't add RAM after vm_mem_init */
116
117#define	VM_NFREELIST		1
118#define	VM_FREELIST_DEFAULT	0
119
120#ifdef	_LKM
121#define	USRSTACK KERNBASE
122extern	char KERNBASE[];
123#endif	/* _LKM */
124
125/* This is needed by some LKMs. */
126#define VM_PHYSSEG_MAX		4
127
128/*
129 * The time for a process to be blocked before being very swappable.
130 * This is a number of seconds which the system takes as being a non-trivial
131 * amount of real time.  You probably shouldn't change this;
132 * it is used in subtle ways (fractions and multiples of it are, that is, like
133 * half of a ``long time'', almost a long time, etc.)
134 * It is related to human patience and other factors which don't really
135 * change over time.
136 */
137#define	MAXSLP 		20
138