xref: /netbsd-src/sys/arch/evbcf/include/vmparam.h (revision 181254a7b1bdde6873432bffef2d2decc4b5c22f)
1 /*	$NetBSD: vmparam.h,v 1.2 2014/03/18 18:20:41 riastradh Exp $	*/
2 /*-
3  * Copyright (c) 2013 The NetBSD Foundation, Inc.
4  * All rights reserved.
5  *
6  * This code is derived from software contributed to The NetBSD Foundation
7  * by Matt Thomas of 3am Software Foundry.
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  *
18  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #ifndef _EVBCF_VMPARAM_H_
32 #define _EVBCF_VMPARAM_H_
33 
34 /*
35  * Machine dependent VM constants for EVBCF (Coldfire)
36  */
37 
38 /*
39  * We use 4K pages on coldfire.  Override the PAGE_* definitions
40  * to be compile-time constants.
41  */
42 #define	PAGE_SHIFT	PGSHIFT
43 #define	PAGE_SIZE	(1 << PAGE_SHIFT)
44 #define	PAGE_MASK	(PAGE_SIZE - 1)
45 
46 /*
47  * USRSTACK is the top (end) of the user stack.
48  */
49 #define	USRSTACK	VM_MAXUSER_ADDRESS	/* Start of user stack */
50 
51 /*
52  * Virtual memory related constants, all in bytes
53  */
54 #ifndef MAXTSIZ
55 #define	MAXTSIZ		(16*1024*1024)		/* max text size */
56 #endif
57 #ifndef DFLDSIZ
58 #define	DFLDSIZ		(64*1024*1024)		/* initial data size limit */
59 #endif
60 #ifndef MAXDSIZ
61 #define	MAXDSIZ		(128*1024*1024)		/* max data size */
62 #endif
63 #ifndef	DFLSSIZ
64 #define	DFLSSIZ		(512*1024)		/* initial stack size limit */
65 #endif
66 #ifndef	MAXSSIZ
67 #define	MAXSSIZ		(16*1024*1024)		/* max stack size */
68 #endif
69 
70 /*
71  * PTEs for mapping user space into the kernel for phyio operations.
72  * One page is enough to handle 4MB of simultaneous raw IO operations.
73  */
74 #ifndef USRIOSIZE
75 #define USRIOSIZE	(1 * NPTEPG)		/* 4MB */
76 #endif
77 
78 /* user/kernel map constants */
79 #define VM_MIN_ADDRESS		((vaddr_t)0)
80 #define VM_MAXUSER_ADDRESS	((vaddr_t)0xBFF00000)
81 #define VM_MAX_ADDRESS		((vaddr_t)0xFFF00000)
82 #define VM_MIN_KERNEL_ADDRESS	((vaddr_t)0xC0000000)
83 #define VM_MAX_KERNEL_ADDRESS	((vaddr_t)-PAGE_SIZE)
84 
85 /* virtual sizes (bytes) for various kernel submaps */
86 #define VM_PHYS_SIZE		(USRIOSIZE*PAGE_SIZE)
87 
88 /*
89  * Constants which control the way the VM system deals with memory segments.
90  * The evbcf port has one physical memory segment.
91  */
92 #define	VM_PHYSSEG_MAX		1
93 #define	VM_PHYSSEG_STRAT	VM_PSTRAT_RANDOM
94 
95 #define	VM_NFREELIST		1
96 #define	VM_FREELIST_DEFAULT	0
97 
98 #endif /* _EVBCF_VMPARAM_H_ */
99