vmparam.h revision 221855
1136849Sscottl/*-
2149871Sscottl * Copyright (C) 1995, 1996 Wolfgang Solfrank.
3136849Sscottl * Copyright (C) 1995, 1996 TooLs GmbH.
4136849Sscottl * All rights reserved.
5136849Sscottl *
6136849Sscottl * Redistribution and use in source and binary forms, with or without
7136849Sscottl * modification, are permitted provided that the following conditions
8136849Sscottl * are met:
9136849Sscottl * 1. Redistributions of source code must retain the above copyright
10136849Sscottl *    notice, this list of conditions and the following disclaimer.
11136849Sscottl * 2. Redistributions in binary form must reproduce the above copyright
12136849Sscottl *    notice, this list of conditions and the following disclaimer in the
13136849Sscottl *    documentation and/or other materials provided with the distribution.
14136849Sscottl * 3. All advertising materials mentioning features or use of this software
15136849Sscottl *    must display the following acknowledgement:
16136849Sscottl *	This product includes software developed by TooLs GmbH.
17136849Sscottl * 4. The name of TooLs GmbH may not be used to endorse or promote products
18136849Sscottl *    derived from this software without specific prior written permission.
19136849Sscottl *
20136849Sscottl * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
21136849Sscottl * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22136849Sscottl * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23136849Sscottl * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24136849Sscottl * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25142988Sscottl * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26142988Sscottl * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27136849Sscottl * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28136849Sscottl * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29136849Sscottl * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30136849Sscottl *
31136849Sscottl *	$NetBSD: vmparam.h,v 1.11 2000/02/11 19:25:16 thorpej Exp $
32136849Sscottl * $FreeBSD: head/sys/powerpc/include/vmparam.h 221855 2011-05-13 19:35:01Z mdf $
33136849Sscottl */
34136849Sscottl
35136849Sscottl#ifndef _MACHINE_VMPARAM_H_
36136849Sscottl#define	_MACHINE_VMPARAM_H_
37136849Sscottl
38136849Sscottl#define	USRSTACK	SHAREDPAGE
39136849Sscottl
40136849Sscottl#ifndef	MAXTSIZ
41136849Sscottl#define	MAXTSIZ		(64*1024*1024)		/* max text size */
42136849Sscottl#endif
43136849Sscottl
44136849Sscottl#ifndef	DFLDSIZ
45149871Sscottl#define	DFLDSIZ		(128*1024*1024)		/* default data size */
46149871Sscottl#endif
47149871Sscottl
48149871Sscottl#ifndef	MAXDSIZ
49136849Sscottl#define	MAXDSIZ		(1*1024*1024*1024)	/* max data size */
50136849Sscottl#endif
51136849Sscottl
52143039Sscottl#ifndef	DFLSSIZ
53136849Sscottl#define	DFLSSIZ		(8*1024*1024)		/* default stack size */
54136849Sscottl#endif
55136849Sscottl
56136849Sscottl#ifndef	MAXSSIZ
57136849Sscottl#define	MAXSSIZ		(64*1024*1024)		/* max stack size */
58136849Sscottl#endif
59136849Sscottl
60190809Sdelphij/*
61136849Sscottl * Would like to have MAX addresses = 0, but this doesn't (currently) work
62190809Sdelphij */
63136849Sscottl#if !defined(LOCORE)
64136849Sscottl#ifdef __powerpc64__
65136849Sscottl#define	VM_MIN_ADDRESS		(0x0000000000000000UL)
66136849Sscottl#define	VM_MAXUSER_ADDRESS	(0x7ffffffffffff000UL)
67190809Sdelphij#define	SHAREDPAGE		(VM_MAXUSER_ADDRESS - PAGE_SIZE)
68136849Sscottl#define	VM_MAX_ADDRESS		(0xffffffffffffffffUL)
69149871Sscottl#else
70149871Sscottl#define	VM_MIN_ADDRESS		((vm_offset_t)0)
71136849Sscottl#define	VM_MAXUSER_ADDRESS	((vm_offset_t)0x7ffff000)
72136849Sscottl#define	SHAREDPAGE		(VM_MAXUSER_ADDRESS - PAGE_SIZE)
73136849Sscottl#define	VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
74136849Sscottl#endif
75136849Sscottl#else /* LOCORE */
76136849Sscottl#ifndef __powerpc64__
77136849Sscottl#define	VM_MIN_ADDRESS		0
78136849Sscottl#define	VM_MAXUSER_ADDRESS	0x7ffff000
79136849Sscottl#endif
80136849Sscottl#endif /* LOCORE */
81136849Sscottl
82136849Sscottl#define	FREEBSD32_SHAREDPAGE	(0x7ffff000 - PAGE_SIZE)
83136849Sscottl#define	FREEBSD32_USRSTACK	FREEBSD32_SHAREDPAGE
84136849Sscottl
85136849Sscottl#ifdef AIM
86136849Sscottl#define	KERNBASE		0x00100000UL	/* start of kernel virtual */
87136849Sscottl
88136849Sscottl#ifdef __powerpc64__
89136849Sscottl#define	VM_MIN_KERNEL_ADDRESS		0xc000000000000000UL
90136849Sscottl#define	VM_MAX_KERNEL_ADDRESS		0xc0000001c7ffffffUL
91136849Sscottl#define	VM_MAX_SAFE_KERNEL_ADDRESS	VM_MAX_KERNEL_ADDRESS
92136849Sscottl#else
93136849Sscottl#define	VM_MIN_KERNEL_ADDRESS	((vm_offset_t)KERNEL_SR << ADDR_SR_SHFT)
94136849Sscottl#define	VM_MAX_SAFE_KERNEL_ADDRESS (VM_MIN_KERNEL_ADDRESS + 2*SEGMENT_LENGTH -1)
95136849Sscottl#define	VM_MAX_KERNEL_ADDRESS	(VM_MIN_KERNEL_ADDRESS + 3*SEGMENT_LENGTH - 1)
96136849Sscottl#endif
97136849Sscottl
98136849Sscottl/*
99136849Sscottl * Use the direct-mapped BAT registers for UMA small allocs. This
100136849Sscottl * takes pressure off the small amount of available KVA.
101136849Sscottl */
102136849Sscottl#define UMA_MD_SMALL_ALLOC
103136849Sscottl
104190809Sdelphij#else /* Book-E */
105136849Sscottl
106190809Sdelphij/*
107190809Sdelphij * Kernel CCSRBAR location. We make this the reset location.
108190809Sdelphij */
109190809Sdelphij#define	CCSRBAR_VA		0xfef00000
110190809Sdelphij#define	CCSRBAR_SIZE		0x00100000
111190809Sdelphij
112136849Sscottl#define	KERNBASE		0xc0000000	/* start of kernel virtual */
113190809Sdelphij
114136849Sscottl#define	VM_MIN_KERNEL_ADDRESS	KERNBASE
115190809Sdelphij#define	VM_MAX_KERNEL_ADDRESS	0xf8000000
116190809Sdelphij
117190809Sdelphij#endif /* AIM/E500 */
118190809Sdelphij
119136849Sscottl/* XXX max. amount of KVM to be used by buffers. */
120136849Sscottl#ifndef VM_MAX_KERNEL_BUF
121136849Sscottl#define	VM_MAX_KERNEL_BUF	(SEGMENT_LENGTH * 7 / 10)
122190809Sdelphij#endif
123190809Sdelphij
124190809Sdelphij#if !defined(LOCORE)
125136849Sscottlstruct pmap_physseg {
126136849Sscottl	struct pv_entry *pvent;
127136849Sscottl	char *attrs;
128136849Sscottl};
129190809Sdelphij#endif
130136849Sscottl
131136849Sscottl#define	VM_PHYSSEG_MAX		16	/* 1? */
132136849Sscottl
133190809Sdelphij/*
134136849Sscottl * The physical address space is densely populated on 32-bit systems,
135136849Sscottl * but may not be on 64-bit ones.
136136849Sscottl */
137190809Sdelphij#ifdef __powerpc64__
138136849Sscottl#define	VM_PHYSSEG_SPARSE
139136849Sscottl#else
140136849Sscottl#define	VM_PHYSSEG_DENSE
141190809Sdelphij#endif
142136849Sscottl
143136849Sscottl/*
144136849Sscottl * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool
145190809Sdelphij * from which physical pages are allocated and VM_FREEPOOL_DIRECT is
146136849Sscottl * the pool from which physical pages for small UMA objects are
147136849Sscottl * allocated.
148136849Sscottl */
149190809Sdelphij#define	VM_NFREEPOOL		3
150136849Sscottl#define	VM_FREEPOOL_CACHE	2
151136849Sscottl#define	VM_FREEPOOL_DEFAULT	0
152136849Sscottl#define	VM_FREEPOOL_DIRECT	1
153190809Sdelphij
154136849Sscottl/*
155136849Sscottl * Create one free page list.
156136849Sscottl */
157190809Sdelphij#define	VM_NFREELIST		1
158136849Sscottl#define	VM_FREELIST_DEFAULT	0
159136849Sscottl
160136849Sscottl/*
161190809Sdelphij * The largest allocation size is 4MB.
162136849Sscottl */
163136849Sscottl#define	VM_NFREEORDER		11
164136849Sscottl
165136849Sscottl/*
166136849Sscottl * Only one memory domain.
167136849Sscottl */
168136849Sscottl#ifndef VM_NDOMAIN
169136849Sscottl#define	VM_NDOMAIN		1
170136849Sscottl#endif
171136849Sscottl
172190809Sdelphij/*
173136849Sscottl * Disable superpage reservations.
174136849Sscottl */
175136849Sscottl#ifndef	VM_NRESERVLEVEL
176190809Sdelphij#define	VM_NRESERVLEVEL		0
177136849Sscottl#endif
178136849Sscottl
179136849Sscottl#ifndef VM_INITIAL_PAGEIN
180190809Sdelphij#define	VM_INITIAL_PAGEIN	16
181136849Sscottl#endif
182136849Sscottl
183136849Sscottl#ifndef SGROWSIZ
184190809Sdelphij#define	SGROWSIZ	(128UL*1024)		/* amount to grow stack */
185136849Sscottl#endif
186136849Sscottl
187136849Sscottl#ifndef VM_KMEM_SIZE
188190809Sdelphij#define	VM_KMEM_SIZE		(12 * 1024 * 1024)
189136849Sscottl#endif
190136849Sscottl
191136849Sscottl#ifdef __powerpc64__
192190809Sdelphij#ifndef VM_KMEM_SIZE_SCALE
193136849Sscottl#define VM_KMEM_SIZE_SCALE      (3)
194136849Sscottl#endif
195136849Sscottl
196190809Sdelphij#ifndef VM_KMEM_SIZE_MAX
197190809Sdelphij#define VM_KMEM_SIZE_MAX        0x1c0000000  /* 7 GB */
198136849Sscottl#endif
199190809Sdelphij#endif
200190809Sdelphij
201190809Sdelphij#define	ZERO_REGION_SIZE	(64 * 1024)	/* 64KB */
202190809Sdelphij
203190809Sdelphij#endif /* _MACHINE_VMPARAM_H_ */
204190809Sdelphij