xref: /titanic_41/usr/src/uts/sun4/sys/vm_machparam.h (revision 70025d765b044c6d8594bb965a2247a61e991a99)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*	Copyright (c) 1988 AT&T	*/
23 /*	  All Rights Reserved  	*/
24 
25 
26 /*
27  * Copyright (c) 1989,1999 by Sun Microsystems, Inc.
28  * All rights reserved.
29  */
30 
31 #ifndef _SYS_VM_MACHPARAM_H
32 #define	_SYS_VM_MACHPARAM_H
33 
34 #pragma ident	"%Z%%M%	%I%	%E% SMI"
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 /*
41  * Machine dependent constants for sun4u.
42  */
43 
44 /*
45  * USRTEXT is the start of the user text/data space.
46  */
47 #define	USRTEXT		0x2000
48 
49 /*
50  * Virtual memory related constants for UNIX resource control, all in bytes
51  * The default stack size of 8M allows an optimization of mmu mapping
52  * resources so that in normal use a single mmu region map entry (smeg)
53  * can be used to map both the stack and shared libraries
54  */
55 #define	MAXSSIZ		(0x7ffff000)	/* max stack size limit */
56 #define	DFLSSIZ		(8*1024*1024)	/* initial stack size limit */
57 
58 /*
59  * DSIZE_LIMIT and SSIZE_LIMIT exist to work-around an SVVS bug (1094085),
60  * and should be removed from the kernel (1094089)
61  */
62 
63 #define	DSIZE_LIMIT	(USERLIMIT-USRTEXT)	/* physical data limit */
64 #define	SSIZE_LIMIT	(0x7fffffff)	/* physical stack limit */
65 
66 /*
67  * Minimum allowable virtual address space to be used
68  * by the seg_map segment driver for fast kernel mappings.
69  */
70 #define	MINMAPSIZE	0x200000
71 
72 /*
73  * The virtual address space to be used by the seg_map segment
74  * driver for fast kernel mappings.
75  *
76  * Size is 1/8th of physmem at boot.
77  */
78 
79 #ifdef	_LP64
80 #define	SEGMAPSIZE	(256L * 1024L * 1024L * 1024L)	/* 256G */
81 #else
82 #define	SEGMAPSIZE	(256 * 1024 * 1024)		/* 256M */
83 #endif	/* _LP64 */
84 
85 /*
86  * Define the default virtual size and valid size range for the segkp segment.
87  */
88 #ifdef	_LP64
89 #define	SEGKPDEFSIZE	(2L * 1024L * 1024L * 1024L)		/*   2G */
90 #define	SEGKPMAXSIZE	(24L * 1024L * 1024L * 1024L)		/*  24G */
91 #define	SEGKPMINSIZE	(512L * 1024 * 1024L)			/* 512M */
92 #else
93 #define	SEGKPDEFSIZE	(512 * 1024 * 1024)
94 #define	SEGKPMAXSIZE	(512 * 1024 * 1024)
95 #define	SEGKPMINSIZE	(512 * 1024 * 1024)
96 #endif	/* _LP64 */
97 
98 /*
99  * The time for a process to be blocked before being very swappable.
100  * This is a number of seconds which the system takes as being a non-trivial
101  * amount of real time. You probably shouldn't change this;
102  * it is used in subtle ways (fractions and multiples of it are, that is, like
103  * half of a ``long time'', almost a long time, etc.)
104  * It is related to human patience and other factors which don't really
105  * change over time.
106  */
107 #define	MAXSLP 		20
108 
109 /*
110  * A swapped in process is given a small amount of core without being bothered
111  * by the page replacement algorithm. Basically this says that if you are
112  * swapped in you deserve some resources. We protect the last SAFERSS
113  * pages against paging and will just swap you out rather than paging you.
114  * Note that each process has at least UPAGES pages which are not
115  * paged anyways so this number just means a swapped in process is
116  * given around 32k bytes.
117  */
118 /*
119  * nominal ``small'' resident set size
120  * protected against replacement
121  */
122 #define	SAFERSS		3
123 
124 /*
125  * DISKRPM is used to estimate the number of paging i/o operations
126  * which one can expect from a single disk controller.
127  *
128  * XXX - The system doesn't account for multiple swap devices.
129  */
130 #define	DISKRPM		60
131 
132 /*
133  * The maximum value for handspreadpages which is the the distance
134  * between the two clock hands in pages.
135  */
136 #define	MAXHANDSPREADPAGES	((64 * 1024 * 1024) / PAGESIZE)
137 
138 /*
139  * Paged text files that are less than PGTHRESH bytes
140  * may be "prefaulted in" instead of demand paged.
141  */
142 #define	PGTHRESH	(280 * 1024)
143 
144 /*
145  * Cacheable bit for 64 bit MXCC Stream Source registers
146  */
147 #define	BC_CACHE_SHIFT	36
148 
149 /*
150  * set type for 64 bit phys addr variables.  Needed at least for interface
151  * with MXCC.
152  */
153 
154 #ifndef _ASM
155 typedef unsigned long long pa_t;
156 #endif
157 
158 #ifdef	__cplusplus
159 }
160 #endif
161 
162 #endif	/* _SYS_VM_MACHPARAM_H */
163