intr.h revision 1.1.1.2 1 1.1 soda /* $NetBSD: intr.h,v 1.1.1.2 2000/02/22 11:05:14 soda Exp $ */
2 1.1 soda
3 1.1 soda /*
4 1.1 soda * Copyright (c) 1996 Charles M. Hannum. All rights reserved.
5 1.1 soda *
6 1.1 soda * Redistribution and use in source and binary forms, with or without
7 1.1 soda * modification, are permitted provided that the following conditions
8 1.1 soda * are met:
9 1.1 soda * 1. Redistributions of source code must retain the above copyright
10 1.1 soda * notice, this list of conditions and the following disclaimer.
11 1.1 soda * 2. Redistributions in binary form must reproduce the above copyright
12 1.1 soda * notice, this list of conditions and the following disclaimer in the
13 1.1 soda * documentation and/or other materials provided with the distribution.
14 1.1 soda * 3. All advertising materials mentioning features or use of this software
15 1.1 soda * must display the following acknowledgement:
16 1.1 soda * This product includes software developed by Charles M. Hannum.
17 1.1 soda * 4. The name of the author may not be used to endorse or promote products
18 1.1 soda * derived from this software without specific prior written permission.
19 1.1 soda *
20 1.1 soda * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 1.1 soda * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 1.1 soda * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 1.1 soda * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 1.1 soda * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 1.1 soda * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 1.1 soda * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 1.1 soda * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 1.1 soda * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 1.1 soda * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 1.1 soda */
31 1.1 soda
32 1.1 soda #ifndef _ARC_INTR_H_
33 1.1 soda #define _ARC_INTR_H_
34 1.1 soda
35 1.1 soda /* Interrupt priority `levels'; not mutually exclusive. */
36 1.1 soda #define IPL_BIO 0 /* block I/O */
37 1.1 soda #define IPL_NET 1 /* network */
38 1.1 soda #define IPL_TTY 2 /* terminal */
39 1.1 soda #define IPL_CLOCK 3 /* clock */
40 1.1 soda #define IPL_IMP 4 /* memory allocation */
41 1.1 soda #define IPL_NONE 5 /* nothing */
42 1.1 soda #define IPL_HIGH 6 /* everything */
43 1.1 soda
44 1.1 soda /* Interrupt sharing types. */
45 1.1 soda #define IST_NONE 0 /* none */
46 1.1 soda #define IST_PULSE 1 /* pulsed */
47 1.1 soda #define IST_EDGE 2 /* edge-triggered */
48 1.1 soda #define IST_LEVEL 3 /* level-triggered */
49 1.1 soda
50 1.1 soda /* Soft interrupt masks. */
51 1.1 soda #define SIR_CLOCK 31
52 1.1 soda #define SIR_CLOCKMASK ((1 << SIR_CLOCK))
53 1.1 soda #define SIR_NET 30
54 1.1 soda #define SIR_NETMASK ((1 << SIR_NET) | SIR_CLOCKMASK)
55 1.1 soda #define SIR_TTY 29
56 1.1 soda #define SIR_TTYMASK ((1 << SIR_TTY) | SIR_CLOCKMASK)
57 1.1 soda #define SIR_ALLMASK (SIR_CLOCKMASK | SIR_NETMASK | SIR_TTYMASK)
58 1.1 soda
59 1.1 soda #ifndef _LOCORE
60 1.1 soda
61 1.1 soda void setsoftclock __P((void));
62 1.1 soda void clearsoftclock __P((void));
63 1.1 soda int splsoftclock __P((void));
64 1.1 soda void setsoftnet __P((void));
65 1.1 soda void clearsoftnet __P((void));
66 1.1 soda int splsoftnet __P((void));
67 1.1 soda
68 1.1 soda struct clockframe;
69 1.1 soda void set_intr __P((int, int(*)(u_int, struct clockframe *), int));
70 1.1 soda
71 1.1 soda volatile int cpl, ipending, astpending;
72 1.1 soda int imask[7];
73 1.1 soda
74 1.1 soda #endif /* _LOCORE */
75 1.1 soda
76 1.1 soda #endif /* _ARC_INTR_H_ */
77