xref: /openbsd/sys/arch/alpha/include/vmparam.h (revision 62fe2d4b)
1 /* $OpenBSD: vmparam.h,v 1.25 2014/01/30 18:16:41 miod Exp $ */
2 /* $NetBSD: vmparam.h,v 1.18 2000/05/22 17:13:54 thorpej Exp $ */
3 
4 /*
5  * Copyright (c) 1988 University of Utah.
6  * Copyright (c) 1992, 1993
7  *	The Regents of the University of California.  All rights reserved.
8  *
9  * This code is derived from software contributed to Berkeley by
10  * the Systems Programming Group of the University of Utah Computer
11  * Science Department and Ralph Campbell.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  *    notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  *    notice, this list of conditions and the following disclaimer in the
20  *    documentation and/or other materials provided with the distribution.
21  * 3. Neither the name of the University nor the names of its contributors
22  *    may be used to endorse or promote products derived from this software
23  *    without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35  * SUCH DAMAGE.
36  *
37  * from: Utah $Hdr: vmparam.h 1.16 91/01/18$
38  *
39  *	@(#)vmparam.h	8.2 (Berkeley) 4/22/94
40  */
41 
42 #ifndef	_MACHINE_VMPARAM_H_
43 #define	_MACHINE_VMPARAM_H_
44 
45 /*
46  * Machine dependent constants for Alpha.
47  */
48 
49 /*
50  * USRTEXT is the start of the user text/data space, while USRSTACK
51  * is the top (end) of the user stack.  Immediately above the user stack
52  * resides the user structure, which is UPAGES long and contains the
53  * kernel stack.
54  *
55  * Digital UNIX (formerly DEC OSF/1) places the stack below the
56  * text segment (i.e. growing downward from 4G).  We may want to
57  * consider doing that at some point, but it might require changes
58  * to the exec code.
59  */
60 #define	USRTEXT		PAGE_SIZE
61 #define	USRSTACK	((vaddr_t)0x0000000200000000)		/* 8G */
62 
63 /*
64  * Virtual memory related constants, all in bytes
65  */
66 #ifndef MAXTSIZ
67 #define	MAXTSIZ		(1*1024*1024*1024)	/* max text size */
68 #endif
69 #ifndef DFLDSIZ
70 #define	DFLDSIZ		(128*1024*1024)		/* initial data size */
71 #endif
72 #ifndef MAXDSIZ
73 #define	MAXDSIZ		(1*1024*1024*1024)	/* max data size */
74 #endif
75 #ifndef BRKSIZ
76 #define	BRKSIZ		MAXDSIZ			/* heap gap size */
77 #endif
78 #ifndef	DFLSSIZ
79 #define	DFLSSIZ		(2*1024*1024)		/* initial stack size */
80 #endif
81 #ifndef	MAXSSIZ
82 #define	MAXSSIZ		(32*1024*1024)		/* max stack size */
83 #endif
84 
85 #define STACKGAP_RANDOM	256*1024
86 
87 /*
88  * PTEs for mapping user space into the kernel for physio operations.
89  * 64 pte's are enough to cover 8 disks * MAXBSIZE.
90  */
91 #ifndef USRIOSIZE
92 #define USRIOSIZE	64
93 #endif
94 
95 /*
96  * PTEs for system V style shared memory.
97  * This is basically slop for kmempt which we actually allocate (malloc) from.
98  */
99 #ifndef SHMMAXPGS
100 #define SHMMAXPGS	4096		/* 32mb */
101 #endif
102 
103 /*
104  * Mach derived constants
105  */
106 
107 /* user/kernel map constants */
108 #define VM_MIN_ADDRESS		((vaddr_t)PAGE_SIZE)
109 #define VM_MAXUSER_ADDRESS	((vaddr_t)(ALPHA_USEG_END + 1L))    /* 4T */
110 #define VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
111 #define VM_MIN_KERNEL_ADDRESS	((vaddr_t)ALPHA_K1SEG_BASE)
112 #define VM_MAX_KERNEL_ADDRESS	((vaddr_t)ALPHA_K1SEG_END)
113 
114 /* map PIE into the first quarter of the address space before stack */
115 #define VM_PIE_MIN_ADDR		PAGE_SIZE
116 #define VM_PIE_MAX_ADDR		0x80000000
117 
118 /* virtual sizes (bytes) for various kernel submaps */
119 #define VM_PHYS_SIZE		(USRIOSIZE * PAGE_SIZE)
120 
121 /* some Alpha-specific constants */
122 #define	VPTBASE		((vaddr_t)0xfffffffc00000000)	/* Virt. pg table */
123 
124 #define	VM_PHYSSEG_MAX		16		/* XXX */
125 #define	VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
126 #define	VM_PHYSSEG_NOADD			/* no more after vm_mem_init */
127 
128 #endif	/* ! _MACHINE_VMPARAM_H_ */
129