vmparam.h revision 1.46
1/* $NetBSD: vmparam.h,v 1.46 2019/03/29 00:08:13 christos Exp $ */ 2 3/* 4 * Copyright (c) 1992, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This software was developed by the Computer Systems Engineering group 8 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 9 * contributed to Berkeley. 10 * 11 * All advertising materials mentioning features or use of this software 12 * must display the following acknowledgement: 13 * This product includes software developed by the University of 14 * California, Lawrence Berkeley Laboratory. 15 * 16 * Redistribution and use in source and binary forms, with or without 17 * modification, are permitted provided that the following conditions 18 * are met: 19 * 1. Redistributions of source code must retain the above copyright 20 * notice, this list of conditions and the following disclaimer. 21 * 2. Redistributions in binary form must reproduce the above copyright 22 * notice, this list of conditions and the following disclaimer in the 23 * documentation and/or other materials provided with the distribution. 24 * 3. Neither the name of the University nor the names of its contributors 25 * may be used to endorse or promote products derived from this software 26 * without specific prior written permission. 27 * 28 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 29 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 30 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 31 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 32 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 38 * SUCH DAMAGE. 39 * 40 * @(#)vmparam.h 8.1 (Berkeley) 6/11/93 41 */ 42 43#ifndef _SPARC_VMPARAM_H_ 44#define _SPARC_VMPARAM_H_ 45 46#define __USE_TOPDOWN_VM 47 48/* 49 * Machine dependent constants for SPARC 50 */ 51 52#include <machine/cpuconf.h> 53 54/* 55 * Sun4 systems have a 8K page size. All other platforms have a 56 * 4K page size. We need to define these upper and lower limits 57 * for machine-independent code. We also try to make PAGE_SIZE, 58 * PAGE_SHIFT, and PAGE_MASK into compile-time constants, if we can. 59 * 60 * XXX Should garbage-collect the version of this from <machine/param.h>. 61 */ 62#define PAGE_SHIFT_SUN4 13 63#define PAGE_SHIFT_SUN4CM 12 64 65#define MAX_PAGE_SHIFT PAGE_SHIFT_SUN4 66#define MIN_PAGE_SHIFT PAGE_SHIFT_SUN4CM 67 68#define MIN_PAGE_SIZE (1 << MIN_PAGE_SHIFT) 69#define MAX_PAGE_SIZE (1 << MAX_PAGE_SHIFT) 70 71#if CPU_NTYPES != 0 && !defined(SUN4) 72#define PAGE_SHIFT PAGE_SHIFT_SUN4CM 73#elif CPU_NTYPES == 1 && defined(SUN4) 74#define PAGE_SHIFT PAGE_SHIFT_SUN4 75#elif defined(_KERNEL) && !defined(_RUMPKERNEL) \ 76 && !defined(STANDALONE) && !defined(_MODULE) 77#error "Cannot determine page size" 78#else 79/* Default to max for userland */ 80#define PAGE_SHIFT MAX_PAGE_SHIFT 81#endif 82 83#define PAGE_SIZE (1 << PAGE_SHIFT) 84#define PAGE_MASK (PAGE_SIZE - 1) 85 86/* 87 * USRSTACK is the top (end) of the user stack. 88 */ 89#define USRSTACK KERNBASE /* Start of user stack */ 90 91/* 92 * Virtual memory related constants, all in bytes 93 */ 94#ifndef MAXTSIZ 95#define MAXTSIZ (64*1024*1024) /* max text size */ 96#endif 97#ifndef DFLDSIZ 98#define DFLDSIZ (64*1024*1024) /* initial data size limit */ 99#endif 100#ifndef MAXDSIZ 101#define MAXDSIZ (512*1024*1024) /* max data size */ 102#endif 103#ifndef DFLSSIZ 104#define DFLSSIZ (8*1024*1024) /* initial stack size limit */ 105#endif 106#ifndef MAXSSIZ 107#define MAXSSIZ (32*1024*1024) /* max stack size */ 108#endif 109 110/* 111 * Mach derived constants 112 */ 113 114/* 115 * User/kernel map constants. Note that sparc/vaddrs.h defines the 116 * IO space virtual base, which must be the same as VM_MAX_KERNEL_ADDRESS: 117 * tread with care. 118 */ 119#define VM_MIN_ADDRESS ((vaddr_t)0) 120#define VM_MAX_ADDRESS ((vaddr_t)KERNBASE) 121#define VM_MAXUSER_ADDRESS ((vaddr_t)KERNBASE) 122#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)KERNBASE) 123#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)KERNEND) 124 125#define VM_PHYSSEG_MAX 32 /* up to 32 segments */ 126#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH 127 128#define VM_NFREELIST 1 129#define VM_FREELIST_DEFAULT 0 130 131#endif /* _SPARC_VMPARAM_H_ */ 132