1*6cb10275Sriastradh /* $NetBSD: vmparam.h,v 1.2 2014/03/18 18:20:41 riastradh Exp $ */ 2c9855651Smatt /*- 3c9855651Smatt * Copyright (c) 2013 The NetBSD Foundation, Inc. 4c9855651Smatt * All rights reserved. 5c9855651Smatt * 6c9855651Smatt * This code is derived from software contributed to The NetBSD Foundation 7c9855651Smatt * by Matt Thomas of 3am Software Foundry. 8c9855651Smatt * 9c9855651Smatt * Redistribution and use in source and binary forms, with or without 10c9855651Smatt * modification, are permitted provided that the following conditions 11c9855651Smatt * are met: 12c9855651Smatt * 1. Redistributions of source code must retain the above copyright 13c9855651Smatt * notice, this list of conditions and the following disclaimer. 14c9855651Smatt * 2. Redistributions in binary form must reproduce the above copyright 15c9855651Smatt * notice, this list of conditions and the following disclaimer in the 16c9855651Smatt * documentation and/or other materials provided with the distribution. 17c9855651Smatt * 18c9855651Smatt * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19c9855651Smatt * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20c9855651Smatt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21c9855651Smatt * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22c9855651Smatt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23c9855651Smatt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24c9855651Smatt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25c9855651Smatt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26c9855651Smatt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27c9855651Smatt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28c9855651Smatt * POSSIBILITY OF SUCH DAMAGE. 29c9855651Smatt */ 30c9855651Smatt 31c9855651Smatt #ifndef _EVBCF_VMPARAM_H_ 32c9855651Smatt #define _EVBCF_VMPARAM_H_ 33c9855651Smatt 34c9855651Smatt /* 35c9855651Smatt * Machine dependent VM constants for EVBCF (Coldfire) 36c9855651Smatt */ 37c9855651Smatt 38c9855651Smatt /* 39c9855651Smatt * We use 4K pages on coldfire. Override the PAGE_* definitions 40c9855651Smatt * to be compile-time constants. 41c9855651Smatt */ 42c9855651Smatt #define PAGE_SHIFT PGSHIFT 43c9855651Smatt #define PAGE_SIZE (1 << PAGE_SHIFT) 44c9855651Smatt #define PAGE_MASK (PAGE_SIZE - 1) 45c9855651Smatt 46c9855651Smatt /* 47c9855651Smatt * USRSTACK is the top (end) of the user stack. 48c9855651Smatt */ 49c9855651Smatt #define USRSTACK VM_MAXUSER_ADDRESS /* Start of user stack */ 50c9855651Smatt 51c9855651Smatt /* 52c9855651Smatt * Virtual memory related constants, all in bytes 53c9855651Smatt */ 54c9855651Smatt #ifndef MAXTSIZ 55c9855651Smatt #define MAXTSIZ (16*1024*1024) /* max text size */ 56c9855651Smatt #endif 57c9855651Smatt #ifndef DFLDSIZ 58c9855651Smatt #define DFLDSIZ (64*1024*1024) /* initial data size limit */ 59c9855651Smatt #endif 60c9855651Smatt #ifndef MAXDSIZ 61c9855651Smatt #define MAXDSIZ (128*1024*1024) /* max data size */ 62c9855651Smatt #endif 63c9855651Smatt #ifndef DFLSSIZ 64c9855651Smatt #define DFLSSIZ (512*1024) /* initial stack size limit */ 65c9855651Smatt #endif 66c9855651Smatt #ifndef MAXSSIZ 67c9855651Smatt #define MAXSSIZ (16*1024*1024) /* max stack size */ 68c9855651Smatt #endif 69c9855651Smatt 70c9855651Smatt /* 71c9855651Smatt * PTEs for mapping user space into the kernel for phyio operations. 72c9855651Smatt * One page is enough to handle 4MB of simultaneous raw IO operations. 73c9855651Smatt */ 74c9855651Smatt #ifndef USRIOSIZE 75c9855651Smatt #define USRIOSIZE (1 * NPTEPG) /* 4MB */ 76c9855651Smatt #endif 77c9855651Smatt 78c9855651Smatt /* user/kernel map constants */ 79c9855651Smatt #define VM_MIN_ADDRESS ((vaddr_t)0) 80c9855651Smatt #define VM_MAXUSER_ADDRESS ((vaddr_t)0xBFF00000) 81c9855651Smatt #define VM_MAX_ADDRESS ((vaddr_t)0xFFF00000) 82c9855651Smatt #define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xC0000000) 83c9855651Smatt #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)-PAGE_SIZE) 84c9855651Smatt 85c9855651Smatt /* virtual sizes (bytes) for various kernel submaps */ 86c9855651Smatt #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) 87c9855651Smatt 88c9855651Smatt /* 89c9855651Smatt * Constants which control the way the VM system deals with memory segments. 90c9855651Smatt * The evbcf port has one physical memory segment. 91c9855651Smatt */ 92c9855651Smatt #define VM_PHYSSEG_MAX 1 93c9855651Smatt #define VM_PHYSSEG_STRAT VM_PSTRAT_RANDOM 94c9855651Smatt 95c9855651Smatt #define VM_NFREELIST 1 96c9855651Smatt #define VM_FREELIST_DEFAULT 0 97c9855651Smatt 98c9855651Smatt #endif /* _EVBCF_VMPARAM_H_ */ 99