| @@ -1,109 +1,111 @@ | | | @@ -1,109 +1,111 @@ |
1 | /* $NetBSD: vmparam.h,v 1.10 2010/11/06 15:42:43 uebayasi Exp $ */ | | 1 | /* $NetBSD: vmparam.h,v 1.11 2011/08/26 09:10:41 reinoud Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1988 The Regents of the University of California. | | 4 | * Copyright (c) 1988 The Regents of the University of California. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
15 | * 3. Neither the name of the University nor the names of its contributors | | 15 | * 3. Neither the name of the University nor the names of its contributors |
16 | * may be used to endorse or promote products derived from this software | | 16 | * may be used to endorse or promote products derived from this software |
17 | * without specific prior written permission. | | 17 | * without specific prior written permission. |
18 | * | | 18 | * |
19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | | 19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
29 | * SUCH DAMAGE. | | 29 | * SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #ifndef _ARM26_VMPARAM_H_ | | 32 | #ifndef _ARM26_VMPARAM_H_ |
33 | #define _ARM26_VMPARAM_H_ | | 33 | #define _ARM26_VMPARAM_H_ |
34 | | | 34 | |
35 | #define __USE_TOPDOWN_VM | | 35 | #define __USE_TOPDOWN_VM |
36 | | | 36 | |
37 | /* | | 37 | /* |
38 | * Page size on the 26-bit ARM CPUs is not variable in the traditional | | 38 | * Page size on the 26-bit ARM CPUs is not variable in the traditional |
39 | * sense. We override the PAGE_* definitions to compile-time constants. | | 39 | * sense. We override the PAGE_* definitions to compile-time constants. |
40 | */ | | 40 | */ |
41 | #define PAGE_SHIFT 15 | | 41 | #define PAGE_SHIFT 15 |
42 | #define PAGE_SIZE (1 << PAGE_SHIFT) | | 42 | #define PAGE_SIZE (1 << PAGE_SHIFT) |
43 | #define PAGE_MASK (PAGE_SIZE - 1) | | 43 | #define PAGE_MASK (PAGE_SIZE - 1) |
44 | | | 44 | |
45 | #define USRSTACK VM_MAXUSER_ADDRESS | | 45 | #define USRSTACK VM_MAXUSER_ADDRESS |
46 | | | 46 | |
47 | #define MAXTSIZ (0x007f8000) /* max text size */ | | 47 | #define MAXTSIZ (0x007f8000) /* max text size */ |
48 | #ifndef DFLDSIZ | | 48 | #ifndef DFLDSIZ |
49 | #define DFLDSIZ (0x01800000) /* initial data size limit */ | | 49 | #define DFLDSIZ (0x01800000) /* initial data size limit */ |
50 | #endif | | 50 | #endif |
51 | #ifndef MAXDSIZ | | 51 | #ifndef MAXDSIZ |
52 | #define MAXDSIZ (0x01800000) /* max data size */ | | 52 | #define MAXDSIZ (0x01800000) /* max data size */ |
53 | #endif | | 53 | #endif |
54 | #ifndef DFLSSIZ | | 54 | #ifndef DFLSSIZ |
55 | #define DFLSSIZ (512*1024) /* initial stack size limit */ | | 55 | #define DFLSSIZ (512*1024) /* initial stack size limit */ |
56 | #endif | | 56 | #endif |
57 | #ifndef MAXSSIZ | | 57 | #ifndef MAXSSIZ |
58 | #define MAXSSIZ (0x00200000) /* max stack size */ | | 58 | #define MAXSSIZ (0x00200000) /* max stack size */ |
59 | #endif | | 59 | #endif |
60 | | | 60 | |
61 | /* | | 61 | /* |
62 | * Override the default pager_map size, there's not enough KVA. | | 62 | * Override the default pager_map size, there's not enough KVA. |
63 | */ | | 63 | */ |
64 | #define PAGER_MAP_DEFAULT_SIZE (1 * 1024 * 1024) | | 64 | #define PAGER_MAP_DEFAULT_SIZE (1 * 1024 * 1024) |
65 | | | 65 | |
66 | /* | | 66 | /* |
67 | * Mach derived constants | | 67 | * Mach derived constants |
68 | */ | | 68 | */ |
69 | | | 69 | |
70 | /* Need to link some of these with some in param.h */ | | 70 | /* Need to link some of these with some in param.h */ |
71 | | | 71 | |
72 | /* | | 72 | /* |
73 | * These specify the range of virtual pages available to user | | 73 | * These specify the range of virtual pages available to user |
74 | * processes and to the kernel. This is a bit of a delicate balancing | | 74 | * processes and to the kernel. This is a bit of a delicate balancing |
75 | * act, as we've only got 32Mb between them. There should probably be | | 75 | * act, as we've only got 32Mb between them. There should probably be |
76 | * an option to have separate kernel and user spaces to ease this. | | 76 | * an option to have separate kernel and user spaces to ease this. |
77 | */ | | 77 | */ |
78 | | | 78 | |
79 | #define KVM_SIZE 0x00800000 /* 8Mb */ | | 79 | #define KVM_SIZE 0x00800000 /* 8Mb */ |
80 | | | 80 | |
81 | /* User VM range */ | | 81 | /* User VM range */ |
82 | #define VM_MIN_ADDRESS ((vm_offset_t)0x00008000) | | 82 | #define VM_MIN_ADDRESS ((vm_offset_t)0x00008000) |
83 | #define VM_MAX_ADDRESS ((vm_offset_t)0x02000000 - KVM_SIZE) | | 83 | #define VM_MAX_ADDRESS ((vm_offset_t)0x02000000 - KVM_SIZE) |
84 | #define VM_MAXUSER_ADDRESS VM_MAX_ADDRESS | | 84 | #define VM_MAXUSER_ADDRESS VM_MAX_ADDRESS |
85 | | | 85 | |
| | | 86 | #define VM_CHECK_MIN_ADDRESS |
| | | 87 | |
86 | /* Kernel VM range */ | | 88 | /* Kernel VM range */ |
87 | #define VM_MIN_KERNEL_ADDRESS VM_MAX_ADDRESS | | 89 | #define VM_MIN_KERNEL_ADDRESS VM_MAX_ADDRESS |
88 | #define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0x02000000) | | 90 | #define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0x02000000) |
89 | #define VM_MAXKERN_ADDRESS VM_MAX_KERNEL_ADDRESS | | 91 | #define VM_MAXKERN_ADDRESS VM_MAX_KERNEL_ADDRESS |
90 | | | 92 | |
91 | /* XXX max. amount of KVM to be used by buffers. */ | | 93 | /* XXX max. amount of KVM to be used by buffers. */ |
92 | #ifndef VM_MAX_KERNEL_BUF | | 94 | #ifndef VM_MAX_KERNEL_BUF |
93 | #define VM_MAX_KERNEL_BUF \ | | 95 | #define VM_MAX_KERNEL_BUF \ |
94 | ((VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 4) | | 96 | ((VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 4) |
95 | #endif | | 97 | #endif |
96 | | | 98 | |
97 | /* Physical memory parameters */ | | 99 | /* Physical memory parameters */ |
98 | | | 100 | |
99 | #define VM_PHYSSEG_MAX 3 | | 101 | #define VM_PHYSSEG_MAX 3 |
100 | | | 102 | |
101 | #define VM_PHYSSEG_STRAT VM_PSTRAT_BIGFIRST | | 103 | #define VM_PHYSSEG_STRAT VM_PSTRAT_BIGFIRST |
102 | | | 104 | |
103 | #define VM_NFREELIST 2 | | 105 | #define VM_NFREELIST 2 |
104 | #define VM_FREELIST_LOW 1 /* DMA-able memory (bottom 512k phys) */ | | 106 | #define VM_FREELIST_LOW 1 /* DMA-able memory (bottom 512k phys) */ |
105 | #define VM_FREELIST_DEFAULT 0 /* The rest */ | | 107 | #define VM_FREELIST_DEFAULT 0 /* The rest */ |
106 | | | 108 | |
107 | #endif /* _ARM26_VMPARAM_H_ */ | | 109 | #endif /* _ARM26_VMPARAM_H_ */ |
108 | | | 110 | |
109 | /* End of vmparam.h */ | | 111 | /* End of vmparam.h */ |