vmparam.h revision 1.1 1 1.1 itojun /* $NetBSD: vmparam.h,v 1.1 1999/09/13 10:31:24 itojun Exp $ */
2 1.1 itojun
3 1.1 itojun /*-
4 1.1 itojun * Copyright (c) 1990 The Regents of the University of California.
5 1.1 itojun * All rights reserved.
6 1.1 itojun *
7 1.1 itojun * This code is derived from software contributed to Berkeley by
8 1.1 itojun * William Jolitz.
9 1.1 itojun *
10 1.1 itojun * Redistribution and use in source and binary forms, with or without
11 1.1 itojun * modification, are permitted provided that the following conditions
12 1.1 itojun * are met:
13 1.1 itojun * 1. Redistributions of source code must retain the above copyright
14 1.1 itojun * notice, this list of conditions and the following disclaimer.
15 1.1 itojun * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 itojun * notice, this list of conditions and the following disclaimer in the
17 1.1 itojun * documentation and/or other materials provided with the distribution.
18 1.1 itojun * 3. All advertising materials mentioning features or use of this software
19 1.1 itojun * must display the following acknowledgement:
20 1.1 itojun * This product includes software developed by the University of
21 1.1 itojun * California, Berkeley and its contributors.
22 1.1 itojun * 4. Neither the name of the University nor the names of its contributors
23 1.1 itojun * may be used to endorse or promote products derived from this software
24 1.1 itojun * without specific prior written permission.
25 1.1 itojun *
26 1.1 itojun * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 1.1 itojun * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 1.1 itojun * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 1.1 itojun * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 1.1 itojun * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 1.1 itojun * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 1.1 itojun * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 1.1 itojun * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 1.1 itojun * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 1.1 itojun * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 1.1 itojun * SUCH DAMAGE.
37 1.1 itojun *
38 1.1 itojun * @(#)vmparam.h 5.9 (Berkeley) 5/12/91
39 1.1 itojun */
40 1.1 itojun
41 1.1 itojun #ifndef _MACHINE_VMPARAM_H_
42 1.1 itojun #define _MACHINE_VMPARAM_H_
43 1.1 itojun
44 1.1 itojun /*
45 1.1 itojun * Machine dependent constants for sh3.
46 1.1 itojun */
47 1.1 itojun
48 1.1 itojun /*
49 1.1 itojun * Virtual address space arrangement. On 386, both user and kernel
50 1.1 itojun * share the address space, not unlike the vax.
51 1.1 itojun * USRTEXT is the start of the user text/data space, while USRSTACK
52 1.1 itojun * is the top (end) of the user stack. Immediately above the user stack
53 1.1 itojun * resides the user structure, which is UPAGES long and contains the
54 1.1 itojun * kernel stack.
55 1.1 itojun *
56 1.1 itojun * Immediately after the user structure is the page table map, and then
57 1.1 itojun * kernal address space.
58 1.1 itojun */
59 1.1 itojun #define USRTEXT CLBYTES
60 1.1 itojun #define USRSTACK VM_MAXUSER_ADDRESS
61 1.1 itojun
62 1.1 itojun /*
63 1.1 itojun * Virtual memory related constants, all in bytes
64 1.1 itojun */
65 1.1 itojun #define MAXTSIZ (64*1024*1024) /* max text size */
66 1.1 itojun #ifndef DFLDSIZ
67 1.1 itojun #define DFLDSIZ (128*1024*1024) /* initial data size limit */
68 1.1 itojun #endif
69 1.1 itojun #ifndef MAXDSIZ
70 1.1 itojun #define MAXDSIZ (1*1024*1024*1024) /* max data size */
71 1.1 itojun #endif
72 1.1 itojun #ifndef DFLSSIZ
73 1.1 itojun #define DFLSSIZ (2*1024*1024) /* initial stack size limit */
74 1.1 itojun #endif
75 1.1 itojun #ifndef MAXSSIZ
76 1.1 itojun #define MAXSSIZ (32*1024*1024) /* max stack size */
77 1.1 itojun #endif
78 1.1 itojun
79 1.1 itojun /*
80 1.1 itojun * Size of shared memory map
81 1.1 itojun */
82 1.1 itojun #ifndef SHMMAXPGS
83 1.1 itojun #define SHMMAXPGS 1024
84 1.1 itojun #endif
85 1.1 itojun
86 1.1 itojun /*
87 1.1 itojun * Size of User Raw I/O map
88 1.1 itojun */
89 1.1 itojun #define USRIOSIZE 300
90 1.1 itojun
91 1.1 itojun /*
92 1.1 itojun * The time for a process to be blocked before being very swappable.
93 1.1 itojun * This is a number of seconds which the system takes as being a non-trivial
94 1.1 itojun * amount of real time. You probably shouldn't change this;
95 1.1 itojun * it is used in subtle ways (fractions and multiples of it are, that is, like
96 1.1 itojun * half of a ``long time'', almost a long time, etc.)
97 1.1 itojun * It is related to human patience and other factors which don't really
98 1.1 itojun * change over time.
99 1.1 itojun */
100 1.1 itojun #define MAXSLP 20
101 1.1 itojun
102 1.1 itojun /*
103 1.1 itojun * A swapped in process is given a small amount of core without being bothered
104 1.1 itojun * by the page replacement algorithm. Basically this says that if you are
105 1.1 itojun * swapped in you deserve some resources. We protect the last SAFERSS
106 1.1 itojun * pages against paging and will just swap you out rather than paging you.
107 1.1 itojun * Note that each process has at least UPAGES+CLSIZE pages which are not
108 1.1 itojun * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this
109 1.1 itojun * number just means a swapped in process is given around 25k bytes.
110 1.1 itojun * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81),
111 1.1 itojun * so we loan each swapped in process memory worth 100$, or just admit
112 1.1 itojun * that we don't consider it worthwhile and swap it out to disk which costs
113 1.1 itojun * $30/mb or about $0.75.
114 1.1 itojun * { wfj 6/16/89: Retail AT memory expansion $800/megabyte, loan of $17
115 1.1 itojun * on disk costing $7/mb or $0.18 (in memory still 100:1 in cost!) }
116 1.1 itojun * Update: memory prices have changed recently (9/96). At the current
117 1.1 itojun * value of $6 per megabyte, we lend each swapped in process memory worth
118 1.1 itojun * $0.15, or just admit that we don't consider it worthwhile and swap it out
119 1.1 itojun * to disk which costs $0.20/MB, or just under half a cent.
120 1.1 itojun */
121 1.1 itojun #define SAFERSS 8 /* nominal ``small'' resident set size
122 1.1 itojun protected against replacement */
123 1.1 itojun
124 1.1 itojun /*
125 1.1 itojun * Mach derived constants
126 1.1 itojun */
127 1.1 itojun
128 1.1 itojun /* user/kernel map constants */
129 1.1 itojun #define VM_MIN_ADDRESS ((vaddr_t)0)
130 1.1 itojun /* PTDPTDI<<PDSHIFT - UPAGES*NBPG */
131 1.1 itojun #define VM_MAXUSER_ADDRESS ((vaddr_t)0x7fffe000)
132 1.1 itojun /* PTDPTDI<<PDSHIFT + PTDPTDI<<PGSHIFT */
133 1.1 itojun #define VM_MAX_ADDRESS ((vaddr_t)0xcffbf000)
134 1.1 itojun /* KPTDI<<PDSHIFT */
135 1.1 itojun #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xd0000000)
136 1.1 itojun /* APTDPTDI<<PDSHIFT */
137 1.1 itojun #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xdfc00000)
138 1.1 itojun
139 1.1 itojun /* XXX max. amount of KVM to be used by buffers. */
140 1.1 itojun #ifndef VM_MAX_KERNEL_BUF
141 1.1 itojun #define VM_MAX_KERNEL_BUF \
142 1.1 itojun ((VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) * 7 / 10)
143 1.1 itojun #endif
144 1.1 itojun
145 1.1 itojun /* virtual sizes (bytes) for various kernel submaps */
146 1.1 itojun #define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES)
147 1.1 itojun #define VM_KMEM_SIZE (NKMEMCLUSTERS*CLBYTES)
148 1.1 itojun #define VM_PHYS_SIZE (USRIOSIZE*CLBYTES)
149 1.1 itojun
150 1.1 itojun #define VM_PHYSSEG_MAX 1
151 1.1 itojun #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
152 1.1 itojun #define VM_PHYSSEG_NOADD /* no more after vm_mem_init */
153 1.1 itojun
154 1.1 itojun #define VM_NFREELIST 1
155 1.1 itojun #define VM_FREELIST_DEFAULT 0
156 1.1 itojun
157 1.1 itojun /*
158 1.1 itojun * pmap specific data stored in the vm_physmem[] array
159 1.1 itojun */
160 1.1 itojun #if defined(PMAP_NEW)
161 1.1 itojun struct pmap_physseg {
162 1.1 itojun struct pv_head *pvhead; /* pv_head array */
163 1.1 itojun char *attrs; /* attrs array */
164 1.1 itojun };
165 1.1 itojun #else
166 1.1 itojun struct pmap_physseg {
167 1.1 itojun struct pv_entry *pvent; /* pv_entry array */
168 1.1 itojun char *attrs; /* attrs array */
169 1.1 itojun };
170 1.1 itojun #endif
171 1.1 itojun
172 1.1 itojun #endif /* _MACHINE_VMPARAM_H_ */
173