intr.h revision 1.1
1/*	$NetBSD: intr.h,v 1.1 1999/12/09 14:53:11 tsutsui Exp $	*/
2
3/*
4 *
5 * Copyright (c) 1998 NetBSD Foundation, Inc.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Minoura Makoto and Jason R. Thorpe.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 *    notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 *    notice, this list of conditions and the following disclaimer in the
18 *    documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 *    must display the following acknowledgement:
21 *      This product includes software developed by The NetBSD Foundation
22 *	Inc. and its contributers.
23 * 4. The name of the author may not be used to endorse or promote products
24 *    derived from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
27 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
30 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
31 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#ifndef _NEWS68K_INTR_H_
39#define	_NEWS68K_INTR_H_
40
41#include <machine/psl.h>
42
43#ifdef _KERNEL
44/*
45 * news68k can handle software interrupts by its own hardware
46 * so has no need to check for any simulated interrupts, etc.
47 */
48#define	spl0()		_spl0()
49#define	splx(s)		_spl(s)
50
51#define	spllowersoftclock()	spl2()
52#define	splsoft()	splraise2()
53#define	splsoftclock()	splsoft()
54#define	splsoftnet()	splsoft()
55#define	splbio()	splraise4()
56#define	splnet()	splraise4()
57#define	spltty()	splraise5()
58#define	splimp()	splraise5()
59#define	splserial()     splraise5()
60#define	splclock()	splraise6()
61#define	splstatclock()	splclock()
62#define	splvm()		spl6()
63#define	splhigh()	spl7()
64#define	splsched()	spl7()
65
66/*
67 * simulated software interrupt register
68 */
69extern u_long ssir;
70extern volatile u_char *ctrl_int2;
71
72#define	NSIR		(sizeof(ssir) * 8)
73#define	SIR_NET		0x1
74#define	SIR_CLOCK	0x2
75
76#define	siroff(x)	ssir &= ~(x)
77#define	setsoftint(x)	do{ \
78				ssir |= (x); \
79				*ctrl_int2 = 0xff; \
80			}while(0)
81#define	setsoftnet()	setsoftint(SIR_NET)
82#define	setsoftclock()	setsoftint(SIR_CLOCK)
83
84u_long allocate_sir __P((void (*) __P((void *)), void *));
85void init_sir __P((void));
86#endif /* _KERNEL */
87
88#endif /* _NEWS68K_INTR_H_ */
89