xref: /openbsd/sys/arch/macppc/include/vmparam.h (revision 73471bf0)
1 /*	$OpenBSD: vmparam.h,v 1.32 2021/03/15 15:49:20 deraadt Exp $	*/
2 /*	$NetBSD: vmparam.h,v 1.1 1996/09/30 16:34:38 ws Exp $	*/
3 
4 /*-
5  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
6  * Copyright (C) 1995, 1996 TooLs GmbH.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. All advertising materials mentioning features or use of this software
18  *    must display the following acknowledgement:
19  *	This product includes software developed by TooLs GmbH.
20  * 4. The name of TooLs GmbH may not be used to endorse or promote products
21  *    derived from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
24  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26  * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
29  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
31  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 #ifndef MACHINE_VMPARAM_H
36 #define MACHINE_VMPARAM_H
37 
38 #define	USRSTACK	VM_MAXUSER_ADDRESS
39 
40 #ifndef	MAXTSIZ
41 #define	MAXTSIZ		(64*1024*1024)		/* max text size */
42 #endif
43 
44 #ifndef	DFLDSIZ
45 #define	DFLDSIZ		(64*1024*1024)		/* default data size */
46 #endif
47 
48 #ifndef	MAXDSIZ
49 #define	MAXDSIZ		(2UL*1024*1024*1024)	/* max data size */
50 #endif
51 
52 #ifndef BRKSIZ
53 #define	BRKSIZ		MAXDSIZ			/* heap gap size */
54 #endif
55 
56 #ifndef	DFLSSIZ
57 #define	DFLSSIZ		(2*1024*1024)		/* default stack size */
58 #endif
59 
60 #ifndef	MAXSSIZ
61 #define	MAXSSIZ		(32*1024*1024)		/* max stack size */
62 #endif
63 
64 #define STACKGAP_RANDOM	256*1024
65 
66 /*
67  * Size of shared memory map
68  */
69 #ifndef	SHMMAXPGS
70 #define	SHMMAXPGS       8192			/* 32mb */
71 #endif
72 
73 /*
74  * Size of User Raw I/O map
75  */
76 #define	USRIOSIZE	1024
77 
78 /*
79  * Would like to have MAX addresses = 0, but this doesn't (currently) work
80  */
81 #define	VM_MIN_ADDRESS		((vaddr_t)PAGE_SIZE)
82 #define	VM_MAXUSER_ADDRESS	((vaddr_t)0xfffff000)
83 #define	VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
84 #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t)(PPC_KERNEL_SR << ADDR_SR_SHIFT))
85 
86 /* map PIE into approximately the first quarter of user va space */
87 #define VM_PIE_MIN_ADDR		PAGE_SIZE
88 #define VM_PIE_MAX_ADDR		0x40000000
89 
90 #define VM_KERN_ADDRESS_SIZE  (PPC_SEGMENT_LENGTH - (32 * 1024 * 1024))
91 #define	VM_MAX_KERNEL_ADDRESS	(VM_MIN_KERNEL_ADDRESS + VM_KERN_ADDRESS_SIZE)
92 
93 #define	VM_PHYS_SIZE		(USRIOSIZE * PAGE_SIZE)
94 
95 #define	VM_PHYSSEG_MAX	32	/* actually we could have this many segments */
96 #define	VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
97 #define	VM_PHYSSEG_NOADD	/* can't add RAM after vm_mem_init */
98 
99 #endif
100