11.48Schristos/* $NetBSD: vmparam.h,v 1.48 2019/03/29 20:18:09 christos Exp $ */ 21.5Sderaadt 31.1Sderaadt/* 41.1Sderaadt * Copyright (c) 1992, 1993 51.1Sderaadt * The Regents of the University of California. All rights reserved. 61.1Sderaadt * 71.1Sderaadt * This software was developed by the Computer Systems Engineering group 81.1Sderaadt * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 91.1Sderaadt * contributed to Berkeley. 101.1Sderaadt * 111.1Sderaadt * All advertising materials mentioning features or use of this software 121.1Sderaadt * must display the following acknowledgement: 131.1Sderaadt * This product includes software developed by the University of 141.1Sderaadt * California, Lawrence Berkeley Laboratory. 151.1Sderaadt * 161.1Sderaadt * Redistribution and use in source and binary forms, with or without 171.1Sderaadt * modification, are permitted provided that the following conditions 181.1Sderaadt * are met: 191.1Sderaadt * 1. Redistributions of source code must retain the above copyright 201.1Sderaadt * notice, this list of conditions and the following disclaimer. 211.1Sderaadt * 2. Redistributions in binary form must reproduce the above copyright 221.1Sderaadt * notice, this list of conditions and the following disclaimer in the 231.1Sderaadt * documentation and/or other materials provided with the distribution. 241.35Sagc * 3. Neither the name of the University nor the names of its contributors 251.1Sderaadt * may be used to endorse or promote products derived from this software 261.1Sderaadt * without specific prior written permission. 271.1Sderaadt * 281.1Sderaadt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 291.1Sderaadt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 301.1Sderaadt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 311.1Sderaadt * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 321.1Sderaadt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 331.1Sderaadt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 341.1Sderaadt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 351.1Sderaadt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 361.1Sderaadt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 371.1Sderaadt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 381.1Sderaadt * SUCH DAMAGE. 391.1Sderaadt * 401.1Sderaadt * @(#)vmparam.h 8.1 (Berkeley) 6/11/93 411.1Sderaadt */ 421.1Sderaadt 431.26Spk#ifndef _SPARC_VMPARAM_H_ 441.26Spk#define _SPARC_VMPARAM_H_ 451.26Spk 461.43Schs#define __USE_TOPDOWN_VM 471.43Schs 481.1Sderaadt/* 491.34Sthorpej * Machine dependent constants for SPARC 501.1Sderaadt */ 511.1Sderaadt 521.34Sthorpej#include <machine/cpuconf.h> 531.34Sthorpej 541.34Sthorpej/* 551.34Sthorpej * Sun4 systems have a 8K page size. All other platforms have a 561.34Sthorpej * 4K page size. We need to define these upper and lower limits 571.34Sthorpej * for machine-independent code. We also try to make PAGE_SIZE, 581.34Sthorpej * PAGE_SHIFT, and PAGE_MASK into compile-time constants, if we can. 591.34Sthorpej * 601.34Sthorpej * XXX Should garbage-collect the version of this from <machine/param.h>. 611.34Sthorpej */ 621.34Sthorpej#define PAGE_SHIFT_SUN4 13 631.34Sthorpej#define PAGE_SHIFT_SUN4CM 12 641.34Sthorpej 651.44Schristos#define MAX_PAGE_SHIFT PAGE_SHIFT_SUN4 661.44Schristos#define MIN_PAGE_SHIFT PAGE_SHIFT_SUN4CM 671.44Schristos 681.44Schristos#define MIN_PAGE_SIZE (1 << MIN_PAGE_SHIFT) 691.44Schristos#define MAX_PAGE_SIZE (1 << MAX_PAGE_SHIFT) 701.34Sthorpej 711.34Sthorpej#if CPU_NTYPES != 0 && !defined(SUN4) 721.34Sthorpej#define PAGE_SHIFT PAGE_SHIFT_SUN4CM 731.34Sthorpej#elif CPU_NTYPES == 1 && defined(SUN4) 741.34Sthorpej#define PAGE_SHIFT PAGE_SHIFT_SUN4 751.44Schristos#endif 761.44Schristos 771.48Schristos#ifdef PAGE_SHIFT 781.34Sthorpej#define PAGE_SIZE (1 << PAGE_SHIFT) 791.34Sthorpej#define PAGE_MASK (PAGE_SIZE - 1) 801.47Schristos#endif 811.26Spk 821.1Sderaadt/* 831.32Sthorpej * USRSTACK is the top (end) of the user stack. 841.1Sderaadt */ 851.1Sderaadt#define USRSTACK KERNBASE /* Start of user stack */ 861.1Sderaadt 871.1Sderaadt/* 881.1Sderaadt * Virtual memory related constants, all in bytes 891.1Sderaadt */ 901.1Sderaadt#ifndef MAXTSIZ 911.11Spk#define MAXTSIZ (64*1024*1024) /* max text size */ 921.1Sderaadt#endif 931.1Sderaadt#ifndef DFLDSIZ 941.11Spk#define DFLDSIZ (64*1024*1024) /* initial data size limit */ 951.1Sderaadt#endif 961.1Sderaadt#ifndef MAXDSIZ 971.36Spk#define MAXDSIZ (512*1024*1024) /* max data size */ 981.1Sderaadt#endif 991.1Sderaadt#ifndef DFLSSIZ 1001.36Spk#define DFLSSIZ (8*1024*1024) /* initial stack size limit */ 1011.1Sderaadt#endif 1021.1Sderaadt#ifndef MAXSSIZ 1031.38Schs#define MAXSSIZ (32*1024*1024) /* max stack size */ 1041.1Sderaadt#endif 1051.3Sderaadt 1061.3Sderaadt/* 1071.1Sderaadt * Mach derived constants 1081.1Sderaadt */ 1091.1Sderaadt 1101.1Sderaadt/* 1111.1Sderaadt * User/kernel map constants. Note that sparc/vaddrs.h defines the 1121.1Sderaadt * IO space virtual base, which must be the same as VM_MAX_KERNEL_ADDRESS: 1131.1Sderaadt * tread with care. 1141.1Sderaadt */ 1151.17Spk#define VM_MIN_ADDRESS ((vaddr_t)0) 1161.17Spk#define VM_MAX_ADDRESS ((vaddr_t)KERNBASE) 1171.17Spk#define VM_MAXUSER_ADDRESS ((vaddr_t)KERNBASE) 1181.17Spk#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)KERNBASE) 1191.23Scjs#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)KERNEND) 1201.19Smrg 1211.19Smrg#define VM_PHYSSEG_MAX 32 /* up to 32 segments */ 1221.19Smrg#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH 1231.16Sthorpej 1241.16Sthorpej#define VM_NFREELIST 1 1251.16Sthorpej#define VM_FREELIST_DEFAULT 0 1261.27Sthorpej 1271.26Spk#endif /* _SPARC_VMPARAM_H_ */ 128