vmparam.h revision 1.3 1 1.3 tsutsui /* $NetBSD: vmparam.h,v 1.3 2025/02/08 23:44:53 tsutsui Exp $ */
2 1.1 thorpej
3 1.1 thorpej /*
4 1.1 thorpej * Copyright (c) 1988 University of Utah.
5 1.1 thorpej * Copyright (c) 1982, 1986, 1990, 1993
6 1.1 thorpej * The Regents of the University of California. All rights reserved.
7 1.1 thorpej *
8 1.1 thorpej * This code is derived from software contributed to Berkeley by
9 1.1 thorpej * the Systems Programming Group of the University of Utah Computer
10 1.1 thorpej * Science Department.
11 1.1 thorpej *
12 1.1 thorpej * Redistribution and use in source and binary forms, with or without
13 1.1 thorpej * modification, are permitted provided that the following conditions
14 1.1 thorpej * are met:
15 1.1 thorpej * 1. Redistributions of source code must retain the above copyright
16 1.1 thorpej * notice, this list of conditions and the following disclaimer.
17 1.1 thorpej * 2. Redistributions in binary form must reproduce the above copyright
18 1.1 thorpej * notice, this list of conditions and the following disclaimer in the
19 1.1 thorpej * documentation and/or other materials provided with the distribution.
20 1.1 thorpej * 3. Neither the name of the University nor the names of its contributors
21 1.1 thorpej * may be used to endorse or promote products derived from this software
22 1.1 thorpej * without specific prior written permission.
23 1.1 thorpej *
24 1.1 thorpej * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 1.1 thorpej * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 1.1 thorpej * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 1.1 thorpej * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 1.1 thorpej * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 1.1 thorpej * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 1.1 thorpej * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 1.1 thorpej * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 1.1 thorpej * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 1.1 thorpej * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 1.1 thorpej * SUCH DAMAGE.
35 1.1 thorpej *
36 1.1 thorpej * from: Utah $Hdr: vmparam.h 1.16 91/01/18$
37 1.1 thorpej *
38 1.1 thorpej * @(#)vmparam.h 8.2 (Berkeley) 4/19/94
39 1.1 thorpej */
40 1.1 thorpej
41 1.1 thorpej #ifndef _VIRT68K_VMPARAM_H_
42 1.1 thorpej #define _VIRT68K_VMPARAM_H_
43 1.1 thorpej
44 1.1 thorpej /*
45 1.1 thorpej * Machine dependent constants for virt68k
46 1.1 thorpej */
47 1.1 thorpej
48 1.1 thorpej /*
49 1.1 thorpej * Use common m68k definitions to define PAGE_SIZE and related constants.
50 1.1 thorpej */
51 1.1 thorpej #include <m68k/vmparam.h>
52 1.1 thorpej
53 1.1 thorpej /*
54 1.1 thorpej * USRSTACK is the top (end) of the user stack.
55 1.1 thorpej *
56 1.1 thorpej * NOTE: the ONLY reason that HIGHPAGES is 0x100 instead of UPAGES (3)
57 1.1 thorpej * is for HPUX compatibility. Why?? Because HPUX's debuggers
58 1.1 thorpej * have the user's stack hard-wired at FFF00000 for post-mortems,
59 1.1 thorpej * and we must be compatible...
60 1.1 thorpej */
61 1.1 thorpej #define USRSTACK (-HIGHPAGES*PAGE_SIZE) /* Start of user stack */
62 1.1 thorpej #define BTOPUSRSTACK (0x100000-HIGHPAGES) /* btop(USRSTACK) */
63 1.1 thorpej #define P1PAGES 0x100000
64 1.1 thorpej #define HIGHPAGES (0x100000/PAGE_SIZE)
65 1.1 thorpej
66 1.1 thorpej /*
67 1.1 thorpej * Virtual memory related constants, all in bytes
68 1.1 thorpej */
69 1.1 thorpej #ifndef MAXTSIZ
70 1.1 thorpej #define MAXTSIZ (32*1024*1024) /* max text size */
71 1.1 thorpej #endif
72 1.1 thorpej #ifndef DFLDSIZ
73 1.1 thorpej #define DFLDSIZ (32*1024*1024) /* initial data size limit */
74 1.1 thorpej #endif
75 1.1 thorpej #ifndef MAXDSIZ
76 1.1 thorpej #define MAXDSIZ (64*1024*1024) /* max data size */
77 1.1 thorpej #endif
78 1.1 thorpej #ifndef DFLSSIZ
79 1.3 tsutsui #define DFLSSIZ (2*1024*1024) /* initial stack size limit */
80 1.1 thorpej #endif
81 1.1 thorpej #ifndef MAXSSIZ
82 1.1 thorpej #define MAXSSIZ MAXDSIZ /* max stack size */
83 1.1 thorpej #endif
84 1.1 thorpej
85 1.1 thorpej /*
86 1.1 thorpej * PTEs for mapping user space into the kernel for phyio operations.
87 1.1 thorpej * One page is enough to handle 4Mb of simultaneous raw IO operations.
88 1.1 thorpej */
89 1.1 thorpej #ifndef USRIOSIZE
90 1.1 thorpej #define USRIOSIZE (1 * NPTEPG) /* 4mb */
91 1.1 thorpej #endif
92 1.1 thorpej
93 1.1 thorpej /*
94 1.1 thorpej * Mach derived constants
95 1.1 thorpej */
96 1.1 thorpej
97 1.1 thorpej /*
98 1.1 thorpej * user/kernel map constants
99 1.1 thorpej *
100 1.1 thorpej * TT registers are used to map the I/O space (at 0xFF00.0000), so
101 1.1 thorpej * the kernel virtual address space needs to end before that (with
102 1.1 thorpej * room for the Sysmap, because that's where the Hibler pmap puts it).
103 1.1 thorpej */
104 1.1 thorpej #define VM_MIN_ADDRESS ((vaddr_t)0)
105 1.1 thorpej #define VM_MAXUSER_ADDRESS ((vaddr_t)0xFFF00000)
106 1.1 thorpej #define VM_MAX_ADDRESS ((vaddr_t)0xFFF00000)
107 1.1 thorpej #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0)
108 1.1 thorpej #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0xFF000000-PAGE_SIZE*NPTEPG))
109 1.1 thorpej
110 1.1 thorpej /* virtual sizes (bytes) for various kernel submaps */
111 1.1 thorpej #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
112 1.1 thorpej
113 1.1 thorpej /* # of kernel PT pages (initial only, can grow dynamically) */
114 1.1 thorpej #define VM_KERNEL_PT_PAGES ((vsize_t)2)
115 1.1 thorpej
116 1.1 thorpej /*
117 1.1 thorpej * Constants which control the way the VM system deals with memory segments.
118 1.2 thorpej *
119 1.2 thorpej * We generally assume there's just a single real memory segment on this
120 1.2 thorpej * platform, but we need to be able to deal with a "hole" left by a RAM
121 1.2 thorpej * disk if the loader provided one. We optimize for the loader either
122 1.2 thorpej * plopping the RAM disk immediately after the kernel image or at the end
123 1.2 thorpej * of RAM, which would still leave us with a single large segment.
124 1.1 thorpej */
125 1.2 thorpej #define VM_PHYSSEG_MAX 4
126 1.2 thorpej #define VM_PHYSSEG_STRAT VM_PSTRAT_BIGFIRST
127 1.1 thorpej
128 1.1 thorpej #define VM_NFREELIST 1
129 1.1 thorpej #define VM_FREELIST_DEFAULT 0
130 1.1 thorpej
131 1.1 thorpej #define __HAVE_PMAP_PHYSSEG
132 1.1 thorpej
133 1.1 thorpej /*
134 1.1 thorpej * pmap-specific data stored in the vm_physmem[] array.
135 1.1 thorpej */
136 1.1 thorpej struct pmap_physseg {
137 1.1 thorpej struct pv_header *pvheader; /* pv table for this seg */
138 1.1 thorpej };
139 1.1 thorpej
140 1.1 thorpej #endif /* _VIRT68K_VMPARAM_H_ */
141