param.h revision 1.17
11.17Sscw/*	$NetBSD: param.h,v 1.17 1999/09/21 18:49:19 scw Exp $	*/
21.1Schuck
31.1Schuck/*
41.1Schuck * Copyright (c) 1988 University of Utah.
51.1Schuck * Copyright (c) 1982, 1986, 1990, 1993
61.1Schuck *	The Regents of the University of California.  All rights reserved.
71.1Schuck *
81.1Schuck * This code is derived from software contributed to Berkeley by
91.1Schuck * the Systems Programming Group of the University of Utah Computer
101.1Schuck * Science Department.
111.1Schuck *
121.1Schuck * Redistribution and use in source and binary forms, with or without
131.1Schuck * modification, are permitted provided that the following conditions
141.1Schuck * are met:
151.1Schuck * 1. Redistributions of source code must retain the above copyright
161.1Schuck *    notice, this list of conditions and the following disclaimer.
171.1Schuck * 2. Redistributions in binary form must reproduce the above copyright
181.1Schuck *    notice, this list of conditions and the following disclaimer in the
191.1Schuck *    documentation and/or other materials provided with the distribution.
201.1Schuck * 3. All advertising materials mentioning features or use of this software
211.1Schuck *    must display the following acknowledgement:
221.1Schuck *	This product includes software developed by the University of
231.1Schuck *	California, Berkeley and its contributors.
241.1Schuck * 4. Neither the name of the University nor the names of its contributors
251.1Schuck *    may be used to endorse or promote products derived from this software
261.1Schuck *    without specific prior written permission.
271.1Schuck *
281.1Schuck * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
291.1Schuck * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
301.1Schuck * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
311.1Schuck * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
321.1Schuck * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
331.1Schuck * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
341.1Schuck * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
351.1Schuck * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
361.1Schuck * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
371.1Schuck * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
381.1Schuck * SUCH DAMAGE.
391.1Schuck *
401.1Schuck * from: Utah $Hdr: machparam.h 1.16 92/12/20$
411.1Schuck *
421.1Schuck *	@(#)param.h	8.1 (Berkeley) 6/10/93
431.1Schuck */
441.1Schuck
451.8Sveego#ifndef	_MACHINE_PARAM_H_
461.8Sveego#define	_MACHINE_PARAM_H_
471.8Sveego
481.1Schuck/*
491.1Schuck * Machine dependent constants for mvme68k, based on HP9000 series 300.
501.1Schuck */
511.5Scgd#define	_MACHINE 	mvme68k
521.4Scgd#define	MACHINE		"mvme68k"
531.1Schuck
541.8Sveego#define	PGSHIFT		12		/* LOG2(NBPG) */
551.8Sveego#define	KERNBASE	0x00000000	/* start of kernel virtual */
561.8Sveego
571.9Sveego#define	SEGSHIFT	22		/* LOG2(NBSEG) */
581.9Sveego#define NBSEG		(1 << SEGSHIFT)	/* bytes/segment */
591.9Sveego#define	SEGOFSET	(NBSEG-1)	/* byte offset into segment */
601.9Sveego
611.8Sveego#define	UPAGES		3		/* pages of u-area */
621.1Schuck
631.8Sveego#include <m68k/param.h>
641.10Sveego
651.10Sveego#define	NPTEPG		(NBPG/(sizeof (pt_entry_t)))
661.1Schuck
671.1Schuck/*
681.8Sveego * Size of kernel malloc arena in CLBYTES-sized logical pages
691.1Schuck */
701.1Schuck#ifndef NKMEMCLUSTERS
711.15Sscw# define	NKMEMCLUSTERS	(4096 * 1024 / CLBYTES)
721.1Schuck#endif
731.1Schuck
741.1Schuck#include <machine/psl.h>
751.1Schuck
761.17Sscw#ifdef _KERNEL
771.16Sthorpej/* spl0 requires checking for software interrupts */
781.1Schuck
791.16Sthorpej#define spllowersoftclock()	spl1()
801.16Sthorpej#define splsoftclock()		splraise1()
811.16Sthorpej#define splsoftnet()		splraise1()
821.16Sthorpej#define splbio()		splraise2()
831.16Sthorpej#define splnet()		splraise3()
841.16Sthorpej#define spltty()		splraise3()
851.16Sthorpej#define splimp()		splraise3()
861.16Sthorpej#define splserial()		splraise4()
871.16Sthorpej#define splclock()		splraise5()
881.16Sthorpej#define splstatclock()		splraise5()
891.16Sthorpej#define splvm()			splraise5()
901.16Sthorpej#define splhigh()		spl7()
911.16Sthorpej#define splsched()		spl7()
921.1Schuck
931.1Schuck/* watch out for side effects */
941.1Schuck#define splx(s)         (s & PSL_IPL ? _spl(s) : spl0())
951.1Schuck
961.17Sscw#ifndef _LOCORE
971.6Schuckextern void _delay __P((unsigned));
981.6Schuck#define delay(us)	_delay((us)<<8)
991.6Schuck#define DELAY(n)	delay(n)
1001.17Sscw#endif	/* !_LOCORE */
1011.17Sscw#endif	/* _KERNEL */
1021.8Sveego
1031.8Sveego#endif	/* !_MACHINE_PARAM_H_ */
104