11.26Stsutsui/*	$NetBSD: vmparam.h,v 1.26 2025/02/08 23:44:53 tsutsui Exp $	*/
21.1Snisimura
31.1Snisimura/*
41.18Srmind * Copyright (c) 1988 University of Utah.
51.1Snisimura * Copyright (c) 1982, 1986, 1990, 1993
61.1Snisimura *	The Regents of the University of California.  All rights reserved.
71.9Sagc *
81.9Sagc * This code is derived from software contributed to Berkeley by
91.9Sagc * the Systems Programming Group of the University of Utah Computer
101.9Sagc * Science Department.
111.9Sagc *
121.9Sagc * Redistribution and use in source and binary forms, with or without
131.9Sagc * modification, are permitted provided that the following conditions
141.9Sagc * are met:
151.9Sagc * 1. Redistributions of source code must retain the above copyright
161.9Sagc *    notice, this list of conditions and the following disclaimer.
171.9Sagc * 2. Redistributions in binary form must reproduce the above copyright
181.9Sagc *    notice, this list of conditions and the following disclaimer in the
191.9Sagc *    documentation and/or other materials provided with the distribution.
201.9Sagc * 3. Neither the name of the University nor the names of its contributors
211.9Sagc *    may be used to endorse or promote products derived from this software
221.9Sagc *    without specific prior written permission.
231.9Sagc *
241.9Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
251.9Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
261.9Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
271.9Sagc * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
281.9Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
291.9Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
301.9Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
311.9Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
321.9Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
331.9Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
341.9Sagc * SUCH DAMAGE.
351.9Sagc *
361.9Sagc * from: Utah $Hdr: vmparam.h 1.16 91/01/18$
371.9Sagc *
381.9Sagc *	@(#)vmparam.h	8.2 (Berkeley) 4/19/94
391.9Sagc */
401.1Snisimura
411.1Snisimura#ifndef _MACHINE_VMPARAM_H_
421.1Snisimura#define _MACHINE_VMPARAM_H_
431.7Sthorpej
441.7Sthorpej/*
451.23Stsutsui * Use common m68k definitions to define PAGE_SIZE and related constants.
461.23Stsutsui */
471.23Stsutsui#include <m68k/vmparam.h>
481.1Snisimura
491.1Snisimura/*
501.6Sthorpej * USRSTACK is the top (end) of the user stack.
511.1Snisimura */
521.1Snisimura#define USRSTACK	VM_MAXUSER_ADDRESS
531.1Snisimura
541.1Snisimura/*
551.1Snisimura * Virtual memory related constants, all in bytes
561.1Snisimura */
571.1Snisimura#ifndef MAXTSIZ
581.21Srin#define MAXTSIZ		(32*1024*1024)		/* max text size */
591.1Snisimura#endif
601.1Snisimura#ifndef DFLDSIZ
611.1Snisimura#define DFLDSIZ		(16*1024*1024)		/* initial data size limit */
621.1Snisimura#endif
631.1Snisimura#ifndef MAXDSIZ
641.1Snisimura#define MAXDSIZ		(64*1024*1024)		/* max data size */
651.1Snisimura#endif
661.1Snisimura#ifndef	DFLSSIZ
671.26Stsutsui#define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */
681.1Snisimura#endif
691.1Snisimura#ifndef	MAXSSIZ
701.1Snisimura#define MAXSSIZ		MAXDSIZ			/* max stack size */
711.1Snisimura#endif
721.1Snisimura
731.1Snisimura/*
741.1Snisimura * PTEs for mapping user space into the kernel for phyio operations.
751.1Snisimura * One page is enough to handle 4Mb of simultaneous raw IO operations.
761.1Snisimura */
771.1Snisimura#ifndef USRIOSIZE
781.1Snisimura#define USRIOSIZE	(1 * NPTEPG)	/* 4mb */
791.1Snisimura#endif
801.1Snisimura
811.24Stsutsui/*
821.24Stsutsui * Mach derived constants
831.1Snisimura */
841.1Snisimura
851.1Snisimura/* user/kernel map constants */
861.1Snisimura#define VM_MIN_ADDRESS		((vaddr_t)0)
871.19Stsutsui#define VM_MAXUSER_ADDRESS	((vaddr_t)0xFFF00000)
881.19Stsutsui#define VM_MAX_ADDRESS		((vaddr_t)0xFFF00000)
891.1Snisimura#define VM_MIN_KERNEL_ADDRESS	((vaddr_t)0)
901.10Syamt#define VM_MAX_KERNEL_ADDRESS	((vaddr_t)(0x40000000-PAGE_SIZE*NPTEPG))
911.1Snisimura
921.1Snisimura/* virtual sizes (bytes) for various kernel submaps */
931.8Sthorpej#define VM_PHYS_SIZE		(USRIOSIZE*PAGE_SIZE)
941.1Snisimura
951.1Snisimura/* # of kernel PT pages (initial only, can grow dynamically) */
961.20Srin#define VM_KERNEL_PT_PAGES	((vsize_t)2)
971.1Snisimura
981.1Snisimura/*
991.1Snisimura * Constants which control the way the VM system deals with memory segments.
1001.25Sandvar * Only one physical contiguous memory segment.
1011.1Snisimura */
1021.1Snisimura#define VM_PHYSSEG_MAX		1
1031.1Snisimura#define VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
1041.1Snisimura
1051.1Snisimura#define VM_NFREELIST		1
1061.1Snisimura#define VM_FREELIST_DEFAULT	0
1071.3Sthorpej
1081.4Sthorpej#define	__HAVE_PMAP_PHYSSEG
1091.1Snisimura
1101.1Snisimura/*
1111.1Snisimura * pmap-specific data stored in the vm_physmem[] array.
1121.1Snisimura */
1131.1Snisimurastruct pmap_physseg {
1141.13Sthorpej	struct pv_header *pvheader;	/* pv table for this seg */
1151.1Snisimura};
1161.1Snisimura
1171.1Snisimura#endif /* _MACHINE_VMPARAM_H_ */
118