vmparam.h revision 1.17 1 /* $NetBSD: vmparam.h,v 1.17 2005/04/01 11:59:33 yamt Exp $ */
2
3 /*
4 * This file was taken from from mvme68k/include/vmparam.h and
5 * should probably be re-synced when needed.
6 * Darrin B Jewell <jewell (at) mit.edu> Fri Aug 28 03:22:07 1998
7 * original cvs id: NetBSD: vmparam.h,v 1.9 1998/08/22 10:55:34 scw Exp
8 */
9
10 /*
11 * Copyright (c) 1982, 1986, 1990, 1993
12 * The Regents of the University of California. All rights reserved.
13 *
14 * This code is derived from software contributed to Berkeley by
15 * the Systems Programming Group of the University of Utah Computer
16 * Science Department.
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
20 * are met:
21 * 1. Redistributions of source code must retain the above copyright
22 * notice, this list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must reproduce the above copyright
24 * notice, this list of conditions and the following disclaimer in the
25 * documentation and/or other materials provided with the distribution.
26 * 3. Neither the name of the University nor the names of its contributors
27 * may be used to endorse or promote products derived from this software
28 * without specific prior written permission.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
31 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * SUCH DAMAGE.
41 *
42 * from: Utah $Hdr: vmparam.h 1.16 91/01/18$
43 *
44 * @(#)vmparam.h 8.2 (Berkeley) 4/19/94
45 */
46 /*
47 * Copyright (c) 1988 University of Utah.
48 *
49 * This code is derived from software contributed to Berkeley by
50 * the Systems Programming Group of the University of Utah Computer
51 * Science Department.
52 *
53 * Redistribution and use in source and binary forms, with or without
54 * modification, are permitted provided that the following conditions
55 * are met:
56 * 1. Redistributions of source code must retain the above copyright
57 * notice, this list of conditions and the following disclaimer.
58 * 2. Redistributions in binary form must reproduce the above copyright
59 * notice, this list of conditions and the following disclaimer in the
60 * documentation and/or other materials provided with the distribution.
61 * 3. All advertising materials mentioning features or use of this software
62 * must display the following acknowledgement:
63 * This product includes software developed by the University of
64 * California, Berkeley and its contributors.
65 * 4. Neither the name of the University nor the names of its contributors
66 * may be used to endorse or promote products derived from this software
67 * without specific prior written permission.
68 *
69 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
70 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
71 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
72 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
73 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
74 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
75 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
76 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
77 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
78 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
79 * SUCH DAMAGE.
80 *
81 * from: Utah $Hdr: vmparam.h 1.16 91/01/18$
82 *
83 * @(#)vmparam.h 8.2 (Berkeley) 4/19/94
84 */
85
86 #ifndef _NEXT68K_VMPARAM_H_
87 #define _NEXT68K_VMPARAM_H_
88
89 /*
90 * Machine dependent constants for NEXT68K
91 */
92
93 /*
94 * We use 4K pages on the NeXT. Override the PAGE_* definitions
95 * to be compile-time constants.
96 */
97 #define PAGE_SHIFT 12
98 #define PAGE_SIZE (1 << PAGE_SHIFT)
99 #define PAGE_MASK (PAGE_SIZE - 1)
100
101 /*
102 * USRSTACK is the top (end) of the user stack.
103 *
104 * NOTE: the ONLY reason that HIGHPAGES is 0x100 instead of UPAGES (3)
105 * is for HPUX compatibility. Why?? Because HPUX's debuggers
106 * have the user's stack hard-wired at FFF00000 for post-mortems,
107 * and we must be compatible...
108 */
109 #define USRSTACK (-HIGHPAGES*PAGE_SIZE) /* Start of user stack */
110 #define BTOPUSRSTACK (0x100000-HIGHPAGES) /* btop(USRSTACK) */
111 #define P1PAGES 0x100000
112 #define HIGHPAGES (0x100000/PAGE_SIZE)
113
114 /*
115 * Virtual memory related constants, all in bytes
116 */
117 #ifndef MAXTSIZ
118 #define MAXTSIZ (8*1024*1024) /* max text size */
119 #endif
120 #ifndef DFLDSIZ
121 #define DFLDSIZ (16*1024*1024) /* initial data size limit */
122 #endif
123 #ifndef MAXDSIZ
124 #define MAXDSIZ (64*1024*1024) /* max data size */
125 #endif
126 #ifndef DFLSSIZ
127 #define DFLSSIZ (512*1024) /* initial stack size limit */
128 #endif
129 #ifndef MAXSSIZ
130 #define MAXSSIZ MAXDSIZ /* max stack size */
131 #endif
132
133 /*
134 * Sizes of the system and user portions of the system page table.
135 */
136 /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */
137 #define SYSPTSIZE (2 * NPTEPG) /* 8mb */
138 #define USRPTSIZE (1 * NPTEPG) /* 4mb */
139
140 /*
141 * PTEs for mapping user space into the kernel for phyio operations.
142 * One page is enough to handle 4Mb of simultaneous raw IO operations.
143 */
144 #ifndef USRIOSIZE
145 #define USRIOSIZE (1 * NPTEPG) /* 4mb */
146 #endif
147
148 /*
149 * PTEs for system V style shared memory.
150 * This is basically slop for kmempt which we actually allocate (malloc) from.
151 */
152 #ifndef SHMMAXPGS
153 #define SHMMAXPGS 1024 /* 4mb */
154 #endif
155
156 /*
157 * Mach derived constants
158 */
159
160 /* user/kernel map constants */
161 #define VM_MIN_ADDRESS ((vaddr_t)0)
162 #define VM_MAXUSER_ADDRESS ((vaddr_t)0xFFF00000)
163 #define VM_MAX_ADDRESS ((vaddr_t)0xFFF00000)
164 #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0)
165 #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-PAGE_SIZE*NPTEPG*2))
166
167 /* virtual sizes (bytes) for various kernel submaps */
168 #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
169
170 /* # of kernel PT pages (initial only, can grow dynamically) */
171 #define VM_KERNEL_PT_PAGES ((vsize_t)2) /* XXX: SYSPTSIZE */
172
173 /*
174 * Constants which control the way the VM system deals with memory segments.
175 */
176 #define VM_PHYSSEG_MAX 5 /* @@@ should really come from N_SIMM */
177 #define VM_PHYSSEG_STRAT VM_PSTRAT_RANDOM
178 #define VM_PHYSSEG_NOADD /* @@@ does the NeXT really need this? */
179 #define VM_NFREELIST 1
180 #define VM_FREELIST_DEFAULT 0
181
182 #define __HAVE_PMAP_PHYSSEG
183
184 /*
185 * pmap-specific data stored in the vm_physmem[] array.
186 */
187 struct pmap_physseg {
188 struct pv_entry *pvent; /* pv table for this seg */
189 char *attrs; /* page attributes for this seg */
190 };
191
192 #endif /* _MVME68K_VMPARAM_H_ */
193