Fri Aug 26 09:10:41 2011 UTC ()
Add checks for architectures that need a check for VM_MIN_ADDRESS


(reinoud)
diff -r1.10 -r1.11 src/sys/arch/acorn26/include/vmparam.h
diff -r1.8 -r1.9 src/sys/arch/usermode/include/vmparam.h

cvs diff -r1.10 -r1.11 src/sys/arch/acorn26/include/Attic/vmparam.h (switch to unified diff)

--- src/sys/arch/acorn26/include/Attic/vmparam.h 2010/11/06 15:42:43 1.10
+++ src/sys/arch/acorn26/include/Attic/vmparam.h 2011/08/26 09:10:41 1.11
@@ -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 */

cvs diff -r1.8 -r1.9 src/sys/arch/usermode/include/vmparam.h (switch to unified diff)

--- src/sys/arch/usermode/include/vmparam.h 2011/08/24 12:54:47 1.8
+++ src/sys/arch/usermode/include/vmparam.h 2011/08/26 09:10:41 1.9
@@ -1,74 +1,76 @@ @@ -1,74 +1,76 @@
1/* $NetBSD: vmparam.h,v 1.8 2011/08/24 12:54:47 reinoud Exp $ */ 1/* $NetBSD: vmparam.h,v 1.9 2011/08/26 09:10:41 reinoud Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca>
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 * 15 *
16 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 16 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#ifndef _ARCH_USERMODE_INCLUDE_VMPARAM_H 29#ifndef _ARCH_USERMODE_INCLUDE_VMPARAM_H
30#define _ARCH_USERMODE_INCLUDE_VMPARAM_H 30#define _ARCH_USERMODE_INCLUDE_VMPARAM_H
31 31
32#include <machine/pmap.h> 32#include <machine/pmap.h>
33#include "opt_memsize.h" 33#include "opt_memsize.h"
34 34
35extern paddr_t kmem_k_start, kmem_k_end; 35extern paddr_t kmem_k_start, kmem_k_end;
36extern paddr_t kmem_ext_start, kmem_ext_end; 36extern paddr_t kmem_ext_start, kmem_ext_end;
37extern paddr_t kmem_user_start, kmem_user_end; 37extern paddr_t kmem_user_start, kmem_user_end;
38 38
39#define VM_MIN_KERNEL_ADDRESS kmem_k_start 39#define VM_MIN_KERNEL_ADDRESS kmem_k_start
40#define VM_MAX_KERNEL_ADDRESS kmem_k_end 40#define VM_MAX_KERNEL_ADDRESS kmem_k_end
41#define VM_MIN_ADDRESS kmem_user_start 41#define VM_MIN_ADDRESS kmem_user_start
42#define VM_MAXUSER_ADDRESS kmem_user_end 42#define VM_MAXUSER_ADDRESS kmem_user_end
43#define VM_MAX_ADDRESS kmem_ext_end 43#define VM_MAX_ADDRESS kmem_ext_end
44 44
 45#define VM_CHECK_MIN_ADDRESS
 46
45#define VM_PHYSSEG_STRAT VM_PSTRAT_BIGFIRST 47#define VM_PHYSSEG_STRAT VM_PSTRAT_BIGFIRST
46#define VM_PHYSSEG_MAX 1 48#define VM_PHYSSEG_MAX 1
47#define VM_NFREELIST 1 49#define VM_NFREELIST 1
48#define VM_FREELIST_DEFAULT 0 50#define VM_FREELIST_DEFAULT 0
49 51
50#define USRSTACK VM_MAXUSER_ADDRESS 52#define USRSTACK VM_MAXUSER_ADDRESS
51 53
52#if defined(__i386__)  54#if defined(__i386__)
53#define PAGE_SHIFT 12 55#define PAGE_SHIFT 12
54#define PAGE_SIZE (1 << PAGE_SHIFT) 56#define PAGE_SIZE (1 << PAGE_SHIFT)
55#define PAGE_MASK (PAGE_SIZE - 1) 57#define PAGE_MASK (PAGE_SIZE - 1)
56#define MAXSSIZ (64 * 1024 * 1024) 58#define MAXSSIZ (64 * 1024 * 1024)
57#define MAXTSIZ (64 * 1024 * 1024) 59#define MAXTSIZ (64 * 1024 * 1024)
58#define MAXDSIZ (3U * 1024 * 1024 * 1024) 60#define MAXDSIZ (3U * 1024 * 1024 * 1024)
59#define DFLSSIZ (2 * 1024 * 1024) 61#define DFLSSIZ (2 * 1024 * 1024)
60#define DFLDSIZ (256 * 1024 * 1024) 62#define DFLDSIZ (256 * 1024 * 1024)
61#elif defined(__x86_64__) 63#elif defined(__x86_64__)
62#define PAGE_SHIFT 12 64#define PAGE_SHIFT 12
63#define PAGE_SIZE (1 << PAGE_SHIFT) 65#define PAGE_SIZE (1 << PAGE_SHIFT)
64#define PAGE_MASK (PAGE_SIZE - 1) 66#define PAGE_MASK (PAGE_SIZE - 1)
65#define MAXSSIZ (128 * 1024 * 1024) 67#define MAXSSIZ (128 * 1024 * 1024)
66#define MAXTSIZ (64 * 1024 * 1024) 68#define MAXTSIZ (64 * 1024 * 1024)
67#define MAXDSIZ (8L * 1024 * 1024 * 1024) 69#define MAXDSIZ (8L * 1024 * 1024 * 1024)
68#define DFLSSIZ (4 * 1024 * 1024) 70#define DFLSSIZ (4 * 1024 * 1024)
69#define DFLDSIZ (256 * 1024 * 1024) 71#define DFLDSIZ (256 * 1024 * 1024)
70#else 72#else
71#error "platform not supported" 73#error "platform not supported"
72#endif 74#endif
73 75
74#endif /* !_ARCH_USERMODE_INCLUDE_VMPARAM_H */ 76#endif /* !_ARCH_USERMODE_INCLUDE_VMPARAM_H */