1 /* $NetBSD: vmparam.h,v 1.40 2015/10/18 00:28:32 jmcneill Exp $ */ 2 3 /* 4 * Copyright (c) 2001, 2002 Wasabi Systems, Inc. 5 * All rights reserved. 6 * 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 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 * 3. All advertising materials mentioning features or use of this software 18 * must display the following acknowledgement: 19 * This product includes software developed for the NetBSD Project by 20 * Wasabi Systems, Inc. 21 * 4. The name of Wasabi Systems, Inc. may not be used to endorse 22 * or promote products derived from this software without specific prior 23 * written permission. 24 * 25 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND 26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 27 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC 29 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 * POSSIBILITY OF SUCH DAMAGE. 36 */ 37 38 #ifndef _ARM_ARM32_VMPARAM_H_ 39 #define _ARM_ARM32_VMPARAM_H_ 40 41 #if defined(_KERNEL) || defined(_KMEMUSER) 42 43 /* 44 * Virtual Memory parameters common to all arm32 platforms. 45 */ 46 47 #include <arm/cpuconf.h> 48 #include <arm/arm32/param.h> 49 #include <arm/arm32/pte.h> /* pt_entry_t */ 50 51 #define __USE_TOPDOWN_VM 52 #define USRSTACK VM_MAXUSER_ADDRESS 53 54 /* 55 * ARMv4 systems are normaly configured for 256MB KVA only, so restrict 56 * the size of the pager map to 4MB. 57 */ 58 #ifndef _ARM_ARCH_5 59 #define PAGER_MAP_DEFAULT_SIZE (4 * 1024 * 1024) 60 #endif 61 62 /* 63 * Note that MAXTSIZ can't be larger than 32M, otherwise the compiler 64 * would have to be changed to not generate "bl" instructions. 65 */ 66 #define MAXTSIZ (128*1024*1024) /* max text size */ 67 #ifndef DFLDSIZ 68 #define DFLDSIZ (384*1024*1024) /* initial data size limit */ 69 #endif 70 #ifndef MAXDSIZ 71 #define MAXDSIZ (1536*1024*1024) /* max data size */ 72 #endif 73 #ifndef DFLSSIZ 74 #define DFLSSIZ (4*1024*1024) /* initial stack size limit */ 75 #endif 76 #ifndef MAXSSIZ 77 #define MAXSSIZ (64*1024*1024) /* max stack size */ 78 #endif 79 80 /* 81 * While the ARM architecture defines Section mappings, large pages, 82 * and small pages, the standard page size is (and will always be) 4K. 83 */ 84 #define PAGE_SHIFT PGSHIFT 85 #define PAGE_SIZE (1 << PAGE_SHIFT) 86 #define PAGE_MASK (PAGE_SIZE - 1) 87 88 /* 89 * Mach derived constants 90 */ 91 #define VM_MIN_ADDRESS ((vaddr_t) PAGE_SIZE) 92 #ifdef ARM_MMU_EXTENDED 93 #define VM_MAXUSER_ADDRESS ((vaddr_t) 0x80000000 - PAGE_SIZE) 94 #else 95 #define VM_MAXUSER_ADDRESS ((vaddr_t) KERNEL_BASE - PAGE_SIZE) 96 #endif 97 #define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS 98 99 #define VM_MIN_KERNEL_ADDRESS ((vaddr_t) KERNEL_BASE) 100 #define VM_MAX_KERNEL_ADDRESS ((vaddr_t) -(PAGE_SIZE+1)) 101 102 #ifndef __ASSEMBLER__ 103 /* XXX max. amount of KVM to be used by buffers. */ 104 #ifndef VM_MAX_KERNEL_BUF 105 extern vaddr_t virtual_avail; 106 extern vaddr_t virtual_end; 107 108 #define VM_MAX_KERNEL_BUF \ 109 ((virtual_end - virtual_avail) * 4 / 10) 110 #endif 111 #endif /* __ASSEMBLER__ */ 112 113 #endif /* _KERNEL || _KMEMUSER */ 114 115 #endif /* _ARM_ARM32_VMPARAM_H_ */ 116