1/* $OpenBSD: vmparam.h,v 1.31 2023/11/16 13:47:22 deraadt Exp $ */
2/* $NetBSD: vmparam.h,v 1.5 1994/10/26 21:10:10 cgd Exp $ */
3
4/*
5 * Copyright (c) 1988 University of Utah.
6 * Copyright (c) 1992, 1993
7 * The Regents of the University of California. All rights reserved.
8 *
9 * This code is derived from software contributed to Berkeley by
10 * the Systems Programming Group of the University of Utah Computer
11 * Science Department and Ralph Campbell.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * from: Utah Hdr: vmparam.h 1.16 91/01/18
38 * @(#)vmparam.h 8.2 (Berkeley) 4/22/94
39 */
40
41#ifndef _MIPS64_VMPARAM_H_
42#define _MIPS64_VMPARAM_H_
43
44/*
45 * Machine dependent constants mips processors.
46 */
47
48#define USRSTACK VM_MAXUSER_ADDRESS /* Start of user stack */
49
50/*
51 * Virtual memory related constants, all in bytes
52 */
53#ifndef MAXTSIZ
54#define MAXTSIZ (128*1024*1024) /* max text size */
55#endif
56#ifndef DFLDSIZ
57#define DFLDSIZ (128*1024*1024) /* initial data size limit */
58#endif
59#ifndef MAXDSIZ
60#define MAXDSIZ (16UL*1024*1024*1024) /* max data size */
61#endif
62#ifndef BRKSIZ
63#define BRKSIZ MAXDSIZ /* heap gap size */
64#endif
65#ifndef DFLSSIZ
66#define DFLSSIZ (2*1024*1024) /* initial stack size limit */
67#endif
68#ifndef MAXSSIZ
69#define MAXSSIZ (32*1024*1024) /* max stack size */
70#endif
71
72#define STACKGAP_RANDOM 256*1024
73
74/*
75 * PTEs for mapping user space into the kernel for physio operations.
76 * 16 pte's are enough to cover 8 disks * MAXBSIZE.
77 */
78#ifndef USRIOSIZE
79#define USRIOSIZE 32
80#endif
81
82/*
83 * PTEs for system V style shared memory.
84 * This is basically slop for kmempt which we actually allocate (malloc) from.
85 */
86#ifndef SHMMAXPGS
87#define SHMMAXPGS 8192 /* 8mb */
88#endif
89
90#ifndef VM_PHYSSEG_MAX
91#define VM_PHYSSEG_MAX 8 /* Max number of physical memory segments */
92#endif
93#ifndef VM_PHYSSEG_STRAT
94#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
95#endif
96#define VM_PHYSSEG_NOADD
97
98/* user/kernel map constants */
99#define VM_MIN_ADDRESS ((vaddr_t)0x0000000000004000L)
100#define VM_MAXUSER_ADDRESS ((vaddr_t)0x0000010000000000L)
101#define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS
102#ifdef _KERNEL
103#define VM_MIN_STACK_ADDRESS ((vaddr_t)0x000000c000000000L)
104#endif
105#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xc000000000000000L)
106#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xc000000040000000L)
107
108/* map PIE into approximately the first quarter of user va space */
109#define VM_PIE_MIN_ADDR PAGE_SIZE
110#define VM_PIE_MAX_ADDR (0x4000000000UL)
111
112/* virtual sizes (bytes) for various kernel submaps */
113#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
114
115#endif /* !_MIPS64_VMPARAM_H_ */