1 /* $NetBSD: vmparam.h,v 1.5 2002/02/06 17:41:44 thorpej Exp $ */ 2 3 /* 4 * Copyright (c) 2001 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 #ifdef _KERNEL 42 43 /* 44 * Virtual Memory parameters common to all arm32 platforms. 45 */ 46 47 /* for pt_entry_t definition */ 48 #include <arm/arm32/pte.h> 49 50 #define USRTEXT VM_MIN_ADDRESS 51 #define USRSTACK VM_MAXUSER_ADDRESS 52 53 /* 54 * Note that MAXTSIZ can't be larger than 32M, otherwise the compiler 55 * would have to be changed to not generate "bl" instructions. 56 */ 57 #define MAXTSIZ (16*1024*1024) /* max text size */ 58 #ifndef DFLDSIZ 59 #define DFLDSIZ (128*1024*1024) /* initial data size limit */ 60 #endif 61 #ifndef MAXDSIZ 62 #define MAXDSIZ (512*1024*1024) /* max data size */ 63 #endif 64 #ifndef DFLSSIZ 65 #define DFLSSIZ (2*1024*1024) /* initial stack size limit */ 66 #endif 67 #ifndef MAXSSIZ 68 #define MAXSSIZ (8*1024*1024) /* max stack size */ 69 #endif 70 71 /* 72 * Size of SysV shared memory map 73 */ 74 #ifndef SHMMAXPGS 75 #define SHMMAXPGS 1024 76 #endif 77 78 /* 79 * While the ARM architecture defines Section mappings, large pages, 80 * and small pages, the standard page size is (and will always be) 4K. 81 */ 82 #define PAGE_SHIFT 12 83 #define PAGE_SIZE (1 << PAGE_SHIFT) 84 #define PAGE_MASK (PAGE_SIZE - 1) 85 86 /* 87 * Linear page table space: number of PTEs required to map the 4G address 88 * space * size of each PTE. 89 */ 90 #define PAGE_TABLE_SPACE ((1 << (32 - PGSHIFT)) * sizeof(pt_entry_t)) 91 92 /* Address where the page talbles are mapped. */ 93 #define PAGE_TABLE_SPACE_START (KERNEL_SPACE_START - PAGE_TABLE_SPACE) 94 95 /* 96 * Mach derived constants 97 */ 98 #define VM_MIN_ADDRESS ((vaddr_t) 0x00001000) 99 #define VM_MAXUSER_ADDRESS ((vaddr_t) (PAGE_TABLE_SPACE_START - \ 100 UPAGES * NBPG)) 101 #define VM_MAX_ADDRESS ((vaddr_t) (PAGE_TABLE_SPACE_START + \ 102 (KERNEL_SPACE_START >> PGSHIFT) * \ 103 sizeof(pt_entry_t))) 104 #define VM_MIN_KERNEL_ADDRESS ((vaddr_t) KERNEL_TEXT_BASE) 105 #define VM_MAXKERN_ADDRESS ((vaddr_t) KERNEL_VM_BASE + KERNEL_VM_SIZE) 106 #define VM_MAX_KERNEL_ADDRESS ((vaddr_t) 0xffffffff) 107 108 /* 109 * define structure pmap_physseg: there is one of these structures 110 * for each chunk of noncontig RAM you have. 111 */ 112 113 #define __HAVE_PMAP_PHYSSEG 114 115 struct pmap_physseg { 116 struct pv_head *pvhead; /* pv_entry array */ 117 char *attrs; /* attrs array */ 118 }; 119 120 #endif /* _KERNEL */ 121 122 #endif /* _ARM_ARM32_VMPARAM_H_ */ 123