xref: /netbsd/sys/arch/next68k/next68k/isr.h (revision c4a72b64)
1 /*	$NetBSD: isr.h,v 1.3 2002/09/11 01:46:34 mycroft 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 #define NIPLS		8
55 
56 /*
57  * The location and size of the vectored interrupt portion
58  * of the vector table.
59  */
60 #define ISRVECTORED	0x40
61 #define NISRVECTORED	192
62 
63 /*
64  * Autovectored interupt handler cookie.
65  */
66 struct isr_autovec {
67 	LIST_ENTRY(isr_autovec) isr_link;
68 	int		(*isr_func) __P((void *));
69 	void		*isr_arg;
70 	int		isr_ipl;
71 	int		isr_priority;
72 	struct evcnt	*isr_evcnt;
73 };
74 
75 typedef LIST_HEAD(, isr_autovec) isr_autovec_list_t;
76 
77 /*
78  * Vectored interrupt handler cookie.  The handler may request to
79  * receive the exception frame as an argument by specifying NULL
80  * when establishing the interrupt.
81  */
82 struct isr_vectored {
83 	int		(*isr_func) __P((void *));
84 	void		*isr_arg;
85 	int		isr_ipl;
86 	struct evcnt	*isr_evcnt;
87 };
88 
89 /*
90  * Autovectored ISR priorities.  These are not the same as interrupt levels.
91  */
92 #define ISRPRI_BIO		0
93 #define ISRPRI_NET		1
94 #define ISRPRI_TTY		2
95 #define ISRPRI_TTYNOBUF		3
96 
97 extern struct evcnt next68k_irq_evcnt[];
98 
99 void	isrinit __P((void));
100 struct	evcnt *isrlink_evcnt __P((int));
101 void	isrlink_autovec __P((int (*)(void *), void *, int, int,
102 	    struct evcnt *));
103 void	isrlink_vectored __P((int (*)(void *), void *, int, int,
104 	    struct evcnt *));
105 void	isrunlink_vectored __P((int));
106 void	isrdispatch_autovec __P((struct clockframe *));
107 void	isrdispatch_vectored __P((int, struct clockframe *));
108 void	netintr __P((void));
109