intr.c revision 1.31 1 1.31 tsutsui /* $NetBSD: intr.c,v 1.31 2010/06/13 02:11:22 tsutsui Exp $ */
2 1.1 chris
3 1.1 chris /*
4 1.1 chris * Copyright (c) 1994-1998 Mark Brinicombe.
5 1.1 chris * All rights reserved.
6 1.1 chris *
7 1.1 chris * Redistribution and use in source and binary forms, with or without
8 1.1 chris * modification, are permitted provided that the following conditions
9 1.1 chris * are met:
10 1.1 chris * 1. Redistributions of source code must retain the above copyright
11 1.1 chris * notice, this list of conditions and the following disclaimer.
12 1.1 chris * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 chris * notice, this list of conditions and the following disclaimer in the
14 1.1 chris * documentation and/or other materials provided with the distribution.
15 1.1 chris * 3. All advertising materials mentioning features or use of this software
16 1.1 chris * must display the following acknowledgement:
17 1.1 chris * This product includes software developed by Mark Brinicombe
18 1.1 chris * for the NetBSD Project.
19 1.1 chris * 4. The name of the company nor the name of the author may be used to
20 1.1 chris * endorse or promote products derived from this software without specific
21 1.1 chris * prior written permission.
22 1.1 chris *
23 1.1 chris * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24 1.1 chris * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25 1.1 chris * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26 1.1 chris * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
27 1.1 chris * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 1.1 chris * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29 1.1 chris * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 1.1 chris * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 1.1 chris * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 1.1 chris * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 1.1 chris * SUCH DAMAGE.
34 1.1 chris *
35 1.1 chris * Soft interrupt and other generic interrupt functions.
36 1.1 chris */
37 1.12 lukem
38 1.12 lukem #include <sys/cdefs.h>
39 1.31 tsutsui __KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.31 2010/06/13 02:11:22 tsutsui Exp $");
40 1.1 chris
41 1.1 chris #include <sys/param.h>
42 1.1 chris #include <sys/systm.h>
43 1.1 chris #include <sys/syslog.h>
44 1.1 chris #include <sys/malloc.h>
45 1.9 gehenna #include <sys/conf.h>
46 1.1 chris
47 1.1 chris #include <uvm/uvm_extern.h>
48 1.1 chris
49 1.2 matt #include <machine/intr.h>
50 1.1 chris #include <machine/cpu.h>
51 1.1 chris
52 1.6 chris #include <arm/arm32/machdep.h>
53 1.6 chris
54 1.28 matt u_int spl_masks[NIPL];
55 1.28 matt int safepri = IPL_NONE;
56 1.7 thorpej
57 1.8 chris extern u_int irqmasks[];
58 1.4 thorpej
59 1.4 thorpej void
60 1.15 matt set_spl_masks(void)
61 1.4 thorpej {
62 1.4 thorpej int loop;
63 1.4 thorpej
64 1.28 matt for (loop = 0; loop < NIPL; ++loop) {
65 1.4 thorpej spl_masks[loop] = 0xffffffff;
66 1.4 thorpej }
67 1.4 thorpej
68 1.31 tsutsui spl_masks[IPL_VM] = irqmasks[IPL_VM];
69 1.31 tsutsui spl_masks[IPL_SCHED] = irqmasks[IPL_SCHED];
70 1.31 tsutsui spl_masks[IPL_HIGH] = irqmasks[IPL_HIGH];
71 1.31 tsutsui spl_masks[IPL_SOFTSERIAL] = irqmasks[IPL_SOFTSERIAL];
72 1.31 tsutsui spl_masks[IPL_SOFTNET] = irqmasks[IPL_SOFTNET];
73 1.31 tsutsui spl_masks[IPL_SOFTBIO] = irqmasks[IPL_SOFTBIO];
74 1.31 tsutsui spl_masks[IPL_SOFTCLOCK] = irqmasks[IPL_SOFTCLOCK];
75 1.31 tsutsui spl_masks[IPL_NONE] = irqmasks[IPL_NONE];
76 1.4 thorpej
77 1.14 yamt }
78 1.14 yamt
79 1.4 thorpej #ifdef DIAGNOSTIC
80 1.4 thorpej void
81 1.15 matt dump_spl_masks(void)
82 1.4 thorpej {
83 1.4 thorpej int loop;
84 1.4 thorpej
85 1.28 matt for (loop = 0; loop < NIPL; ++loop)
86 1.28 matt printf("spl_masks[%d]=%08x\n", loop, spl_masks[loop]);
87 1.4 thorpej }
88 1.4 thorpej #endif
89 1.1 chris
90 1.1 chris /* End of intr.c */
91