vmparam.h revision 1.13 1 /* $NetBSD: vmparam.h,v 1.13 2002/05/09 12:28:08 uch Exp $ */
2
3 /*-
4 * Copyright (c) 2002 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by UCHIYAMA Yasushi.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #ifndef _SH3_VMPARAM_H_
40 #define _SH3_VMPARAM_H_
41 #include <sys/queue.h>
42
43 /* Virtual address map. */
44 #define VM_MIN_ADDRESS ((vaddr_t)0)
45 #define VM_MAXUSER_ADDRESS ((vaddr_t)0x7ffff000)
46 #define VM_MAX_ADDRESS ((vaddr_t)0x7ffff000)
47 #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xc0000000)
48 #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xe0000000)
49
50 /* User program text start address and top of stack */
51 #define USRTEXT 0x00001000
52 #define USRSTACK VM_MAXUSER_ADDRESS
53
54 /* Virtual memory resoruce limit. */
55 #define MAXTSIZ (64 * 1024 * 1024) /* max text size */
56 #ifndef MAXDSIZ
57 #define MAXDSIZ (512 * 1024 * 1024) /* max data size */
58 #endif
59 #ifndef MAXSSIZ
60 #define MAXSSIZ (32 * 1024 * 1024) /* max stack size */
61 #endif
62
63 /* initial data size limit */
64 #ifndef DFLDSIZ
65 #define DFLDSIZ (128 * 1024 * 1024)
66 #endif
67 /* initial stack size limit */
68 #ifndef DFLSSIZ
69 #define DFLSSIZ (2 * 1024 * 1024)
70 #endif
71
72 /*
73 * Size of shared memory map
74 */
75 #ifndef SHMMAXPGS
76 #define SHMMAXPGS 1024
77 #endif
78
79 /* Size of user raw I/O map */
80 #ifndef USRIOSIZE
81 #define USRIOSIZE (MAXBSIZE / NBPG * 8)
82 #endif
83
84 #define VM_PHYS_SIZE (USRIOSIZE * NBPG)
85
86 /* Physical memory segments */
87 #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
88 #define VM_PHYSSEG_NOADD
89
90 #define sh3_round_page(x) ((((u_int32_t)(x)) + PGOFSET) & ~PGOFSET)
91 #define sh3_trunc_page(x) ((u_int32_t)(x) & ~PGOFSET)
92 #define sh3_btop(x) ((u_int32_t)(x) >> PGSHIFT)
93 #define sh3_ptob(x) ((u_int32_t)(x) << PGSHIFT)
94
95 /* pmap-specific data store in the vm_page structure. */
96 #define __HAVE_VM_PAGE_MD
97 #define PVH_REFERENCED 1
98 #define PVH_MODIFIED 2
99
100 #ifndef _LOCORE
101 struct pv_entry;
102 struct vm_page_md {
103 SLIST_HEAD(, pv_entry) pvh_head;
104 int pvh_flags;
105 };
106
107 #define VM_MDPAGE_INIT(pg) \
108 do { \
109 struct vm_page_md *pvh = &(pg)->mdpage; \
110 SLIST_INIT(&pvh->pvh_head); \
111 pvh->pvh_flags = 0; \
112 } while (/*CONSTCOND*/0)
113 #endif /* _LOCORE */
114 #endif /* !_SH3_VMPARAM_H_ */
115