177957Sbenno/*-
277957Sbenno * Copyright (C) 1995, 1996 Wolfgang Solfrank.
377957Sbenno * Copyright (C) 1995, 1996 TooLs GmbH.
477957Sbenno * All rights reserved.
577957Sbenno *
677957Sbenno * Redistribution and use in source and binary forms, with or without
777957Sbenno * modification, are permitted provided that the following conditions
877957Sbenno * are met:
977957Sbenno * 1. Redistributions of source code must retain the above copyright
1077957Sbenno *    notice, this list of conditions and the following disclaimer.
1177957Sbenno * 2. Redistributions in binary form must reproduce the above copyright
1277957Sbenno *    notice, this list of conditions and the following disclaimer in the
1377957Sbenno *    documentation and/or other materials provided with the distribution.
1477957Sbenno * 3. All advertising materials mentioning features or use of this software
1577957Sbenno *    must display the following acknowledgement:
1677957Sbenno *	This product includes software developed by TooLs GmbH.
1777957Sbenno * 4. The name of TooLs GmbH may not be used to endorse or promote products
1877957Sbenno *    derived from this software without specific prior written permission.
1977957Sbenno *
2077957Sbenno * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
2177957Sbenno * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2277957Sbenno * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2377957Sbenno * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2477957Sbenno * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
2577957Sbenno * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
2677957Sbenno * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
2777957Sbenno * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
2877957Sbenno * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
2977957Sbenno * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3077957Sbenno *
3177957Sbenno *	$NetBSD: vmparam.h,v 1.11 2000/02/11 19:25:16 thorpej Exp $
3277957Sbenno * $FreeBSD$
3377957Sbenno */
3477957Sbenno
3577957Sbenno#ifndef _MACHINE_VMPARAM_H_
3677957Sbenno#define	_MACHINE_VMPARAM_H_
3777957Sbenno
38217400Skib#define	USRSTACK	SHAREDPAGE
3977957Sbenno
4077957Sbenno#ifndef	MAXTSIZ
41200018Snwhitehorn#define	MAXTSIZ		(64*1024*1024)		/* max text size */
4277957Sbenno#endif
4377957Sbenno
4477957Sbenno#ifndef	DFLDSIZ
45200018Snwhitehorn#define	DFLDSIZ		(128*1024*1024)		/* default data size */
4677957Sbenno#endif
4777957Sbenno
4877957Sbenno#ifndef	MAXDSIZ
49200018Snwhitehorn#define	MAXDSIZ		(1*1024*1024*1024)	/* max data size */
5077957Sbenno#endif
5177957Sbenno
5277957Sbenno#ifndef	DFLSSIZ
53200018Snwhitehorn#define	DFLSSIZ		(8*1024*1024)		/* default stack size */
5477957Sbenno#endif
5577957Sbenno
5677957Sbenno#ifndef	MAXSSIZ
57200018Snwhitehorn#define	MAXSSIZ		(64*1024*1024)		/* max stack size */
5877957Sbenno#endif
5977957Sbenno
60229170Snwhitehorn#ifdef AIM
61229170Snwhitehorn#define	VM_MAXUSER_ADDRESS32	((vm_offset_t)0xfffff000)
62229170Snwhitehorn#else
63229170Snwhitehorn#define	VM_MAXUSER_ADDRESS32	((vm_offset_t)0x7ffff000)
64229170Snwhitehorn#endif
65229170Snwhitehorn
6677957Sbenno/*
6777957Sbenno * Would like to have MAX addresses = 0, but this doesn't (currently) work
6877957Sbenno */
69176770Sraj#if !defined(LOCORE)
70209975Snwhitehorn#ifdef __powerpc64__
71209975Snwhitehorn#define	VM_MIN_ADDRESS		(0x0000000000000000UL)
72229170Snwhitehorn#define	VM_MAXUSER_ADDRESS	(0xfffffffffffff000UL)
73209975Snwhitehorn#define	VM_MAX_ADDRESS		(0xffffffffffffffffUL)
74209975Snwhitehorn#else
7577957Sbenno#define	VM_MIN_ADDRESS		((vm_offset_t)0)
76229170Snwhitehorn#define	VM_MAXUSER_ADDRESS	VM_MAXUSER_ADDRESS32
77229170Snwhitehorn#define	VM_MAX_ADDRESS		((vm_offset_t)0xffffffff)
78229170Snwhitehorn#endif
79217400Skib#define	SHAREDPAGE		(VM_MAXUSER_ADDRESS - PAGE_SIZE)
80209975Snwhitehorn#else /* LOCORE */
81229170Snwhitehorn#if !defined(__powerpc64__) && defined(E500)
82176770Sraj#define	VM_MIN_ADDRESS		0
83176770Sraj#define	VM_MAXUSER_ADDRESS	0x7ffff000
84209975Snwhitehorn#endif
85176770Sraj#endif /* LOCORE */
86176770Sraj
87229170Snwhitehorn#define	FREEBSD32_SHAREDPAGE	(VM_MAXUSER_ADDRESS32 - PAGE_SIZE)
88217400Skib#define	FREEBSD32_USRSTACK	FREEBSD32_SHAREDPAGE
89176770Sraj
90209975Snwhitehorn#ifdef AIM
91209975Snwhitehorn#define	KERNBASE		0x00100000UL	/* start of kernel virtual */
92176770Sraj
93209975Snwhitehorn#ifdef __powerpc64__
94209975Snwhitehorn#define	VM_MIN_KERNEL_ADDRESS		0xc000000000000000UL
95209975Snwhitehorn#define	VM_MAX_KERNEL_ADDRESS		0xc0000001c7ffffffUL
96209975Snwhitehorn#define	VM_MAX_SAFE_KERNEL_ADDRESS	VM_MAX_KERNEL_ADDRESS
97209975Snwhitehorn#else
98209975Snwhitehorn#define	VM_MIN_KERNEL_ADDRESS	((vm_offset_t)KERNEL_SR << ADDR_SR_SHFT)
99204128Snwhitehorn#define	VM_MAX_SAFE_KERNEL_ADDRESS (VM_MIN_KERNEL_ADDRESS + 2*SEGMENT_LENGTH -1)
100204128Snwhitehorn#define	VM_MAX_KERNEL_ADDRESS	(VM_MIN_KERNEL_ADDRESS + 3*SEGMENT_LENGTH - 1)
101209975Snwhitehorn#endif
10277957Sbenno
103176770Sraj/*
104176770Sraj * Use the direct-mapped BAT registers for UMA small allocs. This
105176770Sraj * takes pressure off the small amount of available KVA.
106176770Sraj */
107176770Sraj#define UMA_MD_SMALL_ALLOC
108125687Sgrehan
109209975Snwhitehorn#else /* Book-E */
110176770Sraj
111176770Sraj/*
112176770Sraj * Kernel CCSRBAR location. We make this the reset location.
113176770Sraj */
114176770Sraj#define	CCSRBAR_VA		0xfef00000
115176770Sraj#define	CCSRBAR_SIZE		0x00100000
116176770Sraj
117176770Sraj#define	KERNBASE		0xc0000000	/* start of kernel virtual */
118176770Sraj
119176770Sraj#define	VM_MIN_KERNEL_ADDRESS	KERNBASE
120191363Smarcel#define	VM_MAX_KERNEL_ADDRESS	0xf8000000
121176770Sraj
122176770Sraj#endif /* AIM/E500 */
123176770Sraj
12477957Sbenno/* XXX max. amount of KVM to be used by buffers. */
12577957Sbenno#ifndef VM_MAX_KERNEL_BUF
12677957Sbenno#define	VM_MAX_KERNEL_BUF	(SEGMENT_LENGTH * 7 / 10)
12777957Sbenno#endif
12877957Sbenno
129176770Sraj#if !defined(LOCORE)
13077957Sbennostruct pmap_physseg {
13177957Sbenno	struct pv_entry *pvent;
13277957Sbenno	char *attrs;
13377957Sbenno};
134176770Sraj#endif
13577957Sbenno
13677957Sbenno#define	VM_PHYSSEG_MAX		16	/* 1? */
13777957Sbenno
138169291Salc/*
139216589Snwhitehorn * The physical address space is densely populated on 32-bit systems,
140216589Snwhitehorn * but may not be on 64-bit ones.
141169291Salc */
142216589Snwhitehorn#ifdef __powerpc64__
143216589Snwhitehorn#define	VM_PHYSSEG_SPARSE
144216589Snwhitehorn#else
145169291Salc#define	VM_PHYSSEG_DENSE
146216589Snwhitehorn#endif
147169291Salc
148170816Salc/*
149172317Salc * Create three free page pools: VM_FREEPOOL_DEFAULT is the default pool
150170816Salc * from which physical pages are allocated and VM_FREEPOOL_DIRECT is
151170816Salc * the pool from which physical pages for small UMA objects are
152170816Salc * allocated.
153170816Salc */
154172317Salc#define	VM_NFREEPOOL		3
155172317Salc#define	VM_FREEPOOL_CACHE	2
156170816Salc#define	VM_FREEPOOL_DEFAULT	0
157170816Salc#define	VM_FREEPOOL_DIRECT	1
158170816Salc
159170816Salc/*
160170816Salc * Create one free page list.
161170816Salc */
16277957Sbenno#define	VM_NFREELIST		1
16377957Sbenno#define	VM_FREELIST_DEFAULT	0
16477957Sbenno
165170816Salc/*
166170816Salc * The largest allocation size is 4MB.
167170816Salc */
168170816Salc#define	VM_NFREEORDER		11
169170816Salc
170174938Salc/*
171210550Sjhb * Only one memory domain.
172210550Sjhb */
173210550Sjhb#ifndef VM_NDOMAIN
174210550Sjhb#define	VM_NDOMAIN		1
175210550Sjhb#endif
176210550Sjhb
177210550Sjhb/*
178174938Salc * Disable superpage reservations.
179174938Salc */
180174938Salc#ifndef	VM_NRESERVLEVEL
181174938Salc#define	VM_NRESERVLEVEL		0
182174938Salc#endif
183174938Salc
18477957Sbenno#ifndef VM_INITIAL_PAGEIN
18577957Sbenno#define	VM_INITIAL_PAGEIN	16
18677957Sbenno#endif
18777957Sbenno
18877957Sbenno#ifndef SGROWSIZ
18977957Sbenno#define	SGROWSIZ	(128UL*1024)		/* amount to grow stack */
19077957Sbenno#endif
19177957Sbenno
19277957Sbenno#ifndef VM_KMEM_SIZE
19377957Sbenno#define	VM_KMEM_SIZE		(12 * 1024 * 1024)
19477957Sbenno#endif
19577957Sbenno
196209975Snwhitehorn#ifdef __powerpc64__
197209975Snwhitehorn#ifndef VM_KMEM_SIZE_SCALE
198209975Snwhitehorn#define VM_KMEM_SIZE_SCALE      (3)
199209975Snwhitehorn#endif
200209975Snwhitehorn
201209975Snwhitehorn#ifndef VM_KMEM_SIZE_MAX
202209975Snwhitehorn#define VM_KMEM_SIZE_MAX        0x1c0000000  /* 7 GB */
203209975Snwhitehorn#endif
204209975Snwhitehorn#endif
205209975Snwhitehorn
206221855Smdf#define	ZERO_REGION_SIZE	(64 * 1024)	/* 64KB */
207221855Smdf
20877957Sbenno#endif /* _MACHINE_VMPARAM_H_ */
209