Home | History | Annotate | Download | only in sys
      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 2007 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 * 1024L * 1024L)			/* 512M */
    100 #define	SEGZIOMAXSIZE	(512L * 1024L * 1024L * 1024L)		/* 512G */
    101 
    102 /*
    103  * The time for a process to be blocked before being very swappable.
    104  * This is a number of seconds which the system takes as being a non-trivial
    105  * amount of real time. You probably shouldn't change this;
    106  * it is used in subtle ways (fractions and multiples of it are, that is, like
    107  * half of a ``long time'', almost a long time, etc.)
    108  * It is related to human patience and other factors which don't really
    109  * change over time.
    110  */
    111 #define	MAXSLP 		20
    112 
    113 /*
    114  * A swapped in process is given a small amount of core without being bothered
    115  * by the page replacement algorithm. Basically this says that if you are
    116  * swapped in you deserve some resources. We protect the last SAFERSS
    117  * pages against paging and will just swap you out rather than paging you.
    118  * Note that each process has at least UPAGES pages which are not
    119  * paged anyways so this number just means a swapped in process is
    120  * given around 32k bytes.
    121  */
    122 /*
    123  * nominal ``small'' resident set size
    124  * protected against replacement
    125  */
    126 #define	SAFERSS		3
    127 
    128 /*
    129  * DISKRPM is used to estimate the number of paging i/o operations
    130  * which one can expect from a single disk controller.
    131  *
    132  * XXX - The system doesn't account for multiple swap devices.
    133  */
    134 #define	DISKRPM		60
    135 
    136 /*
    137  * The maximum value for handspreadpages which is the the distance
    138  * between the two clock hands in pages.
    139  */
    140 #define	MAXHANDSPREADPAGES	((64 * 1024 * 1024) / PAGESIZE)
    141 
    142 /*
    143  * Paged text files that are less than PGTHRESH bytes
    144  * may be "prefaulted in" instead of demand paged.
    145  */
    146 #define	PGTHRESH	(280 * 1024)
    147 
    148 /*
    149  * Cacheable bit for 64 bit MXCC Stream Source registers
    150  */
    151 #define	BC_CACHE_SHIFT	36
    152 
    153 /*
    154  * set type for 64 bit phys addr variables.  Needed at least for interface
    155  * with MXCC.
    156  */
    157 
    158 #ifndef _ASM
    159 typedef unsigned long long pa_t;
    160 #endif
    161 
    162 #ifdef	__cplusplus
    163 }
    164 #endif
    165 
    166 #endif	/* _SYS_VM_MACHPARAM_H */
    167