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