vmparam.h revision 1.44
1/*	$NetBSD: vmparam.h,v 1.44 2019/03/27 19:01:44 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#elif defined(_KERNEL)
76#error "Cannot determine page size"
77#else
78/* Default to max for userland */
79#define	PAGE_SHIFT		MAX_PAGE_SHIFT
80#endif
81
82#define	PAGE_SIZE		(1 << PAGE_SHIFT)
83#define	PAGE_MASK		(PAGE_SIZE - 1)
84
85/*
86 * USRSTACK is the top (end) of the user stack.
87 */
88#define	USRSTACK	KERNBASE		/* Start of user stack */
89
90/*
91 * Virtual memory related constants, all in bytes
92 */
93#ifndef MAXTSIZ
94#define	MAXTSIZ		(64*1024*1024)		/* max text size */
95#endif
96#ifndef DFLDSIZ
97#define	DFLDSIZ		(64*1024*1024)		/* initial data size limit */
98#endif
99#ifndef MAXDSIZ
100#define	MAXDSIZ		(512*1024*1024)		/* max data size */
101#endif
102#ifndef	DFLSSIZ
103#define	DFLSSIZ		(8*1024*1024)		/* initial stack size limit */
104#endif
105#ifndef	MAXSSIZ
106#define	MAXSSIZ		(32*1024*1024)		/* max stack size */
107#endif
108
109/*
110 * Mach derived constants
111 */
112
113/*
114 * User/kernel map constants.  Note that sparc/vaddrs.h defines the
115 * IO space virtual base, which must be the same as VM_MAX_KERNEL_ADDRESS:
116 * tread with care.
117 */
118#define VM_MIN_ADDRESS		((vaddr_t)0)
119#define VM_MAX_ADDRESS		((vaddr_t)KERNBASE)
120#define VM_MAXUSER_ADDRESS	((vaddr_t)KERNBASE)
121#define VM_MIN_KERNEL_ADDRESS	((vaddr_t)KERNBASE)
122#define VM_MAX_KERNEL_ADDRESS   ((vaddr_t)KERNEND)
123
124#define VM_PHYSSEG_MAX		32       /* up to 32 segments */
125#define VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
126
127#define	VM_NFREELIST		1
128#define	VM_FREELIST_DEFAULT	0
129
130#endif /* _SPARC_VMPARAM_H_ */
131