vmparam.h revision 1.37 1 1.37 simonb /* $NetBSD: vmparam.h,v 1.37 2005/01/17 05:26:02 simonb Exp $ */
2 1.5 cgd
3 1.1 deraadt /*
4 1.2 glass * Copyright (c) 1992, 1993
5 1.2 glass * The Regents of the University of California. All rights reserved.
6 1.33 agc *
7 1.33 agc * This code is derived from software contributed to Berkeley by
8 1.33 agc * the Systems Programming Group of the University of Utah Computer
9 1.33 agc * Science Department and Ralph Campbell.
10 1.33 agc *
11 1.33 agc * Redistribution and use in source and binary forms, with or without
12 1.33 agc * modification, are permitted provided that the following conditions
13 1.33 agc * are met:
14 1.33 agc * 1. Redistributions of source code must retain the above copyright
15 1.33 agc * notice, this list of conditions and the following disclaimer.
16 1.33 agc * 2. Redistributions in binary form must reproduce the above copyright
17 1.33 agc * notice, this list of conditions and the following disclaimer in the
18 1.33 agc * documentation and/or other materials provided with the distribution.
19 1.33 agc * 3. Neither the name of the University nor the names of its contributors
20 1.33 agc * may be used to endorse or promote products derived from this software
21 1.33 agc * without specific prior written permission.
22 1.33 agc *
23 1.33 agc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 1.33 agc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 1.33 agc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 1.33 agc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 1.33 agc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 1.33 agc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 1.33 agc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 1.33 agc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 1.33 agc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 1.33 agc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 1.33 agc * SUCH DAMAGE.
34 1.33 agc *
35 1.33 agc * from: Utah Hdr: vmparam.h 1.16 91/01/18
36 1.33 agc *
37 1.33 agc * @(#)vmparam.h 8.2 (Berkeley) 4/22/94
38 1.33 agc */
39 1.33 agc /*
40 1.33 agc * Copyright (c) 1988 University of Utah.
41 1.1 deraadt *
42 1.1 deraadt * This code is derived from software contributed to Berkeley by
43 1.1 deraadt * the Systems Programming Group of the University of Utah Computer
44 1.1 deraadt * Science Department and Ralph Campbell.
45 1.1 deraadt *
46 1.1 deraadt * Redistribution and use in source and binary forms, with or without
47 1.1 deraadt * modification, are permitted provided that the following conditions
48 1.1 deraadt * are met:
49 1.1 deraadt * 1. Redistributions of source code must retain the above copyright
50 1.1 deraadt * notice, this list of conditions and the following disclaimer.
51 1.1 deraadt * 2. Redistributions in binary form must reproduce the above copyright
52 1.1 deraadt * notice, this list of conditions and the following disclaimer in the
53 1.1 deraadt * documentation and/or other materials provided with the distribution.
54 1.1 deraadt * 3. All advertising materials mentioning features or use of this software
55 1.1 deraadt * must display the following acknowledgement:
56 1.1 deraadt * This product includes software developed by the University of
57 1.1 deraadt * California, Berkeley and its contributors.
58 1.1 deraadt * 4. Neither the name of the University nor the names of its contributors
59 1.1 deraadt * may be used to endorse or promote products derived from this software
60 1.1 deraadt * without specific prior written permission.
61 1.1 deraadt *
62 1.1 deraadt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
63 1.1 deraadt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
64 1.1 deraadt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
65 1.1 deraadt * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
66 1.1 deraadt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
67 1.1 deraadt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
68 1.1 deraadt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
69 1.1 deraadt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
70 1.1 deraadt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
71 1.1 deraadt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
72 1.1 deraadt * SUCH DAMAGE.
73 1.1 deraadt *
74 1.1 deraadt * from: Utah Hdr: vmparam.h 1.16 91/01/18
75 1.2 glass *
76 1.5 cgd * @(#)vmparam.h 8.2 (Berkeley) 4/22/94
77 1.1 deraadt */
78 1.1 deraadt
79 1.10 thorpej #ifndef _MIPS_VMPARAM_H_
80 1.10 thorpej #define _MIPS_VMPARAM_H_
81 1.10 thorpej
82 1.1 deraadt /*
83 1.10 thorpej * Machine dependent VM constants for MIPS.
84 1.1 deraadt */
85 1.25 thorpej
86 1.25 thorpej /*
87 1.25 thorpej * We use a 4K page on MIPS systems. Override PAGE_* definitions
88 1.25 thorpej * to compile-time constants.
89 1.25 thorpej */
90 1.25 thorpej #define PAGE_SHIFT 12
91 1.25 thorpej #define PAGE_SIZE (1 << PAGE_SHIFT)
92 1.25 thorpej #define PAGE_MASK (PAGE_SIZE - 1)
93 1.10 thorpej
94 1.1 deraadt /*
95 1.31 thorpej * USRSTACK is the top (end) of the user stack.
96 1.21 soren *
97 1.21 soren * USRSTACK needs to start a little below 0x8000000 because the R8000
98 1.21 soren * and some QED CPUs perform some virtual address checks before the
99 1.21 soren * offset is calculated.
100 1.1 deraadt */
101 1.22 soren #define USRSTACK 0x7ffff000 /* Start of user stack */
102 1.26 tsutsui
103 1.26 tsutsui /* alignment requirement for u-area space in bytes */
104 1.26 tsutsui #define USPACE_ALIGN USPACE
105 1.1 deraadt
106 1.1 deraadt /*
107 1.1 deraadt * Virtual memory related constants, all in bytes
108 1.1 deraadt */
109 1.1 deraadt #ifndef MAXTSIZ
110 1.29 simonb #define MAXTSIZ (64*1024*1024) /* max text size */
111 1.1 deraadt #endif
112 1.1 deraadt #ifndef DFLDSIZ
113 1.29 simonb #define DFLDSIZ (128*1024*1024) /* initial data size limit */
114 1.1 deraadt #endif
115 1.1 deraadt #ifndef MAXDSIZ
116 1.29 simonb #define MAXDSIZ (512*1024*1024) /* max data size */
117 1.1 deraadt #endif
118 1.1 deraadt #ifndef DFLSSIZ
119 1.29 simonb #define DFLSSIZ (2*1024*1024) /* initial stack size limit */
120 1.1 deraadt #endif
121 1.1 deraadt #ifndef MAXSSIZ
122 1.6 jonathan #define MAXSSIZ (32*1024*1024) /* max stack size */
123 1.1 deraadt #endif
124 1.1 deraadt
125 1.1 deraadt /*
126 1.1 deraadt * PTEs for mapping user space into the kernel for phyio operations.
127 1.24 soda * The default PTE number is enough to cover 8 disks * MAXBSIZE.
128 1.1 deraadt */
129 1.1 deraadt #ifndef USRIOSIZE
130 1.32 thorpej #define USRIOSIZE (MAXBSIZE/PAGE_SIZE * 8)
131 1.1 deraadt #endif
132 1.1 deraadt
133 1.1 deraadt /*
134 1.1 deraadt * PTEs for system V style shared memory.
135 1.1 deraadt * This is basically slop for kmempt which we actually allocate (malloc) from.
136 1.1 deraadt */
137 1.1 deraadt #ifndef SHMMAXPGS
138 1.1 deraadt #define SHMMAXPGS 1024 /* 4mb */
139 1.1 deraadt #endif
140 1.1 deraadt
141 1.1 deraadt /*
142 1.1 deraadt * Mach derived constants
143 1.1 deraadt */
144 1.1 deraadt
145 1.1 deraadt /* user/kernel map constants */
146 1.11 nisimura #define VM_MIN_ADDRESS ((vaddr_t)0x00000000)
147 1.11 nisimura #define VM_MAXUSER_ADDRESS ((vaddr_t)0x80000000)
148 1.11 nisimura #define VM_MAX_ADDRESS ((vaddr_t)0x80000000)
149 1.11 nisimura #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xC0000000)
150 1.16 uch #ifdef ENABLE_MIPS_TX3900
151 1.16 uch #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xFF000000)
152 1.16 uch #else
153 1.11 nisimura #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xFFFFC000)
154 1.16 uch #endif
155 1.1 deraadt
156 1.34 simonb /*
157 1.34 simonb * The address to which unspecified mapping requests default
158 1.34 simonb */
159 1.37 simonb #define __USE_TOPDOWN_VM
160 1.34 simonb #define VM_DEFAULT_ADDRESS(da, sz) \
161 1.34 simonb trunc_page(USRSTACK - MAXSSIZ - (sz))
162 1.34 simonb
163 1.1 deraadt /* virtual sizes (bytes) for various kernel submaps */
164 1.32 thorpej #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
165 1.10 thorpej
166 1.10 thorpej /* VM_PHYSSEG_MAX defined by platform-dependent code. */
167 1.10 thorpej #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
168 1.18 simonb #define VM_PHYSSEG_NOADD /* can add RAM after vm_mem_init */
169 1.27 thorpej
170 1.28 thorpej #define __HAVE_PMAP_PHYSSEG
171 1.10 thorpej
172 1.10 thorpej /*
173 1.10 thorpej * pmap-specific data stored in the vm_physmem[] array.
174 1.10 thorpej */
175 1.10 thorpej struct pmap_physseg {
176 1.10 thorpej struct pv_entry *pvent; /* pv table for this seg */
177 1.10 thorpej char *attrs; /* page attributes for this seg */
178 1.10 thorpej };
179 1.10 thorpej
180 1.10 thorpej #endif /* ! _MIPS_VMPARAM_H_ */
181