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 #pragma ident "%Z%%M% %I% %E% SMI"
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 /*
38 * Machine dependent constants for PC.
39 */
40
41 /*
42 * USRTEXT is the start of the user text/data space.
43 */
44 #define USRTEXT USRSTACK
45
46 /*
47 * Virtual memory related constants for UNIX resource control, all in bytes.
48 * The default stack size (initial stack size limit) keeps the stack from
49 * taking more than 2 page directory entries in addition to the part of
50 * the page directory entry which also maps the initial text and data,
51 * and makes the default slightly bigger than the 8MB on SPARC.
52 */
54 /*
55 * On amd64, the stack grows down from just below KERNELBASE (see the
56 * definition of USERLIMIT in i86pc/sys/machparam.h). Theoretically,
57 * it could grow down to the top of the VA hole (0xffff800000000000),
58 * giving it a possible maximum of about 125T. For an amd64 xpv
59 * kernel, all user VA space is below the VA hole. The theoretical
60 * maximum for the stack is about the same, although it can't grow
61 * to quite that size, since it would clash with the heap.
62 *
63 * Pick an upper limit that will work in both cases: 32T.
64 *
65 * For 32bit processes, the stack is below the text segment.
66 */
67 #define MAXSSIZ (32ULL * 1024ULL * 1024ULL * 1024ULL * 1024ULL)
68 #else
69 #define MAXSSIZ (USRSTACK - 1024*1024)
70 #endif /* __amd64 */
71 #define DFLSSIZ (8*1024*1024 + ((USRSTACK) & 0x3FFFFF))
72
73 /*
74 * The following are limits beyond which the hard or soft limits for stack
75 * and data cannot be increased. These may be viewed as fundamental
76 * characteristics of the system. Note: a bug in SVVS requires that the
77 * default hard limit be increasable, so the default hard limit must be
78 * less than these physical limits.
79 */
80 #define DSIZE_LIMIT (USERLIMIT-USRTEXT) /* physical data limit */
81 #define SSIZE_LIMIT (USRSTACK) /* physical stack limit */
82
83 /*
84 * Size of the kernel segkmem system pte table. This virtual
85 * space is controlled by the resource map "kernelmap".
86 */
87 #define SYSPTSIZE ((61*1024*1024) / MMU_PAGESIZE)
88
89 /*
90 * Size of the ethernet addressable kernel segkmem system pte table.
91 * This virtual space is controlled by the resource map "ekernelmap".
92 * The ethernet interfaces in some sun machines can address only
93 * the upper 16 Megabytes of memory. Since the ethernet
94 * driver kmem_allocs its memory, we bias all kmem_allocs
95 * to try ekernelmap first and if it fails try kernelmap.
96 * Folks that allocate directly out of kernelmap, above,
97 * get memory that is non-ethernet addressable.
98 */
99 #define E_SYSPTSIZE (0x2000000 / MMU_PAGESIZE)
100
101 /*
102 * The virtual address space to be used by the seg_map segment
103 * driver for fast kernel mappings.
|
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 */
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 * Size of the kernel segkmem system pte table. This virtual
73 * space is controlled by the resource map "kernelmap".
74 */
75 #define SYSPTSIZE ((61*1024*1024) / MMU_PAGESIZE)
76
77 /*
78 * Size of the ethernet addressable kernel segkmem system pte table.
79 * This virtual space is controlled by the resource map "ekernelmap".
80 * The ethernet interfaces in some sun machines can address only
81 * the upper 16 Megabytes of memory. Since the ethernet
82 * driver kmem_allocs its memory, we bias all kmem_allocs
83 * to try ekernelmap first and if it fails try kernelmap.
84 * Folks that allocate directly out of kernelmap, above,
85 * get memory that is non-ethernet addressable.
86 */
87 #define E_SYSPTSIZE (0x2000000 / MMU_PAGESIZE)
88
89 /*
90 * The virtual address space to be used by the seg_map segment
91 * driver for fast kernel mappings.
|