| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: intr.c,v 1.61 2008/12/16 22:35:27 christos Exp $ */ | | 1 | /* $NetBSD: intr.c,v 1.62 2009/12/03 05:06:16 mrg Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1992, 1993 | | 4 | * Copyright (c) 1992, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * This software was developed by the Computer Systems Engineering group | | 7 | * This software was developed by the Computer Systems Engineering group |
8 | * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and | | 8 | * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and |
9 | * contributed to Berkeley. | | 9 | * contributed to Berkeley. |
10 | * | | 10 | * |
11 | * All advertising materials mentioning features or use of this software | | 11 | * All advertising materials mentioning features or use of this software |
12 | * must display the following acknowledgement: | | 12 | * must display the following acknowledgement: |
13 | * This product includes software developed by the University of | | 13 | * This product includes software developed by the University of |
14 | * California, Lawrence Berkeley Laboratory. | | 14 | * California, Lawrence Berkeley Laboratory. |
| @@ -31,27 +31,27 @@ | | | @@ -31,27 +31,27 @@ |
31 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 31 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
32 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 32 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
37 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 37 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
38 | * SUCH DAMAGE. | | 38 | * SUCH DAMAGE. |
39 | * | | 39 | * |
40 | * @(#)intr.c 8.3 (Berkeley) 11/11/93 | | 40 | * @(#)intr.c 8.3 (Berkeley) 11/11/93 |
41 | */ | | 41 | */ |
42 | | | 42 | |
43 | #include <sys/cdefs.h> | | 43 | #include <sys/cdefs.h> |
44 | __KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.61 2008/12/16 22:35:27 christos Exp $"); | | 44 | __KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.62 2009/12/03 05:06:16 mrg Exp $"); |
45 | | | 45 | |
46 | #include "opt_ddb.h" | | 46 | #include "opt_ddb.h" |
47 | #include "opt_multiprocessor.h" | | 47 | #include "opt_multiprocessor.h" |
48 | | | 48 | |
49 | #include <sys/param.h> | | 49 | #include <sys/param.h> |
50 | #include <sys/systm.h> | | 50 | #include <sys/systm.h> |
51 | #include <sys/kernel.h> | | 51 | #include <sys/kernel.h> |
52 | #include <sys/malloc.h> | | 52 | #include <sys/malloc.h> |
53 | | | 53 | |
54 | #include <dev/cons.h> | | 54 | #include <dev/cons.h> |
55 | | | 55 | |
56 | #include <machine/cpu.h> | | 56 | #include <machine/cpu.h> |
57 | #include <machine/ctlreg.h> | | 57 | #include <machine/ctlreg.h> |
| @@ -193,27 +193,27 @@ intr_establish(int level, bool mpsafe, s | | | @@ -193,27 +193,27 @@ intr_establish(int level, bool mpsafe, s |
193 | if (!ih->ih_number) { | | 193 | if (!ih->ih_number) { |
194 | printf("\nintr_establish: NULL vector fun %p arg %p pil %p\n", | | 194 | printf("\nintr_establish: NULL vector fun %p arg %p pil %p\n", |
195 | ih->ih_fun, ih->ih_arg, ih->ih_number, ih->ih_pil); | | 195 | ih->ih_fun, ih->ih_arg, ih->ih_number, ih->ih_pil); |
196 | Debugger(); | | 196 | Debugger(); |
197 | } | | 197 | } |
198 | #endif | | 198 | #endif |
199 | if (ih->ih_number < MAXINTNUM && ih->ih_number >= 0) { | | 199 | if (ih->ih_number < MAXINTNUM && ih->ih_number >= 0) { |
200 | if ((q = intrlev[ih->ih_number])) { | | 200 | if ((q = intrlev[ih->ih_number])) { |
201 | struct intrhand *nih; | | 201 | struct intrhand *nih; |
202 | /* | | 202 | /* |
203 | * Interrupt is already there. We need to create a | | 203 | * Interrupt is already there. We need to create a |
204 | * new interrupt handler and interpose it. | | 204 | * new interrupt handler and interpose it. |
205 | */ | | 205 | */ |
206 | #ifdef DEBUG | | 206 | #ifdef NOT_DEBUG |
207 | printf("intr_establish: intr reused %x\n", | | 207 | printf("intr_establish: intr reused %x\n", |
208 | ih->ih_number); | | 208 | ih->ih_number); |
209 | #endif | | 209 | #endif |
210 | if (q->ih_fun != intr_list_handler) { | | 210 | if (q->ih_fun != intr_list_handler) { |
211 | nih = (struct intrhand *) | | 211 | nih = (struct intrhand *) |
212 | malloc(sizeof(struct intrhand), | | 212 | malloc(sizeof(struct intrhand), |
213 | M_DEVBUF, M_NOWAIT); | | 213 | M_DEVBUF, M_NOWAIT); |
214 | /* Point the old IH at the new handler */ | | 214 | /* Point the old IH at the new handler */ |
215 | *nih = *q; | | 215 | *nih = *q; |
216 | nih->ih_next = NULL; | | 216 | nih->ih_next = NULL; |
217 | q->ih_arg = (void *)nih; | | 217 | q->ih_arg = (void *)nih; |
218 | q->ih_fun = intr_list_handler; | | 218 | q->ih_fun = intr_list_handler; |
219 | } | | 219 | } |