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