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