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 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 25 * Use is subject to license terms. 26 */ 27 28 #ifndef _SYS_VM_MACHPARAM_H 29 #define _SYS_VM_MACHPARAM_H 30 31 #ifdef __cplusplus 32 extern "C" { 33 #endif 34 35 /* 36 * Machine dependent constants for PC. 37 */ 38 39 /* 40 * USRTEXT is the start of the user text/data space. 41 */ 42 #define USRTEXT USRSTACK 43 44 /* 45 * Virtual memory related constants for UNIX resource control, all in bytes. 46 * The default stack size (initial stack size limit) keeps the stack from 47 * taking more than 2 page directory entries in addition to the part of 48 * the page directory entry which also maps the initial text and data, 49 * and makes the default slightly bigger than the 8MB on SPARC. 50 */ 51 #ifdef __amd64 52 /* 53 * On amd64, the stack grows down from just below KERNELBASE (see the 54 * definition of USERLIMIT in i86pc/sys/machparam.h). Theoretically, 55 * it could grow down to the top of the VA hole (0xffff800000000000), 56 * giving it a possible maximum of about 125T. For an amd64 xpv 57 * kernel, all user VA space is below the VA hole. The theoretical 58 * maximum for the stack is about the same, although it can't grow 59 * to quite that size, since it would clash with the heap. 60 * 61 * Pick an upper limit that will work in both cases: 32T. 62 * 63 * For 32bit processes, the stack is below the text segment. 64 */ 65 #define MAXSSIZ (32ULL * 1024ULL * 1024ULL * 1024ULL * 1024ULL) 66 #else 67 #define MAXSSIZ (USRSTACK - 1024*1024) 68 #endif /* __amd64 */ 69 #define DFLSSIZ (8*1024*1024 + ((USRSTACK) & 0x3FFFFF)) 70 71 72 /* 73 * The virtual address space to be used by the seg_map segment 74 * driver for fast kernel mappings. 75 */ 76 #if defined(__i386) 77 #define SEGMAPDEFAULT (16 * 1024 * 1024) 78 #else 79 #define SEGMAPDEFAULT (64 * 1024 * 1024) 80 #endif 81 82 /* 83 * The time for a process to be blocked before being very swappable. 84 * This is a number of seconds which the system takes as being a non-trivial 85 * amount of real time. You probably shouldn't change this; 86 * it is used in subtle ways (fractions and multiples of it are, that is, like 87 * half of a ``long time'', almost a long time, etc.) 88 * It is related to human patience and other factors which don't really 89 * change over time. 90 */ 91 #define MAXSLP 20 92 93 /* 94 * DISKRPM is used to estimate the number of paging i/o operations 95 * which one can expect from a single disk controller. 96 * 97 * XXX - The system doesn't account for multiple swap devices. 98 */ 99 #define DISKRPM 600 100 101 /* 102 * The maximum value for handspreadpages which is the the distance 103 * between the two clock hands in pages. 104 */ 105 #define MAXHANDSPREADPAGES ((64 * 1024 * 1024) / PAGESIZE) 106 107 /* 108 * Paged text files that are less than PGTHRESH bytes 109 * may be "prefaulted in" instead of demand paged. 110 */ 111 #define PGTHRESH (280 * 1024) 112 113 #ifdef __cplusplus 114 } 115 #endif 116 117 #endif /* _SYS_VM_MACHPARAM_H */ 118