xref: /netbsd/sys/arch/next68k/next68k/isr.h (revision bf9ec67e)
1 /*	$NetBSD: isr.h,v 1.2 1998/11/10 22:45:45 dbj Exp $ */
2 
3 /*
4  * This file was taken from from mvme68k/mvme68k/isr.h
5  * should probably be re-synced when needed.
6  * Darrin B. Jewell <jewell@mit.edu>  Tue Nov 10 05:07:16 1998
7  * original cvs id: NetBSD: isr.h,v 1.3 1997/10/09 08:40:06 jtc Exp
8  */
9 
10 /*-
11  * Copyright (c) 1996 The NetBSD Foundation, Inc.
12  * All rights reserved.
13  *
14  * This code is derived from software contributed to The NetBSD Foundation
15  * by Jason R. Thorpe.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions
19  * are met:
20  * 1. Redistributions of source code must retain the above copyright
21  *    notice, this list of conditions and the following disclaimer.
22  * 2. Redistributions in binary form must reproduce the above copyright
23  *    notice, this list of conditions and the following disclaimer in the
24  *    documentation and/or other materials provided with the distribution.
25  * 3. All advertising materials mentioning features or use of this software
26  *    must display the following acknowledgement:
27  *        This product includes software developed by the NetBSD
28  *        Foundation, Inc. and its contributors.
29  * 4. Neither the name of The NetBSD Foundation nor the names of its
30  *    contributors may be used to endorse or promote products derived
31  *    from this software without specific prior written permission.
32  *
33  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
34  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
35  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
36  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
37  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
38  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
39  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
40  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
41  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
42  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
43  * POSSIBILITY OF SUCH DAMAGE.
44  */
45 
46 #include <sys/queue.h>
47 
48 /*
49  * The location and size of the autovectored interrupt portion
50  * of the vector table.
51  */
52 #define ISRAUTOVEC	0x18
53 #define NISRAUTOVEC	8
54 
55 /*
56  * The location and size of the vectored interrupt portion
57  * of the vector table.
58  */
59 #define ISRVECTORED	0x40
60 #define NISRVECTORED	192
61 
62 /*
63  * Autovectored interupt handler cookie.
64  */
65 struct isr_autovec {
66 	LIST_ENTRY(isr_autovec) isr_link;
67 	int		(*isr_func) __P((void *));
68 	void		*isr_arg;
69 	int		isr_ipl;
70 	int		isr_priority;
71 };
72 
73 typedef LIST_HEAD(, isr_autovec) isr_autovec_list_t;
74 
75 /*
76  * Vectored interrupt handler cookie.  The handler may request to
77  * receive the exception frame as an argument by specifying NULL
78  * when establishing the interrupt.
79  */
80 struct isr_vectored {
81 	int		(*isr_func) __P((void *));
82 	void		*isr_arg;
83 	int		isr_ipl;
84 };
85 
86 /*
87  * Autovectored ISR priorities.  These are not the same as interrupt levels.
88  */
89 #define ISRPRI_BIO		0
90 #define ISRPRI_NET		1
91 #define ISRPRI_TTY		2
92 #define ISRPRI_TTYNOBUF		3
93 
94 void	isrinit __P((void));
95 void	isrlink_autovec __P((int (*)(void *), void *, int, int));
96 void	isrlink_vectored __P((int (*)(void *), void *, int, int));
97 void	isrunlink_vectored __P((int));
98 void	isrdispatch_autovec __P((int, int, void *));
99 void	isrdispatch_vectored __P((int, int, void *));
100