Wed Jul 27 21:50:16 2011 UTC ()
Don't attach same ivec's event coutner more than once.  They are
difficult to distinguish since they are handled by intr_list_handler.


(nakayama)
diff -r1.64 -r1.65 src/sys/arch/sparc64/sparc64/intr.c

cvs diff -r1.64 -r1.65 src/sys/arch/sparc64/sparc64/intr.c (expand / switch to unified diff)

--- src/sys/arch/sparc64/sparc64/intr.c 2011/07/20 12:06:00 1.64
+++ src/sys/arch/sparc64/sparc64/intr.c 2011/07/27 21:50:16 1.65
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: intr.c,v 1.64 2011/07/20 12:06:00 macallan Exp $ */ 1/* $NetBSD: intr.c,v 1.65 2011/07/27 21:50:16 nakayama 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.64 2011/07/20 12:06:00 macallan Exp $"); 44__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.65 2011/07/27 21:50:16 nakayama 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>
@@ -176,27 +176,27 @@ intr_establish(int level, bool mpsafe, s @@ -176,27 +176,27 @@ intr_establish(int level, bool mpsafe, s
176 */ 176 */
177 ih->ih_pil = level; /* XXXX caller should have done this before */ 177 ih->ih_pil = level; /* XXXX caller should have done this before */
178 ih->ih_pending = 0; /* XXXX caller should have done this before */ 178 ih->ih_pending = 0; /* XXXX caller should have done this before */
179 ih->ih_next = NULL; 179 ih->ih_next = NULL;
180#ifdef DEBUG 180#ifdef DEBUG
181 printf("%s: level %x ivec %x\n", __func__, level, ih->ih_ivec); 181 printf("%s: level %x ivec %x\n", __func__, level, ih->ih_ivec);
182#endif 182#endif
183 /* 183 /*
184 * no need for a separate counter if ivec == 0, in that case there's 184 * no need for a separate counter if ivec == 0, in that case there's
185 * either only one device using the interrupt level and there's already 185 * either only one device using the interrupt level and there's already
186 * a counter for it or it's something special like psycho's error 186 * a counter for it or it's something special like psycho's error
187 * interrupts 187 * interrupts
188 */ 188 */
189 if (ih->ih_ivec != 0) { 189 if (ih->ih_ivec != 0 && intrlev[ih->ih_number] == NULL) {
190 snprintf(ih->ih_name, sizeof(ih->ih_name), "%x", ih->ih_ivec); 190 snprintf(ih->ih_name, sizeof(ih->ih_name), "%x", ih->ih_ivec);
191 evcnt_attach_dynamic(&ih->ih_cnt, EVCNT_TYPE_INTR, 191 evcnt_attach_dynamic(&ih->ih_cnt, EVCNT_TYPE_INTR,
192 &intr_evcnts[level], "ivec", ih->ih_name); 192 &intr_evcnts[level], "ivec", ih->ih_name);
193 } 193 }
194 194
195#ifdef MULTIPROCESSOR 195#ifdef MULTIPROCESSOR
196 if (!mpsafe) { 196 if (!mpsafe) {
197 ih->ih_realarg = ih->ih_arg; 197 ih->ih_realarg = ih->ih_arg;
198 ih->ih_realfun = ih->ih_fun; 198 ih->ih_realfun = ih->ih_fun;
199 ih->ih_arg = ih; 199 ih->ih_arg = ih;
200 ih->ih_fun = intr_biglock_wrapper; 200 ih->ih_fun = intr_biglock_wrapper;
201 } 201 }
202#endif 202#endif