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