xref: /netbsd-src/sys/arch/or1k/include/vmparam.h (revision 27620987b8618edefe3919667fcfb2a0eb02578b)
1*27620987Smatt /* $NetBSD: vmparam.h,v 1.1 2014/09/03 19:34:26 matt Exp $ */
2*27620987Smatt 
3*27620987Smatt /*-
4*27620987Smatt  * Copyright (c) 2014 The NetBSD Foundation, Inc.
5*27620987Smatt  * All rights reserved.
6*27620987Smatt  *
7*27620987Smatt  * This code is derived from software contributed to The NetBSD Foundation
8*27620987Smatt  * by Matt Thomas of 3am Software Foundry.
9*27620987Smatt  *
10*27620987Smatt  * Redistribution and use in source and binary forms, with or without
11*27620987Smatt  * modification, are permitted provided that the following conditions
12*27620987Smatt  * are met:
13*27620987Smatt  * 1. Redistributions of source code must retain the above copyright
14*27620987Smatt  *    notice, this list of conditions and the following disclaimer.
15*27620987Smatt  * 2. Redistributions in binary form must reproduce the above copyright
16*27620987Smatt  *    notice, this list of conditions and the following disclaimer in the
17*27620987Smatt  *    documentation and/or other materials provided with the distribution.
18*27620987Smatt  *
19*27620987Smatt  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20*27620987Smatt  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21*27620987Smatt  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22*27620987Smatt  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23*27620987Smatt  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24*27620987Smatt  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25*27620987Smatt  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*27620987Smatt  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27*27620987Smatt  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28*27620987Smatt  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29*27620987Smatt  * POSSIBILITY OF SUCH DAMAGE.
30*27620987Smatt  */
31*27620987Smatt 
32*27620987Smatt #ifndef _OR1K_VMPARAM_H_
33*27620987Smatt #define _OR1K_VMPARAM_H_
34*27620987Smatt 
35*27620987Smatt /*
36*27620987Smatt  * OR1K supports 1 page size: 8KB.
37*27620987Smatt  */
38*27620987Smatt 
39*27620987Smatt #define PAGE_SHIFT	13
40*27620987Smatt #define PAGE_SIZE	(1 << PAGE_SHIFT)
41*27620987Smatt #define PAGE_MASK	(PAGE_SIZE - 1)
42*27620987Smatt 
43*27620987Smatt #define USPACE		16384
44*27620987Smatt #define	UPAGES		(USPACE >> PAGE_SHIFT)
45*27620987Smatt 
46*27620987Smatt /*
47*27620987Smatt  * USRSTACK is the top (end) of the user stack.  The user VA space is a
48*27620987Smatt  * 32-bit address space starting at 0.  Place the stack at its top end.
49*27620987Smatt  */
50*27620987Smatt #define USRSTACK	((vaddr_t) 0x80000000U - PAGE_SIZE)
51*27620987Smatt 
52*27620987Smatt #ifndef MAXTSIZ
53*27620987Smatt #define	MAXTSIZ		(1UL << 26)	/* 32bit max text size (64MB) */
54*27620987Smatt #endif
55*27620987Smatt 
56*27620987Smatt #ifndef MAXDSIZ
57*27620987Smatt #define	MAXDSIZ		(1UL << 30)	/* max data size (1024MB) */
58*27620987Smatt #endif
59*27620987Smatt 
60*27620987Smatt #ifndef MAXSSIZ
61*27620987Smatt #define	MAXSSIZ		(1UL << 26)	/* max stack size (64MB) */
62*27620987Smatt #endif
63*27620987Smatt 
64*27620987Smatt #ifndef DFLDSIZ
65*27620987Smatt #define	DFLDSIZ		(1UL << 27)	/* 32bit default data size (128MB) */
66*27620987Smatt #endif
67*27620987Smatt 
68*27620987Smatt #ifndef DFLSSIZ
69*27620987Smatt #define	DFLSSIZ		(1UL << 21)	/* 32bit default stack size (2MB) */
70*27620987Smatt #endif
71*27620987Smatt 
72*27620987Smatt #define	VM_MIN_ADDRESS		((vaddr_t) 0x0)
73*27620987Smatt #define	VM_MAXUSER_ADDRESS	((vaddr_t) 0x80000000 - PAGE_SIZE)
74*27620987Smatt #define	VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
75*27620987Smatt 
76*27620987Smatt /*
77*27620987Smatt  * Give ourselves 64GB of mappable kernel space.  That leaves the rest
78*27620987Smatt  * to be user for directly mapped (block addressable) addresses.
79*27620987Smatt  */
80*27620987Smatt #define VM_MIN_KERNEL_ADDRESS	((vaddr_t) 0x80000000L)
81*27620987Smatt #define VM_MAX_KERNEL_ADDRESS	((vaddr_t) -PAGE_SIZE)
82*27620987Smatt 
83*27620987Smatt /* virtual sizes (bytes) for various kernel submaps */
84*27620987Smatt #define USRIOSIZE		(PAGE_SIZE / 8)
85*27620987Smatt #define VM_PHYS_SIZE		(USRIOSIZE * PAGE_SIZE)
86*27620987Smatt 
87*27620987Smatt /* */
88*27620987Smatt #define VM_PHYSSEG_MAX		16              /* XXX */
89*27620987Smatt #define VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
90*27620987Smatt 
91*27620987Smatt #define VM_NFREELIST		1
92*27620987Smatt #define	VM_FREELIST_DEFAULT	0
93*27620987Smatt 
94*27620987Smatt #endif /* _OR1K_VMPARAM_H_ */
95