param.h revision 1.11
11.11Stsutsui/*	$NetBSD: param.h,v 1.11 2007/03/04 10:02:42 tsutsui Exp $	*/
21.1Stsutsui
31.1Stsutsui/*
41.1Stsutsui * Copyright (c) 1982, 1986, 1990, 1993
51.1Stsutsui *	The Regents of the University of California.  All rights reserved.
61.8Sagc *
71.8Sagc * This code is derived from software contributed to Berkeley by
81.8Sagc * the Systems Programming Group of the University of Utah Computer
91.8Sagc * Science Department.
101.8Sagc *
111.8Sagc * Redistribution and use in source and binary forms, with or without
121.8Sagc * modification, are permitted provided that the following conditions
131.8Sagc * are met:
141.8Sagc * 1. Redistributions of source code must retain the above copyright
151.8Sagc *    notice, this list of conditions and the following disclaimer.
161.8Sagc * 2. Redistributions in binary form must reproduce the above copyright
171.8Sagc *    notice, this list of conditions and the following disclaimer in the
181.8Sagc *    documentation and/or other materials provided with the distribution.
191.8Sagc * 3. Neither the name of the University nor the names of its contributors
201.8Sagc *    may be used to endorse or promote products derived from this software
211.8Sagc *    without specific prior written permission.
221.8Sagc *
231.8Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
241.8Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
251.8Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
261.8Sagc * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
271.8Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
281.8Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
291.8Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
301.8Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
311.8Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
321.8Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
331.8Sagc * SUCH DAMAGE.
341.8Sagc *
351.8Sagc * from: Utah $Hdr: machparam.h 1.16 92/12/20$
361.8Sagc *
371.8Sagc *	@(#)param.h	8.1 (Berkeley) 6/10/93
381.8Sagc */
391.8Sagc/*
401.8Sagc * Copyright (c) 1988 University of Utah.
411.1Stsutsui *
421.1Stsutsui * This code is derived from software contributed to Berkeley by
431.1Stsutsui * the Systems Programming Group of the University of Utah Computer
441.1Stsutsui * Science Department.
451.1Stsutsui *
461.1Stsutsui * Redistribution and use in source and binary forms, with or without
471.1Stsutsui * modification, are permitted provided that the following conditions
481.1Stsutsui * are met:
491.1Stsutsui * 1. Redistributions of source code must retain the above copyright
501.1Stsutsui *    notice, this list of conditions and the following disclaimer.
511.1Stsutsui * 2. Redistributions in binary form must reproduce the above copyright
521.1Stsutsui *    notice, this list of conditions and the following disclaimer in the
531.1Stsutsui *    documentation and/or other materials provided with the distribution.
541.1Stsutsui * 3. All advertising materials mentioning features or use of this software
551.1Stsutsui *    must display the following acknowledgement:
561.1Stsutsui *	This product includes software developed by the University of
571.1Stsutsui *	California, Berkeley and its contributors.
581.1Stsutsui * 4. Neither the name of the University nor the names of its contributors
591.1Stsutsui *    may be used to endorse or promote products derived from this software
601.1Stsutsui *    without specific prior written permission.
611.1Stsutsui *
621.1Stsutsui * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
631.1Stsutsui * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
641.1Stsutsui * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
651.1Stsutsui * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
661.1Stsutsui * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
671.1Stsutsui * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
681.1Stsutsui * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
691.1Stsutsui * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
701.1Stsutsui * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
711.1Stsutsui * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
721.1Stsutsui * SUCH DAMAGE.
731.1Stsutsui *
741.1Stsutsui * from: Utah $Hdr: machparam.h 1.16 92/12/20$
751.1Stsutsui *
761.1Stsutsui *	@(#)param.h	8.1 (Berkeley) 6/10/93
771.1Stsutsui */
781.1Stsutsui
791.9Stsutsui#ifndef	_NEWS68K_PARAM_H_
801.9Stsutsui#define	_NEWS68K_PARAM_H_
811.1Stsutsui
821.1Stsutsui/*
831.1Stsutsui * Machine dependent constants for m68k NEWS.
841.1Stsutsui */
851.1Stsutsui#define	_MACHINE	news68k
861.1Stsutsui#define	MACHINE		"news68k"
871.1Stsutsui
881.1Stsutsui
891.1Stsutsui#define	PGSHIFT		12		/* LOG2(NBPG) */
901.1Stsutsui#define	KERNBASE	0x00000000	/* start of kernel virtual */
911.1Stsutsui
921.1Stsutsui#define	SEGSHIFT	22		/* LOG2(NBSEG) */
931.6Schs#if defined(M68030) && !defined(M68040) && !defined(M68060)
941.1Stsutsui#define NBSEG		(1 << SEGSHIFT)	/* bytes/segment */
951.6Schs#elif (defined(M68040) || defined(M68060)) && !defined(M68030)
961.6Schs#define	NBSEG		(32 * (1 << PGSHIFT))
971.6Schs#else
981.6Schs#define	NBSEG		((mmutype == MMU_68040) ? \
991.6Schs				(32 * (1 << PGSHIFT)) : (256 * (1 << PGSHIFT)))
1001.6Schs#endif
1011.1Stsutsui#define	SEGOFSET	(NBSEG-1)	/* byte offset into segment */
1021.1Stsutsui
1031.4Stsutsui#define	UPAGES		2		/* pages of u-area */
1041.1Stsutsui
1051.1Stsutsui#include <m68k/param.h>
1061.1Stsutsui
1071.1Stsutsui#define	NPTEPG		(NBPG/(sizeof (pt_entry_t)))
1081.1Stsutsui
1091.1Stsutsui/*
1101.2Sthorpej * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
1111.2Sthorpej * logical pages.
1121.1Stsutsui */
1131.3Stsutsui#define	NKMEMPAGES_MIN_DEFAULT	((3 * 1024 * 1024) >> PAGE_SHIFT)
1141.2Sthorpej#define	NKMEMPAGES_MAX_DEFAULT	((4 * 1024 * 1024) >> PAGE_SHIFT)
1151.1Stsutsui
1161.1Stsutsui#if defined(_KERNEL) && !defined(_LOCORE)
1171.11Stsutsui#include <machine/intr.h>
1181.11Stsutsui
1191.1Stsutsui#define	delay(us)	_delay((us) << 8)
1201.1Stsutsui#define DELAY(us)	delay(us)
1211.1Stsutsui
1221.7Stsutsuivoid	_delay(u_int);
1231.1Stsutsui#endif /* _KERNEL && !_LOCORE */
1241.1Stsutsui
1251.5Smrg#if defined(_KERNEL_OPT)
1261.1Stsutsui#include "opt_compat_hpux.h"
1271.1Stsutsui#endif
1281.1Stsutsui
1291.1Stsutsui#ifdef COMPAT_HPUX
1301.1Stsutsui/*
1311.1Stsutsui * Constants/macros for HPUX multiple mapping of user address space.
1321.1Stsutsui * Pages in the first 256Mb are mapped in at every 256Mb segment.
1331.1Stsutsui */
1341.1Stsutsui#define HPMMMASK	0xF0000000
1351.1Stsutsui#define ISHPMMADDR(v) \
1361.1Stsutsui	((curproc->p_md.md_flags & MDP_HPUXMMAP) && \
1371.1Stsutsui	 ((unsigned)(v) & HPMMMASK) && \
1381.1Stsutsui	 ((unsigned)(v) & HPMMMASK) != HPMMMASK)
1391.1Stsutsui#define HPMMBASEADDR(v) \
1401.1Stsutsui	((unsigned)(v) & ~HPMMMASK)
1411.1Stsutsui#endif
1421.1Stsutsui
1431.9Stsutsui#endif	/* !_NEWS68K_PARAM_H_ */
144