]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - sys/mips/include/vmparam.h
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / sys / mips / include / vmparam.h
1 /*      $OpenBSD: vmparam.h,v 1.2 1998/09/15 10:50:12 pefo Exp $        */
2 /*      $NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp $  */
3
4 /*
5  * Copyright (c) 1988 University of Utah.
6  * Copyright (c) 1992, 1993
7  *      The Regents of the University of California.  All rights reserved.
8  *
9  * This code is derived from software contributed to Berkeley by
10  * the Systems Programming Group of the University of Utah Computer
11  * Science Department and Ralph Campbell.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  *    notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  *    notice, this list of conditions and the following disclaimer in the
20  *    documentation and/or other materials provided with the distribution.
21  * 4. Neither the name of the University nor the names of its contributors
22  *    may be used to endorse or promote products derived from this software
23  *    without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35  * SUCH DAMAGE.
36  *
37  *      from: Utah Hdr: vmparam.h 1.16 91/01/18
38  *      @(#)vmparam.h   8.2 (Berkeley) 4/22/94
39  *      JNPR: vmparam.h,v 1.3.2.1 2007/09/10 06:01:28 girish
40  * $FreeBSD$
41  */
42
43 #ifndef _MACHINE_VMPARAM_H_
44 #define _MACHINE_VMPARAM_H_
45
46 /*
47  * Machine dependent constants mips processors.
48  */
49 /*
50  * USRTEXT is the start of the user text/data space, while USRSTACK
51  * is the top (end) of the user stack.
52  */
53 #define USRTEXT         (1*PAGE_SIZE)
54 /*
55  * USRSTACK needs to start a little below 0x8000000 because the R8000
56  * and some QED CPUs perform some virtual address checks before the
57  * offset is calculated.
58  */
59 #define USRSTACK        0x7ffff000      /* Start of user stack */
60
61 /*
62  * Virtual memory related constants, all in bytes
63  */
64 #ifndef MAXTSIZ
65 #define MAXTSIZ         (128UL*1024*1024)       /* max text size */
66 #endif
67 #ifndef DFLDSIZ
68 #define DFLDSIZ         (128UL*1024*1024)       /* initial data size limit */
69 #endif
70 #ifndef MAXDSIZ
71 #define MAXDSIZ         (1*1024UL*1024*1024)    /* max data size */
72 #endif
73 #ifndef DFLSSIZ
74 #define DFLSSIZ         (8UL*1024*1024)         /* initial stack size limit */
75 #endif
76 #ifndef MAXSSIZ
77 #define MAXSSIZ         (64UL*1024*1024)        /* max stack size */
78 #endif
79 #ifndef SGROWSIZ
80 #define SGROWSIZ        (128UL*1024)            /* amount to grow stack */
81 #endif
82
83 /* 
84  * The time for a process to be blocked before being very swappable.
85  * This is a number of seconds which the system takes as being a non-trivial
86  * amount of real time.  You probably shouldn't change this;
87  * it is used in subtle ways (fractions and multiples of it are, that is, like
88  * half of a ``long time'', almost a long time, etc.)
89  * It is related to human patience and other factors which don't really
90  * change over time.
91  */
92 #define MAXSLP          20
93
94 /*
95  * Mach derived constants
96  */
97
98 /* user/kernel map constants */
99 #define VM_MIN_ADDRESS          ((vm_offset_t)0x00000000)
100 #define VM_MAXUSER_ADDRESS      ((vm_offset_t)0x80000000)
101 #define VM_MAX_MMAP_ADDR        VM_MAXUSER_ADDRESS
102 #define VM_MAX_ADDRESS          ((vm_offset_t)0x80000000)
103
104 #ifndef VM_KERNEL_ALLOC_OFFSET
105 #define VM_KERNEL_ALLOC_OFFSET  ((vm_offset_t)0x00000000)
106 #endif
107
108 #define VM_MIN_KERNEL_ADDRESS           ((vm_offset_t)0xC0000000)
109 #define VM_KERNEL_WIRED_ADDR_END        (VM_MIN_KERNEL_ADDRESS + VM_KERNEL_ALLOC_OFFSET)
110 #define VM_MAX_KERNEL_ADDRESS   ((vm_offset_t)0xFFFFC000)
111
112 /*
113  * Disable superpage reservations. (not sure if this is right
114  * I copied it from ARM)
115  */
116 #ifndef VM_NRESERVLEVEL
117 #define VM_NRESERVLEVEL         0
118 #endif
119
120
121 /* virtual sizes (bytes) for various kernel submaps */
122 #ifndef VM_KMEM_SIZE
123 #define VM_KMEM_SIZE            (12 * 1024 * 1024)
124 #endif
125
126 /*
127  * How many physical pages per KVA page allocated.
128  * min(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), VM_KMEM_SIZE_MAX)
129  * is the total KVA space allocated for kmem_map.
130  */
131 #ifndef VM_KMEM_SIZE_SCALE
132 #define VM_KMEM_SIZE_SCALE      (3)
133 #endif
134
135 /*
136  * Ceiling on amount of kmem_map kva space.
137  */
138 #ifndef VM_KMEM_SIZE_MAX
139 #define VM_KMEM_SIZE_MAX        (200 * 1024 * 1024)
140 #endif
141
142 /* initial pagein size of beginning of executable file */
143 #ifndef VM_INITIAL_PAGEIN
144 #define VM_INITIAL_PAGEIN       16
145 #endif
146
147 /*
148  * max number of non-contig chunks of physical RAM you can have
149  */
150 #define VM_PHYSSEG_MAX          32
151
152 /*
153  * The physical address space is densely populated.
154  */
155 #define VM_PHYSSEG_DENSE
156
157 /*
158  * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool
159  * from which physical pages are allocated and VM_FREEPOOL_DIRECT is
160  * the pool from which physical pages for small UMA objects are
161  * allocated.
162  */
163 #define VM_NFREEPOOL            3
164 #define VM_FREEPOOL_CACHE       2
165 #define VM_FREEPOOL_DEFAULT     0
166 #define VM_FREEPOOL_DIRECT      1
167
168 /*
169  * we support 1 free list:
170  *
171  *      - DEFAULT for all systems
172  */
173
174 #define VM_NFREELIST            1
175 #define VM_FREELIST_DEFAULT     0
176
177 /*
178  * The largest allocation size is 1MB.
179  */
180 #define VM_NFREEORDER           9
181
182 /*
183  * XXXMIPS: This values need to be changed!!!
184  */ 
185 #if 0
186 #define VM_MIN_ADDRESS          ((vm_offset_t)0x0000000000010000)
187 #define VM_MAXUSER_ADDRESS      ((vm_offset_t)MIPS_KSEG0_START-1)
188 #define VM_MAX_ADDRESS          ((vm_offset_t)0x0000000100000000)
189 #define VM_MIN_KERNEL_ADDRESS   ((vm_offset_t)MIPS_KSEG3_START)
190 #define VM_MAX_KERNEL_ADDRESS   ((vm_offset_t)MIPS_KSEG3_END)
191 #define KERNBASE                (VM_MIN_KERNEL_ADDRESS)
192
193 /* virtual sizes (bytes) for various kernel submaps */
194 #define VM_KMEM_SIZE            (16*1024*1024)          /* XXX ??? */
195 #endif
196
197 #define NBSEG           0x400000        /* bytes/segment */
198 #define SEGOFSET        (NBSEG-1)       /* byte offset into segment */
199 #define SEGSHIFT        22              /* LOG2(NBSEG) */
200
201 #endif /* !_MACHINE_VMPARAM_H_ */