Module Name:    src
Committed By:   uebayasi
Date:           Tue Jun 18 08:48:55 UTC 2013

Modified Files:
        src/sys/arch/i386/eisa: eisa_machdep.c

Log Message:
port-i386/47907: kernel trap when using EISA with I/O APIC on i386

Patch from Felix Deichmann.

XXX pullup netbsd-6


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/i386/eisa/eisa_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/i386/eisa/eisa_machdep.c
diff -u src/sys/arch/i386/eisa/eisa_machdep.c:1.37 src/sys/arch/i386/eisa/eisa_machdep.c:1.38
--- src/sys/arch/i386/eisa/eisa_machdep.c:1.37	Thu Sep  1 15:10:31 2011
+++ src/sys/arch/i386/eisa/eisa_machdep.c	Tue Jun 18 08:48:54 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: eisa_machdep.c,v 1.37 2011/09/01 15:10:31 christos Exp $	*/
+/*	$NetBSD: eisa_machdep.c,v 1.38 2013/06/18 08:48:54 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: eisa_machdep.c,v 1.37 2011/09/01 15:10:31 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: eisa_machdep.c,v 1.38 2013/06/18 08:48:54 uebayasi Exp $");
 
 #include "ioapic.h"
 
@@ -106,7 +106,7 @@ void
 eisa_attach_hook(device_t parent, device_t self,
     struct eisabus_attach_args *eba)
 {
-	extern int eisa_has_been_seen; 
+	extern int eisa_has_been_seen;
 
 	/*
 	 * Notify others that might need to know that the EISA bus
@@ -176,7 +176,6 @@ eisa_intr_string(eisa_chipset_tag_t ec, 
 	snprintf(irqstr, sizeof(irqstr), "irq %d", ih);
 #endif
 	return (irqstr);
-	
 }
 
 const struct evcnt *
@@ -199,12 +198,13 @@ eisa_intr_establish(eisa_chipset_tag_t e
 
 #if NIOAPIC > 0
 	if (ih & APIC_INT_VIA_APIC) {
-		pic = (struct pic *)ioapic_find(APIC_IRQ_APIC(ih));
-		if (pic == NULL) {
-			aprint_error("eisa_intr_establish: bad ioapic %d\n",
+		struct ioapic_softc * const ioapic = ioapic_find(APIC_IRQ_APIC(ih));
+		if (ioapic == NULL) {
+			aprint_normal("eisa_intr_establish: bad ioapic %d\n",
 			    APIC_IRQ_APIC(ih));
 			return NULL;
 		}
+		pic = &ioapic->sc_pic;
 		pin = APIC_IRQ_PIN(ih);
 		irq = APIC_IRQ_LEGACY_IRQ(ih);
 		if (irq < 0 || irq >= NUM_LEGACY_IRQS)

Reply via email to