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