1/* $OpenBSD: vmparam.h,v 1.35 2024/03/29 21:06:14 miod Exp $ */
2/* $NetBSD: vmparam.h,v 1.18 2001/05/01 02:19:19 thorpej Exp $ */
3
4/*
5 * Copyright (c) 1992, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * This software was developed by the Computer Systems Engineering group
9 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
10 * contributed to Berkeley.
11 *
12 * All advertising materials mentioning features or use of this software
13 * must display the following acknowledgement:
14 * This product includes software developed by the University of
15 * California, Lawrence Berkeley Laboratory.
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
19 * are met:
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 * 3. Neither the name of the University nor the names of its contributors
26 * may be used to endorse or promote products derived from this software
27 * without specific prior written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 * SUCH DAMAGE.
40 *
41 * @(#)vmparam.h 8.1 (Berkeley) 6/11/93
42 */
43
44/*
45 * Machine dependent constants for sun4u and sun4v UltraSPARC
46 */
47
48#ifndef VMPARAM_H
49#define VMPARAM_H
50
51#define USRSTACK 0xffffffffffffe000L
52
53/*
54 * Virtual memory related constants, all in bytes
55 */
56/*
57 * Since the compiler generates `call' instructions we can't
58 * have more than 4GB in a single text segment.
59 *
60 * And since we only have a 40-bit address space, allow half
61 * of that for data and the other half for stack.
62 */
63#ifndef MAXTSIZ
64#define MAXTSIZ (1L*1024*1024*1024) /* max text size */
65#endif
66#ifndef DFLDSIZ
67#define DFLDSIZ (128L*1024*1024) /* initial data size limit */
68#endif
69#ifndef MAXDSIZ
70#define MAXDSIZ (8L*1024*1024*1024) /* max data size */
71#endif
72#ifndef BRKSIZ
73#define BRKSIZ MAXDSIZ /* heap gap size */
74#endif
75#ifndef DFLSSIZ
76#define DFLSSIZ (2L*1024*1024) /* initial stack size limit */
77#endif
78#ifndef MAXSSIZ
79#define MAXSSIZ (32L*1024*1024) /* max stack size */
80#endif
81
82#define STACKGAP_RANDOM 256*1024
83
84/*
85 * Size of shared memory map
86 */
87#ifndef SHMMAXPGS
88#define SHMMAXPGS 4096 /* 32mb */
89#endif
90
91/*
92 * Size of User Raw I/O map
93 */
94#define USRIOSIZE 300
95
96/*
97 * Mach derived constants
98 */
99
100/*
101 * User/kernel map constants.
102 */
103#define VM_MIN_ADDRESS ((vaddr_t)PAGE_SIZE)
104#define VM_MAX_ADDRESS ((vaddr_t)-1)
105#define VM_MAXUSER_ADDRESS ((vaddr_t)-PAGE_SIZE)
106#ifdef _KERNEL
107#define VM_MIN_STACK_ADDRESS ((vaddr_t)0xfffffe0000000000L)
108#endif
109
110/* map PIE into the first quarter of the address space before hole */
111#define VM_PIE_MIN_ADDR PAGE_SIZE
112#define VM_PIE_MAX_ADDR 0x10000000000
113
114#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)KERNBASE)
115#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0x000007ffffffffffL)
116
117/* virtual sizes (bytes) for various kernel submaps */
118#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
119
120#define VM_PHYSSEG_MAX 32 /* up to 32 segments */
121#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
122#define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */
123
124#endif