vmparam.h revision 1.1.10.2 1 1.1.10.2 tron /* $NetBSD: vmparam.h,v 1.1.10.2 2006/05/24 15:48:00 tron Exp $ */
2 1.1.10.2 tron
3 1.1.10.2 tron /*-
4 1.1.10.2 tron * Copyright (c) 1990 The Regents of the University of California.
5 1.1.10.2 tron * All rights reserved.
6 1.1.10.2 tron *
7 1.1.10.2 tron * This code is derived from software contributed to Berkeley by
8 1.1.10.2 tron * William Jolitz.
9 1.1.10.2 tron *
10 1.1.10.2 tron * Redistribution and use in source and binary forms, with or without
11 1.1.10.2 tron * modification, are permitted provided that the following conditions
12 1.1.10.2 tron * are met:
13 1.1.10.2 tron * 1. Redistributions of source code must retain the above copyright
14 1.1.10.2 tron * notice, this list of conditions and the following disclaimer.
15 1.1.10.2 tron * 2. Redistributions in binary form must reproduce the above copyright
16 1.1.10.2 tron * notice, this list of conditions and the following disclaimer in the
17 1.1.10.2 tron * documentation and/or other materials provided with the distribution.
18 1.1.10.2 tron * 3. Neither the name of the University nor the names of its contributors
19 1.1.10.2 tron * may be used to endorse or promote products derived from this software
20 1.1.10.2 tron * without specific prior written permission.
21 1.1.10.2 tron *
22 1.1.10.2 tron * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 1.1.10.2 tron * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 1.1.10.2 tron * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 1.1.10.2 tron * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 1.1.10.2 tron * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 1.1.10.2 tron * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 1.1.10.2 tron * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 1.1.10.2 tron * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 1.1.10.2 tron * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 1.1.10.2 tron * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 1.1.10.2 tron * SUCH DAMAGE.
33 1.1.10.2 tron *
34 1.1.10.2 tron * @(#)vmparam.h 5.9 (Berkeley) 5/12/91
35 1.1.10.2 tron */
36 1.1.10.2 tron
37 1.1.10.2 tron #ifndef _VMPARAM_H_
38 1.1.10.2 tron #define _VMPARAM_H_
39 1.1.10.2 tron
40 1.1.10.2 tron #include <sys/tree.h>
41 1.1.10.2 tron
42 1.1.10.2 tron #define USRSTACK VM_MAX_ADDRESS /* XXX: Revisit vm address space. */
43 1.1.10.2 tron
44 1.1.10.2 tron /*
45 1.1.10.2 tron * Virtual memory related constants, all in bytes
46 1.1.10.2 tron */
47 1.1.10.2 tron #ifndef MAXTSIZ
48 1.1.10.2 tron #define MAXTSIZ (1<<30) /* max text size (1G) */
49 1.1.10.2 tron #endif
50 1.1.10.2 tron #ifndef DFLDSIZ
51 1.1.10.2 tron #define DFLDSIZ (1<<27) /* initial data size (128M) */
52 1.1.10.2 tron #endif
53 1.1.10.2 tron #ifndef MAXDSIZ
54 1.1.10.2 tron #define MAXDSIZ (1<<30) /* max data size (1G) */
55 1.1.10.2 tron #endif
56 1.1.10.2 tron #ifndef DFLSSIZ
57 1.1.10.2 tron #define DFLSSIZ (1<<21) /* initial stack size (2M) */
58 1.1.10.2 tron #endif
59 1.1.10.2 tron #ifndef MAXSSIZ
60 1.1.10.2 tron #define MAXSSIZ (1<<28) /* max stack size (256M) */
61 1.1.10.2 tron #endif
62 1.1.10.2 tron #ifndef SGROWSIZ
63 1.1.10.2 tron #define SGROWSIZ (128UL*1024) /* amount to grow stack */
64 1.1.10.2 tron #endif
65 1.1.10.2 tron
66 1.1.10.2 tron
67 1.1.10.2 tron
68 1.1.10.2 tron /*
69 1.1.10.2 tron * PTEs for mapping user space into the kernel for phyio operations.
70 1.1.10.2 tron * 64 pte's are enough to cover 8 disks * MAXBSIZE.
71 1.1.10.2 tron */
72 1.1.10.2 tron #ifndef USRIOSIZE
73 1.1.10.2 tron #define USRIOSIZE 64
74 1.1.10.2 tron #endif
75 1.1.10.2 tron
76 1.1.10.2 tron /*
77 1.1.10.2 tron * Manipulating region bits of an address.
78 1.1.10.2 tron */
79 1.1.10.2 tron #define IA64_RR_BASE(n) (((u_int64_t) (n)) << 61)
80 1.1.10.2 tron #define IA64_RR_MASK(x) ((x) & ((1L << 61) - 1))
81 1.1.10.2 tron
82 1.1.10.2 tron #define IA64_PHYS_TO_RR6(x) ((x) | IA64_RR_BASE(6))
83 1.1.10.2 tron #define IA64_PHYS_TO_RR7(x) ((x) | IA64_RR_BASE(7))
84 1.1.10.2 tron
85 1.1.10.2 tron #define IA64_ID_PAGE_SHIFT 28 /* 256M */
86 1.1.10.2 tron #define IA64_ID_PAGE_SIZE (1 << IA64_ID_PAGE_SHIFT)
87 1.1.10.2 tron #define IA64_ID_PAGE_MASK (IA64_ID_PAGE_SIZE-1)
88 1.1.10.2 tron
89 1.1.10.2 tron #define PAGE_SHIFT 14 /* 16K pages by default. */
90 1.1.10.2 tron #define PAGE_SIZE (1 << PAGE_SHIFT)
91 1.1.10.2 tron #define PAGE_MASK (PAGE_SIZE - 1)
92 1.1.10.2 tron
93 1.1.10.2 tron /* user/kernel map constants */
94 1.1.10.2 tron #define VM_MIN_ADDRESS ((vaddr_t)0)
95 1.1.10.2 tron #define VM_MAX_ADDRESS ((vaddr_t) IA64_RR_BASE(5))
96 1.1.10.2 tron #define VM_GATEWAY_SIZE PAGE_SIZE
97 1.1.10.2 tron #define VM_MAXUSER_ADDRESS (VM_MAX_ADDRESS + VM_GATEWAY_SIZE)
98 1.1.10.2 tron #define VM_MIN_KERNEL_ADDRESS VM_MAXUSER_ADDRESS
99 1.1.10.2 tron #define VM_MAX_KERNEL_ADDRESS ((vaddr_t) (IA64_RR_BASE(6) - 1))
100 1.1.10.2 tron
101 1.1.10.2 tron #define VM_PHYSSEG_MAX 16 /* XXX: */
102 1.1.10.2 tron #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
103 1.1.10.2 tron #define VM_PHYSSEG_NOADD /* no more after vm_mem_init */
104 1.1.10.2 tron
105 1.1.10.2 tron #define VM_NFREELIST 1 /* XXX: */
106 1.1.10.2 tron #define VM_FREELIST_DEFAULT 0 /* XXX: */
107 1.1.10.2 tron
108 1.1.10.2 tron /* virtual sizes (bytes) for various kernel submaps */
109 1.1.10.2 tron #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
110 1.1.10.2 tron
111 1.1.10.2 tron #ifndef _LOCORE
112 1.1.10.2 tron /*
113 1.1.10.2 tron * pmap-specific data store in the vm_page structure.
114 1.1.10.2 tron */
115 1.1.10.2 tron #define __HAVE_VM_PAGE_MD
116 1.1.10.2 tron struct vm_page_md {
117 1.1.10.2 tron TAILQ_HEAD(,pv_entry) pv_list; /* pv_entry list */
118 1.1.10.2 tron int pv_list_count;
119 1.1.10.2 tron struct simplelock pv_slock; /* lock on this head */
120 1.1.10.2 tron int pvh_attrs; /* page attributes */
121 1.1.10.2 tron };
122 1.1.10.2 tron
123 1.1.10.2 tron #define VM_MDPAGE_INIT(pg) \
124 1.1.10.2 tron do { \
125 1.1.10.2 tron TAILQ_INIT(&(pg)->mdpage.pv_list); \
126 1.1.10.2 tron simple_lock_init(&(pg)->mdpage.pv_slock); \
127 1.1.10.2 tron } while (/*CONSTCOND*/0)
128 1.1.10.2 tron #endif /*_LOCORE*/
129 1.1.10.2 tron
130 1.1.10.2 tron #endif /* _VMPARAM_H_ */
131