xref: /netbsd-src/sys/arch/sparc/include/vmparam.h (revision 800ea1b10eafaa78c0a95e9440a4ec5f3ab1453b)
1 /*	$NetBSD: vmparam.h,v 1.48 2019/03/29 20:18:09 christos Exp $ */
2 
3 /*
4  * Copyright (c) 1992, 1993
5  *	The Regents of the University of California.  All rights reserved.
6  *
7  * This software was developed by the Computer Systems Engineering group
8  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
9  * contributed to Berkeley.
10  *
11  * All advertising materials mentioning features or use of this software
12  * must display the following acknowledgement:
13  *	This product includes software developed by the University of
14  *	California, Lawrence Berkeley Laboratory.
15  *
16  * Redistribution and use in source and binary forms, with or without
17  * modification, are permitted provided that the following conditions
18  * are met:
19  * 1. Redistributions of source code must retain the above copyright
20  *    notice, this list of conditions and the following disclaimer.
21  * 2. Redistributions in binary form must reproduce the above copyright
22  *    notice, this list of conditions and the following disclaimer in the
23  *    documentation and/or other materials provided with the distribution.
24  * 3. Neither the name of the University nor the names of its contributors
25  *    may be used to endorse or promote products derived from this software
26  *    without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
29  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
32  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38  * SUCH DAMAGE.
39  *
40  *	@(#)vmparam.h	8.1 (Berkeley) 6/11/93
41  */
42 
43 #ifndef _SPARC_VMPARAM_H_
44 #define _SPARC_VMPARAM_H_
45 
46 #define __USE_TOPDOWN_VM
47 
48 /*
49  * Machine dependent constants for SPARC
50  */
51 
52 #include <machine/cpuconf.h>
53 
54 /*
55  * Sun4 systems have a 8K page size.  All other platforms have a
56  * 4K page size.  We need to define these upper and lower limits
57  * for machine-independent code.  We also try to make PAGE_SIZE,
58  * PAGE_SHIFT, and PAGE_MASK into compile-time constants, if we can.
59  *
60  * XXX Should garbage-collect the version of this from <machine/param.h>.
61  */
62 #define	PAGE_SHIFT_SUN4		13
63 #define	PAGE_SHIFT_SUN4CM	12
64 
65 #define MAX_PAGE_SHIFT		PAGE_SHIFT_SUN4
66 #define MIN_PAGE_SHIFT		PAGE_SHIFT_SUN4CM
67 
68 #define	MIN_PAGE_SIZE		(1 << MIN_PAGE_SHIFT)
69 #define	MAX_PAGE_SIZE		(1 << MAX_PAGE_SHIFT)
70 
71 #if CPU_NTYPES != 0 && !defined(SUN4)
72 #define	PAGE_SHIFT		PAGE_SHIFT_SUN4CM
73 #elif CPU_NTYPES == 1 && defined(SUN4)
74 #define	PAGE_SHIFT		PAGE_SHIFT_SUN4
75 #endif
76 
77 #ifdef	PAGE_SHIFT
78 #define	PAGE_SIZE		(1 << PAGE_SHIFT)
79 #define	PAGE_MASK		(PAGE_SIZE - 1)
80 #endif
81 
82 /*
83  * USRSTACK is the top (end) of the user stack.
84  */
85 #define	USRSTACK	KERNBASE		/* Start of user stack */
86 
87 /*
88  * Virtual memory related constants, all in bytes
89  */
90 #ifndef MAXTSIZ
91 #define	MAXTSIZ		(64*1024*1024)		/* max text size */
92 #endif
93 #ifndef DFLDSIZ
94 #define	DFLDSIZ		(64*1024*1024)		/* initial data size limit */
95 #endif
96 #ifndef MAXDSIZ
97 #define	MAXDSIZ		(512*1024*1024)		/* max data size */
98 #endif
99 #ifndef	DFLSSIZ
100 #define	DFLSSIZ		(8*1024*1024)		/* initial stack size limit */
101 #endif
102 #ifndef	MAXSSIZ
103 #define	MAXSSIZ		(32*1024*1024)		/* max stack size */
104 #endif
105 
106 /*
107  * Mach derived constants
108  */
109 
110 /*
111  * User/kernel map constants.  Note that sparc/vaddrs.h defines the
112  * IO space virtual base, which must be the same as VM_MAX_KERNEL_ADDRESS:
113  * tread with care.
114  */
115 #define VM_MIN_ADDRESS		((vaddr_t)0)
116 #define VM_MAX_ADDRESS		((vaddr_t)KERNBASE)
117 #define VM_MAXUSER_ADDRESS	((vaddr_t)KERNBASE)
118 #define VM_MIN_KERNEL_ADDRESS	((vaddr_t)KERNBASE)
119 #define VM_MAX_KERNEL_ADDRESS   ((vaddr_t)KERNEND)
120 
121 #define VM_PHYSSEG_MAX		32       /* up to 32 segments */
122 #define VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
123 
124 #define	VM_NFREELIST		1
125 #define	VM_FREELIST_DEFAULT	0
126 
127 #endif /* _SPARC_VMPARAM_H_ */
128