intr.c revision 1.28 1 1.28 matt /* $NetBSD: intr.c,v 1.28 2008/04/27 18:58:44 matt 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.28 matt __KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.28 2008/04/27 18:58:44 matt 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.10 bsh #include <machine/atomic.h>
50 1.2 matt #include <machine/intr.h>
51 1.1 chris #include <machine/cpu.h>
52 1.1 chris
53 1.6 chris #include <arm/arm32/machdep.h>
54 1.6 chris
55 1.28 matt u_int spl_masks[NIPL];
56 1.28 matt int safepri = IPL_NONE;
57 1.7 thorpej
58 1.8 chris extern u_int irqmasks[];
59 1.4 thorpej
60 1.4 thorpej void
61 1.15 matt set_spl_masks(void)
62 1.4 thorpej {
63 1.4 thorpej int loop;
64 1.4 thorpej
65 1.28 matt for (loop = 0; loop < NIPL; ++loop) {
66 1.4 thorpej spl_masks[loop] = 0xffffffff;
67 1.4 thorpej }
68 1.4 thorpej
69 1.28 matt spl_masks[IPL_VM] = irqmasks[IPL_VM];
70 1.28 matt spl_masks[IPL_SCHED] = irqmasks[IPL_SCHED];
71 1.28 matt spl_masks[IPL_HIGH] = irqmasks[IPL_HIGH];
72 1.28 matt spl_masks[IPL_NONE] = 0;
73 1.4 thorpej
74 1.14 yamt }
75 1.14 yamt
76 1.4 thorpej #ifdef DIAGNOSTIC
77 1.4 thorpej void
78 1.15 matt dump_spl_masks(void)
79 1.4 thorpej {
80 1.4 thorpej int loop;
81 1.4 thorpej
82 1.28 matt for (loop = 0; loop < NIPL; ++loop)
83 1.28 matt printf("spl_masks[%d]=%08x\n", loop, spl_masks[loop]);
84 1.4 thorpej }
85 1.4 thorpej #endif
86 1.1 chris
87 1.1 chris /* End of intr.c */
88