Mon Aug 1 10:42:24 2011 UTC ()
if checking whether an interrupt is shared, don't compare pin numbers
if it is "-1" -- this is a hack to allow MSIs which don't have a concept
of pin numbers, and are generally not shared
(This doesn't give us sensible event names for statistics display. The
whole abstraction has more exceptions than regular cases, it should
be redesigned imho.)


(drochner)
diff -r1.42 -r1.43 src/sys/arch/x86/include/intr.h
diff -r1.71 -r1.72 src/sys/arch/x86/x86/intr.c

cvs diff -r1.42 -r1.43 src/sys/arch/x86/include/intr.h (expand / switch to context diff)
--- src/sys/arch/x86/include/intr.h 2011/04/03 22:29:27 1.42
+++ src/sys/arch/x86/include/intr.h 2011/08/01 10:42:23 1.43
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.42 2011/04/03 22:29:27 dyoung Exp $	*/
+/*	$NetBSD: intr.h,v 1.43 2011/08/01 10:42:23 drochner Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -73,7 +73,8 @@
 
 struct intrsource {
 	int is_maxlevel;		/* max. IPL for this source */
-	int is_pin;			/* IRQ for legacy; pin for IO APIC */
+	int is_pin;			/* IRQ for legacy; pin for IO APIC,
+					   -1 for MSI */
 	struct intrhand *is_handlers;	/* handler chain */
 	struct pic *is_pic;		/* originating PIC */
 	void *is_recurse;		/* entry for spllower */

cvs diff -r1.71 -r1.72 src/sys/arch/x86/x86/intr.c (expand / switch to context diff)
--- src/sys/arch/x86/x86/intr.c 2011/04/03 22:29:27 1.71
+++ src/sys/arch/x86/x86/intr.c 2011/08/01 10:42:24 1.72
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.71 2011/04/03 22:29:27 dyoung Exp $	*/
+/*	$NetBSD: intr.c,v 1.72 2011/08/01 10:42:24 drochner Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.71 2011/04/03 22:29:27 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.72 2011/08/01 10:42:24 drochner Exp $");
 
 #include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
@@ -480,7 +480,8 @@
 			if ((isp = ci->ci_isources[slot]) == NULL) {
 				continue;
 			}
-			if (isp->is_pic == pic && isp->is_pin == pin) {
+			if (isp->is_pic == pic &&
+			    pin != -1 && isp->is_pin == pin) {
 				*idt_slot = isp->is_idtvec;
 				*index = slot;
 				*cip = ci;