xref: /openbsd/sys/arch/arm64/include/vmparam.h (revision bc13e585)
1 /*	$OpenBSD: vmparam.h,v 1.9 2023/04/28 18:33:22 robert Exp $	*/
2 /*	$NetBSD: vmparam.h,v 1.1 2003/04/26 18:39:49 fvdl Exp $	*/
3 
4 /*-
5  * Copyright (c) 1990 The Regents of the University of California.
6  * All rights reserved.
7  *
8  * This code is derived from software contributed to Berkeley by
9  * William Jolitz.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in the
18  *    documentation and/or other materials provided with the distribution.
19  * 3. Neither the name of the University nor the names of its contributors
20  *    may be used to endorse or promote products derived from this software
21  *    without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34  *
35  *	@(#)vmparam.h	5.9 (Berkeley) 5/12/91
36  */
37 
38 #ifndef _MACHINE_VMPARAM_H_
39 #define _MACHINE_VMPARAM_H_
40 
41 /*
42  * Machine dependent constants for arm64.
43  */
44 
45 #define	USRSTACK	VM_MAXUSER_ADDRESS
46 
47 /*
48  * Virtual memory related constants, all in bytes
49  */
50 #define	MAXTSIZ		((paddr_t)256*1024*1024)	/* max text size */
51 #ifndef DFLDSIZ
52 #define	DFLDSIZ		((paddr_t)512*1024*1024)	/* initial data size limit */
53 #endif
54 #ifndef MAXDSIZ
55 #define	MAXDSIZ		((paddr_t)64*1024*1024*1024)	/* max data size */
56 #endif
57 #ifndef BRKSIZ
58 #define	BRKSIZ		((paddr_t)16*1024*1024*1024)	/* heap gap size */
59 #endif
60 #ifndef	DFLSSIZ
61 #define	DFLSSIZ		((paddr_t)2*1024*1024)		/* initial stack size limit */
62 #endif
63 #ifndef	MAXSSIZ
64 #define	MAXSSIZ		((paddr_t)32*1024*1024)		/* max stack size */
65 #endif
66 
67 #define	STACKGAP_RANDOM	256*1024
68 
69 /*
70  * Size of shared memory map
71  */
72 #ifndef	SHMMAXPGS
73 #define	SHMMAXPGS	1024
74 #endif
75 
76 /*
77  * Size of User Raw I/O map
78  */
79 #define	USRIOSIZE 	300
80 
81 /*
82  * Kernel base
83  */
84 #define	KERNEL_BASE	0xffffff8000000000ULL
85 
86 /*
87  * Mach derived constants
88  */
89 
90 /* user/kernel map constants */
91 #define	VM_MIN_ADDRESS		((vaddr_t)PAGE_SIZE)
92 #define	USER_SPACE_BITS		39
93 #define	VM_MAXUSER_ADDRESS	((1ULL << USER_SPACE_BITS) - 0x8000)
94 #define	VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
95 #ifdef _KERNEL
96 #define	VM_MIN_STACK_ADDRESS	(3ULL << (USER_SPACE_BITS - 2))
97 #endif
98 #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t)0xffffff8000000000ULL)
99 #define	VM_MAX_KERNEL_ADDRESS	((vaddr_t)0xffffff83ffffffffULL)
100 
101 /* virtual sizes (bytes) for various kernel submaps */
102 #define	VM_PHYS_SIZE		(USRIOSIZE*PAGE_SIZE)
103 
104 #define	VM_PHYSSEG_MAX		32
105 #define	VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
106 #define	VM_PHYSSEG_NOADD	/* can't add RAM after vm_mem_init */
107 
108 #endif /* _MACHINE_VMPARAM_H_ */
109