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