intr.h revision 1.2
11.2Sthorpej/* $NetBSD: intr.h,v 1.2 2000/08/22 19:46:29 thorpej Exp $ */
21.1Snisimura
31.1Snisimura/*-
41.1Snisimura * Copyright (c) 2000 The NetBSD Foundation, Inc.
51.1Snisimura * All rights reserved.
61.1Snisimura *
71.1Snisimura * This code is derived from software contributed to The NetBSD Foundation
81.1Snisimura * by Tohru Nishimura.
91.1Snisimura *
101.1Snisimura * Redistribution and use in source and binary forms, with or without
111.1Snisimura * modification, are permitted provided that the following conditions
121.1Snisimura * are met:
131.1Snisimura * 1. Redistributions of source code must retain the above copyright
141.1Snisimura *    notice, this list of conditions and the following disclaimer.
151.1Snisimura * 2. Redistributions in binary form must reproduce the above copyright
161.1Snisimura *    notice, this list of conditions and the following disclaimer in the
171.1Snisimura *    documentation and/or other materials provided with the distribution.
181.1Snisimura * 3. All advertising materials mentioning features or use of this software
191.1Snisimura *    must display the following acknowledgement:
201.1Snisimura *	This product includes software developed by the NetBSD
211.1Snisimura *	Foundation, Inc. and its contributors.
221.1Snisimura * 4. Neither the name of The NetBSD Foundation nor the names of its
231.1Snisimura *    contributors may be used to endorse or promote products derived
241.1Snisimura *    from this software without specific prior written permission.
251.1Snisimura *
261.1Snisimura * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
271.1Snisimura * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
281.1Snisimura * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
291.1Snisimura * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
301.1Snisimura * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
311.1Snisimura * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
321.1Snisimura * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
331.1Snisimura * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
341.1Snisimura * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
351.1Snisimura * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
361.1Snisimura * POSSIBILITY OF SUCH DAMAGE.
371.1Snisimura */
381.1Snisimura
391.1Snisimura#ifndef _MACHINE_INTR_H
401.1Snisimura#define _MACHINE_INTR_H
411.1Snisimura
421.1Snisimura/*
431.1Snisimura * spl functions; all but spl0 are done in-line
441.1Snisimura */
451.1Snisimura#include <machine/psl.h>
461.1Snisimura
471.1Snisimura#define splnone()	spl0()
481.1Snisimura#define spllowersoftclock()  spl1()
491.1Snisimura#define splsoftclock()  splraise1()
501.1Snisimura#define splsoftnet()    splraise1()
511.1Snisimura#define splbio()        spl2()
521.1Snisimura#define splnet()        spl3()
531.1Snisimura#define spltty()        spl6()
541.1Snisimura#define splimp()        spl7()
551.1Snisimura#define splclock()      spl5()
561.1Snisimura#define splstatclock()	spl5()
571.1Snisimura#define splvm()         spl7()
581.1Snisimura#define splhigh()       spl7()
591.1Snisimura#define splsched()      spl7()
601.2Sthorpej#define spllock()	spl7()
611.1Snisimura
621.1Snisimura/* watch out for side effects */
631.1Snisimura#define splx(s)         ((s) & PSL_IPL ? _spl(s) : spl0())
641.1Snisimura
651.1Snisimura#ifdef _KERNEL
661.1Snisimuraint spl0 __P((void));
671.1Snisimura#endif /* _KERNEL */
681.1Snisimura
691.1Snisimura#endif	/* _MACHINE_INTR_H */
70