| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: intr.c,v 1.108 2010/01/05 21:38:50 macallan Exp $ */ | | 1 | /* $NetBSD: intr.c,v 1.109 2011/01/22 10:37:22 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.108 2010/01/05 21:38:50 macallan Exp $"); | | 44 | __KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.109 2011/01/22 10:37:22 mrg Exp $"); |
45 | | | 45 | |
46 | #include "opt_multiprocessor.h" | | 46 | #include "opt_multiprocessor.h" |
47 | #include "opt_sparc_arch.h" | | 47 | #include "opt_sparc_arch.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 | #include <sys/cpu.h> | | 53 | #include <sys/cpu.h> |
54 | #include <sys/intr.h> | | 54 | #include <sys/intr.h> |
55 | #include <sys/simplelock.h> | | 55 | #include <sys/simplelock.h> |
56 | | | 56 | |
57 | #include <uvm/uvm_extern.h> | | 57 | #include <uvm/uvm_extern.h> |
| @@ -123,26 +123,39 @@ void bogusintr(struct clockframe *); | | | @@ -123,26 +123,39 @@ void bogusintr(struct clockframe *); |
123 | | | 123 | |
124 | /* | | 124 | /* |
125 | * Stray interrupt handler. Clear it if possible. | | 125 | * Stray interrupt handler. Clear it if possible. |
126 | * If not, and if we get 10 interrupts in 10 seconds, panic. | | 126 | * If not, and if we get 10 interrupts in 10 seconds, panic. |
127 | * XXXSMP: We are holding the kernel lock at entry & exit. | | 127 | * XXXSMP: We are holding the kernel lock at entry & exit. |
128 | */ | | 128 | */ |
129 | void | | 129 | void |
130 | strayintr(struct clockframe *fp) | | 130 | strayintr(struct clockframe *fp) |
131 | { | | 131 | { |
132 | static int straytime, nstray; | | 132 | static int straytime, nstray; |
133 | char bits[64]; | | 133 | char bits[64]; |
134 | int timesince; | | 134 | int timesince; |
135 | | | 135 | |
| | | 136 | #if defined(MULTIPROCESSOR) |
| | | 137 | /* |
| | | 138 | * XXX |
| | | 139 | * |
| | | 140 | * Don't whine about zs interrupts on MP. We sometimes get |
| | | 141 | * stray interrupts when polled kernel output on cpu>0 eats |
| | | 142 | * the interrupt and cpu0 sees it. |
| | | 143 | */ |
| | | 144 | #define ZS_INTR_IPL 12 |
| | | 145 | if (fp->ipl == ZS_INTR_IPL) |
| | | 146 | return; |
| | | 147 | #endif |
| | | 148 | |
136 | snprintb(bits, sizeof(bits), PSR_BITS, fp->psr); | | 149 | snprintb(bits, sizeof(bits), PSR_BITS, fp->psr); |
137 | printf("stray interrupt cpu%d ipl 0x%x pc=0x%x npc=0x%x psr=%s\n", | | 150 | printf("stray interrupt cpu%d ipl 0x%x pc=0x%x npc=0x%x psr=%s\n", |
138 | cpu_number(), fp->ipl, fp->pc, fp->npc, bits); | | 151 | cpu_number(), fp->ipl, fp->pc, fp->npc, bits); |
139 | | | 152 | |
140 | timesince = time_uptime - straytime; | | 153 | timesince = time_uptime - straytime; |
141 | if (timesince <= 10) { | | 154 | if (timesince <= 10) { |
142 | if (++nstray > 10) | | 155 | if (++nstray > 10) |
143 | panic("crazy interrupts"); | | 156 | panic("crazy interrupts"); |
144 | } else { | | 157 | } else { |
145 | straytime = time_uptime; | | 158 | straytime = time_uptime; |
146 | nstray = 1; | | 159 | nstray = 1; |
147 | } | | 160 | } |
148 | } | | 161 | } |