xref: /netbsd-src/sys/arch/vax/include/vmparam.h (revision 001c68bd94f75ce9270b69227c4199fbf34ee396)
1 /*	$NetBSD: vmparam.h,v 1.40 2003/02/26 21:54:37 ragge Exp $	*/
2 
3 /*-
4  * Copyright (c) 1990 The Regents of the University of California.
5  * All rights reserved.
6  *
7  * This code is derived from software contributed to Berkeley by
8  * William Jolitz.
9  *
10  * Slightly modified for the VAX port /IC
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  *    notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  *    notice, this list of conditions and the following disclaimer in the
19  *    documentation and/or other materials provided with the distribution.
20  * 3. All advertising materials mentioning features or use of this software
21  *    must display the following acknowledgement:
22  *	This product includes software developed by the University of
23  *	California, Berkeley and its contributors.
24  * 4. Neither the name of the University nor the names of its contributors
25  *    may be used to endorse or promote products derived from this software
26  *    without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
29  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
32  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38  * SUCH DAMAGE.
39  *
40  *	@(#)vmparam.h	5.9 (Berkeley) 5/12/91
41  */
42 #ifndef _VMPARAM_H_
43 #define _VMPARAM_H_
44 
45 /*
46  * Machine dependent constants for VAX.
47  */
48 
49 /*
50  * We use 4K VM pages on the VAX.  Override the PAGE_* definitions
51  * to be compile-time constants.
52  */
53 #define	PAGE_SHIFT	12
54 #define	PAGE_SIZE	(1 << PAGE_SHIFT)
55 #define	PAGE_MASK	(PAGE_SIZE - 1)
56 
57 /*
58  * USRSTACK is the top (end) of the user stack. Immediately above the
59  * user stack resides kernel.
60  */
61 
62 #define USRSTACK	KERNBASE
63 
64 /*
65  * Virtual memory related constants, all in bytes
66  */
67 
68 #ifndef MAXTSIZ
69 #define MAXTSIZ		(8*1024*1024)		/* max text size */
70 #endif
71 #if USE_TOPDOWN_VM==1
72 #ifndef DFLDSIZ
73 #define DFLDSIZ		(128*1024*1024)		/* initial data size limit */
74 #endif
75 #ifndef MAXDSIZ
76 #define MAXDSIZ		(1024*1024*1024)	/* max data size */
77 #endif
78 #else
79 #ifndef DFLDSIZ
80 #define DFLDSIZ		(32*1024*1024)		/* initial data size limit */
81 #endif
82 #ifndef MAXDSIZ
83 #define MAXDSIZ		(64*1024*1024)		/* max data size */
84 #endif
85 #endif
86 #ifndef DFLSSIZ
87 #define DFLSSIZ		(512*1024)		/* initial stack size limit */
88 #endif
89 #ifndef MAXSSIZ
90 #define MAXSSIZ		(8*1024*1024)		/* max stack size */
91 #endif
92 
93 #ifndef USE_TOPDOWN_VM
94 /*
95  * All mmap()'ed data will be mapped above MAXDSIZ. This means that
96  * pte space must be allocated for (possible) mmap()'ed data.
97  * Note: This is just a hint, if we mmap() more than this the page
98  * table will be expanded. (at the cost of speed).
99  */
100 #define MMAPSPACE	(8*1024*1024)
101 #endif
102 
103 /*
104  * Size of shared memory map
105  */
106 
107 #ifndef SHMMAXPGS
108 #define SHMMAXPGS	1024
109 #endif
110 
111 #define VM_PHYSSEG_MAX		1
112 #define VM_PHYSSEG_NOADD
113 #define VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH /* XXX */
114 
115 #define	VM_NFREELIST		1
116 #define	VM_FREELIST_DEFAULT	0
117 
118 /* MD round macros */
119 #define	vax_round_page(x) (((vaddr_t)(x) + VAX_PGOFSET) & ~VAX_PGOFSET)
120 #define	vax_trunc_page(x) ((vaddr_t)(x) & ~VAX_PGOFSET)
121 
122 /*
123  * Mach derived constants
124  */
125 
126 /* user/kernel map constants */
127 #define VM_MIN_ADDRESS		((vaddr_t)0)
128 #define VM_MAXUSER_ADDRESS	((vaddr_t)KERNBASE)
129 #define VM_MAX_ADDRESS		((vaddr_t)KERNBASE)
130 #define VM_MIN_KERNEL_ADDRESS	((vaddr_t)KERNBASE)
131 #define VM_MAX_KERNEL_ADDRESS	((vaddr_t)(0xC0000000))
132 
133 /*
134  * The address to which unspecified mapping requests default
135  */
136 #define __HAVE_TOPDOWN_VM
137 #ifdef USE_TOPDOWN_VM
138 #define VM_DEFAULT_ADDRESS(da, sz) \
139 	trunc_page(VM_MAXUSER_ADDRESS - MAXSSIZ - (sz))
140 #endif
141 
142 #define	USRIOSIZE		(8 * VAX_NPTEPG)	/* 512MB */
143 #define	VM_PHYS_SIZE		(USRIOSIZE*VAX_NBPG)
144 
145 #endif
146