1 1.22 christos /* $NetBSD: vmparam.h,v 1.22 2016/09/03 09:07:53 christos Exp $ */ 2 1.1 itojun 3 1.1 itojun /*- 4 1.13 uch * Copyright (c) 2002 The NetBSD Foundation, Inc. 5 1.1 itojun * All rights reserved. 6 1.1 itojun * 7 1.13 uch * This code is derived from software contributed to The NetBSD Foundation 8 1.13 uch * by UCHIYAMA Yasushi. 9 1.1 itojun * 10 1.1 itojun * Redistribution and use in source and binary forms, with or without 11 1.1 itojun * modification, are permitted provided that the following conditions 12 1.1 itojun * are met: 13 1.1 itojun * 1. Redistributions of source code must retain the above copyright 14 1.1 itojun * notice, this list of conditions and the following disclaimer. 15 1.1 itojun * 2. Redistributions in binary form must reproduce the above copyright 16 1.1 itojun * notice, this list of conditions and the following disclaimer in the 17 1.1 itojun * documentation and/or other materials provided with the distribution. 18 1.1 itojun * 19 1.13 uch * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 1.13 uch * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 1.13 uch * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 1.13 uch * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 1.13 uch * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 1.13 uch * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 1.13 uch * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 1.13 uch * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 1.13 uch * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 1.13 uch * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 1.13 uch * POSSIBILITY OF SUCH DAMAGE. 30 1.1 itojun */ 31 1.1 itojun 32 1.11 uch #ifndef _SH3_VMPARAM_H_ 33 1.12 uch #define _SH3_VMPARAM_H_ 34 1.22 christos 35 1.13 uch #include <sys/queue.h> 36 1.15 thorpej 37 1.22 christos #define __USE_TOPDOWN_VM 38 1.22 christos 39 1.15 thorpej /* 40 1.15 thorpej * We use 4K pages on the sh3/sh4. Override the PAGE_* definitions 41 1.15 thorpej * to be compile-time constants. 42 1.15 thorpej */ 43 1.15 thorpej #define PAGE_SHIFT 12 44 1.15 thorpej #define PAGE_SIZE (1 << PAGE_SHIFT) 45 1.15 thorpej #define PAGE_MASK (PAGE_SIZE - 1) 46 1.1 itojun 47 1.13 uch /* Virtual address map. */ 48 1.13 uch #define VM_MIN_ADDRESS ((vaddr_t)0) 49 1.13 uch #define VM_MAXUSER_ADDRESS ((vaddr_t)0x7ffff000) 50 1.13 uch #define VM_MAX_ADDRESS ((vaddr_t)0x7ffff000) 51 1.13 uch #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xc0000000) 52 1.13 uch #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xe0000000) 53 1.13 uch 54 1.14 thorpej /* top of stack */ 55 1.13 uch #define USRSTACK VM_MAXUSER_ADDRESS 56 1.1 itojun 57 1.22 christos /* Virtual memory resource limit. */ 58 1.13 uch #define MAXTSIZ (64 * 1024 * 1024) /* max text size */ 59 1.13 uch #ifndef MAXDSIZ 60 1.13 uch #define MAXDSIZ (512 * 1024 * 1024) /* max data size */ 61 1.13 uch #endif 62 1.13 uch #ifndef MAXSSIZ 63 1.13 uch #define MAXSSIZ (32 * 1024 * 1024) /* max stack size */ 64 1.13 uch #endif 65 1.1 itojun 66 1.13 uch /* initial data size limit */ 67 1.1 itojun #ifndef DFLDSIZ 68 1.13 uch #define DFLDSIZ (128 * 1024 * 1024) 69 1.1 itojun #endif 70 1.13 uch /* initial stack size limit */ 71 1.1 itojun #ifndef DFLSSIZ 72 1.13 uch #define DFLSSIZ (2 * 1024 * 1024) 73 1.1 itojun #endif 74 1.1 itojun 75 1.13 uch /* Size of user raw I/O map */ 76 1.13 uch #ifndef USRIOSIZE 77 1.16 thorpej #define USRIOSIZE (MAXBSIZE / PAGE_SIZE * 8) 78 1.1 itojun #endif 79 1.1 itojun 80 1.16 thorpej #define VM_PHYS_SIZE (USRIOSIZE * PAGE_SIZE) 81 1.1 itojun 82 1.13 uch /* Physical memory segments */ 83 1.12 uch #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH 84 1.8 thorpej 85 1.17 uwe #define sh3_round_page(x) ((((uint32_t)(x)) + PGOFSET) & ~PGOFSET) 86 1.17 uwe #define sh3_trunc_page(x) ((uint32_t)(x) & ~PGOFSET) 87 1.17 uwe #define sh3_btop(x) ((uint32_t)(x) >> PGSHIFT) 88 1.17 uwe #define sh3_ptob(x) ((uint32_t)(x) << PGSHIFT) 89 1.11 uch #endif /* !_SH3_VMPARAM_H_ */ 90