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