intr.h revision 1.18.6.1 1 1.18.6.1 jruoho /* $NetBSD: intr.h,v 1.18.6.1 2011/06/06 09:06:12 jruoho Exp $ */
2 1.1 wdk
3 1.1 wdk /*
4 1.1 wdk * Copyright (c) 1998 Jonathan Stone. All rights reserved.
5 1.1 wdk *
6 1.1 wdk * Redistribution and use in source and binary forms, with or without
7 1.1 wdk * modification, are permitted provided that the following conditions
8 1.1 wdk * are met:
9 1.1 wdk * 1. Redistributions of source code must retain the above copyright
10 1.1 wdk * notice, this list of conditions and the following disclaimer.
11 1.1 wdk * 2. Redistributions in binary form must reproduce the above copyright
12 1.1 wdk * notice, this list of conditions and the following disclaimer in the
13 1.1 wdk * documentation and/or other materials provided with the distribution.
14 1.1 wdk * 3. All advertising materials mentioning features or use of this software
15 1.1 wdk * must display the following acknowledgement:
16 1.1 wdk * This product includes software developed by Jonathan Stone for
17 1.1 wdk * the NetBSD Project.
18 1.1 wdk * 4. The name of the author may not be used to endorse or promote products
19 1.1 wdk * derived from this software without specific prior written permission.
20 1.1 wdk *
21 1.1 wdk * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 1.1 wdk * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 1.1 wdk * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 1.1 wdk * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 1.1 wdk * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 1.1 wdk * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 1.1 wdk * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 1.1 wdk * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 1.1 wdk * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 1.1 wdk * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 1.1 wdk */
32 1.1 wdk
33 1.1 wdk #ifndef _MACHINE_INTR_H_
34 1.1 wdk #define _MACHINE_INTR_H_
35 1.1 wdk
36 1.18.6.1 jruoho #include <mips/intr.h>
37 1.1 wdk
38 1.1 wdk #ifdef _KERNEL
39 1.18.6.1 jruoho #ifdef __INTR_PRIVATE
40 1.18 he #include <sys/evcnt.h>
41 1.18.6.1 jruoho #include <mips/cpuregs.h>
42 1.1 wdk
43 1.1 wdk /*
44 1.1 wdk * nesting interrupt masks.
45 1.1 wdk */
46 1.1 wdk #define MIPS_INT_MASK_SPL_SOFT0 MIPS_SOFT_INT_MASK_0
47 1.1 wdk #define MIPS_INT_MASK_SPL_SOFT1 (MIPS_SOFT_INT_MASK_1|MIPS_INT_MASK_SPL_SOFT0)
48 1.1 wdk #define MIPS_INT_MASK_SPL0 (MIPS_INT_MASK_0|MIPS_INT_MASK_SPL_SOFT1)
49 1.1 wdk #define MIPS_INT_MASK_SPL1 (MIPS_INT_MASK_1|MIPS_INT_MASK_SPL0)
50 1.1 wdk #define MIPS_INT_MASK_SPL2 (MIPS_INT_MASK_2|MIPS_INT_MASK_SPL1)
51 1.1 wdk #define MIPS_INT_MASK_SPL3 (MIPS_INT_MASK_3|MIPS_INT_MASK_SPL2)
52 1.1 wdk #define MIPS_INT_MASK_SPL4 (MIPS_INT_MASK_4|MIPS_INT_MASK_SPL3)
53 1.1 wdk #define MIPS_INT_MASK_SPL5 (MIPS_INT_MASK_5|MIPS_INT_MASK_SPL4)
54 1.1 wdk
55 1.6 wdk struct mipsco_intrhand {
56 1.18.6.1 jruoho LIST_ENTRY(mipsco_intrhand) ih_q;
57 1.17 dsl int (*ih_fun)(void *);
58 1.6 wdk void *ih_arg;
59 1.6 wdk struct mipsco_intr *ih_intrhead;
60 1.6 wdk int ih_pending;
61 1.2 wdk };
62 1.6 wdk
63 1.6 wdk struct mipsco_intr {
64 1.18.6.1 jruoho LIST_HEAD(,mipsco_intrhand) intr_q;
65 1.6 wdk struct evcnt ih_evcnt;
66 1.12 yamt unsigned long intr_siq;
67 1.6 wdk };
68 1.6 wdk
69 1.18.6.1 jruoho extern const struct ipl_sr_map mipsco_ipl_sr_map;
70 1.6 wdk extern struct mipsco_intrhand intrtab[];
71 1.18.6.1 jruoho #define CALL_INTR(lev) ((*intrtab[lev].ih_fun)(intrtab[lev].ih_arg))
72 1.18.6.1 jruoho
73 1.18.6.1 jruoho #define MAX_INTR_COOKIES 16
74 1.18.6.1 jruoho
75 1.18.6.1 jruoho #endif /* __INTR_PRIVATE */
76 1.2 wdk
77 1.2 wdk #define SYS_INTR_LEVEL0 0
78 1.2 wdk #define SYS_INTR_LEVEL1 1
79 1.2 wdk #define SYS_INTR_LEVEL2 2
80 1.2 wdk #define SYS_INTR_LEVEL3 3
81 1.2 wdk #define SYS_INTR_LEVEL4 4
82 1.2 wdk #define SYS_INTR_LEVEL5 5
83 1.2 wdk #define SYS_INTR_SCSI 6
84 1.2 wdk #define SYS_INTR_TIMER 7
85 1.2 wdk #define SYS_INTR_ETHER 8
86 1.2 wdk #define SYS_INTR_SCC0 9
87 1.2 wdk #define SYS_INTR_FDC 10
88 1.6 wdk #define SYS_INTR_ATBUS 11
89 1.1 wdk
90 1.1 wdk #endif /* _KERNEL */
91 1.1 wdk #endif /* _MACHINE_INTR_H_ */
92