vmparam.h revision 1.2
11.2Sriastrad/*	$NetBSD: vmparam.h,v 1.2 2014/03/18 18:20:41 riastradh Exp $	*/
21.1Smatt/*-
31.1Smatt * Copyright (c) 2013 The NetBSD Foundation, Inc.
41.1Smatt * All rights reserved.
51.1Smatt *
61.1Smatt * This code is derived from software contributed to The NetBSD Foundation
71.1Smatt * by Matt Thomas of 3am Software Foundry.
81.1Smatt *
91.1Smatt * Redistribution and use in source and binary forms, with or without
101.1Smatt * modification, are permitted provided that the following conditions
111.1Smatt * are met:
121.1Smatt * 1. Redistributions of source code must retain the above copyright
131.1Smatt *    notice, this list of conditions and the following disclaimer.
141.1Smatt * 2. Redistributions in binary form must reproduce the above copyright
151.1Smatt *    notice, this list of conditions and the following disclaimer in the
161.1Smatt *    documentation and/or other materials provided with the distribution.
171.1Smatt *
181.1Smatt * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
191.1Smatt * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
201.1Smatt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
211.1Smatt * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
221.1Smatt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
231.1Smatt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
241.1Smatt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
251.1Smatt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
261.1Smatt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
271.1Smatt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
281.1Smatt * POSSIBILITY OF SUCH DAMAGE.
291.1Smatt */
301.1Smatt
311.1Smatt#ifndef _EVBCF_VMPARAM_H_
321.1Smatt#define _EVBCF_VMPARAM_H_
331.1Smatt
341.1Smatt/*
351.1Smatt * Machine dependent VM constants for EVBCF (Coldfire)
361.1Smatt */
371.1Smatt
381.1Smatt/*
391.1Smatt * We use 4K pages on coldfire.  Override the PAGE_* definitions
401.1Smatt * to be compile-time constants.
411.1Smatt */
421.1Smatt#define	PAGE_SHIFT	PGSHIFT
431.1Smatt#define	PAGE_SIZE	(1 << PAGE_SHIFT)
441.1Smatt#define	PAGE_MASK	(PAGE_SIZE - 1)
451.1Smatt
461.1Smatt/*
471.1Smatt * USRSTACK is the top (end) of the user stack.
481.1Smatt */
491.1Smatt#define	USRSTACK	VM_MAXUSER_ADDRESS	/* Start of user stack */
501.1Smatt
511.1Smatt/*
521.1Smatt * Virtual memory related constants, all in bytes
531.1Smatt */
541.1Smatt#ifndef MAXTSIZ
551.1Smatt#define	MAXTSIZ		(16*1024*1024)		/* max text size */
561.1Smatt#endif
571.1Smatt#ifndef DFLDSIZ
581.1Smatt#define	DFLDSIZ		(64*1024*1024)		/* initial data size limit */
591.1Smatt#endif
601.1Smatt#ifndef MAXDSIZ
611.1Smatt#define	MAXDSIZ		(128*1024*1024)		/* max data size */
621.1Smatt#endif
631.1Smatt#ifndef	DFLSSIZ
641.1Smatt#define	DFLSSIZ		(512*1024)		/* initial stack size limit */
651.1Smatt#endif
661.1Smatt#ifndef	MAXSSIZ
671.1Smatt#define	MAXSSIZ		(16*1024*1024)		/* max stack size */
681.1Smatt#endif
691.1Smatt
701.1Smatt/*
711.1Smatt * PTEs for mapping user space into the kernel for phyio operations.
721.1Smatt * One page is enough to handle 4MB of simultaneous raw IO operations.
731.1Smatt */
741.1Smatt#ifndef USRIOSIZE
751.1Smatt#define USRIOSIZE	(1 * NPTEPG)		/* 4MB */
761.1Smatt#endif
771.1Smatt
781.1Smatt/* user/kernel map constants */
791.1Smatt#define VM_MIN_ADDRESS		((vaddr_t)0)
801.1Smatt#define VM_MAXUSER_ADDRESS	((vaddr_t)0xBFF00000)
811.1Smatt#define VM_MAX_ADDRESS		((vaddr_t)0xFFF00000)
821.1Smatt#define VM_MIN_KERNEL_ADDRESS	((vaddr_t)0xC0000000)
831.1Smatt#define VM_MAX_KERNEL_ADDRESS	((vaddr_t)-PAGE_SIZE)
841.1Smatt
851.1Smatt/* virtual sizes (bytes) for various kernel submaps */
861.1Smatt#define VM_PHYS_SIZE		(USRIOSIZE*PAGE_SIZE)
871.1Smatt
881.1Smatt/*
891.1Smatt * Constants which control the way the VM system deals with memory segments.
901.1Smatt * The evbcf port has one physical memory segment.
911.1Smatt */
921.1Smatt#define	VM_PHYSSEG_MAX		1
931.1Smatt#define	VM_PHYSSEG_STRAT	VM_PSTRAT_RANDOM
941.1Smatt
951.1Smatt#define	VM_NFREELIST		1
961.1Smatt#define	VM_FREELIST_DEFAULT	0
971.1Smatt
981.1Smatt#endif /* _EVBCF_VMPARAM_H_ */
99