Date: Thu, 4 Jan 2007 21:17:51 GMT From: Paolo Pisati <piso@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 112493 for review Message-ID: <200701042117.l04LHp3R031146@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=112493 Change 112493 by piso@piso_newluxor on 2007/01/04 21:17:24 Readd support for filters to powerpc - not compiled tough cause crosscompiling powerpc code from my amd64 seems broken. Affected files ... .. //depot/projects/soc2006/intr_filter/powerpc/powerpc/intr_machdep.c#16 edit Differences ... ==== //depot/projects/soc2006/intr_filter/powerpc/powerpc/intr_machdep.c#16 (text+ko) ==== @@ -192,8 +192,8 @@ return (intr_event_remove_handler(cookie)); } -void -intr_handle(u_int irq) +__unused void +intr_handle_old(u_int irq) { struct ppc_intr *i; struct intr_event *ie; @@ -247,3 +247,55 @@ } } } + +static void +stray_int(uint irq) +{ + + atomic_add_long(&intrcnt[0], 1); + if (intrcnt[0] <= MAX_STRAY_LOG) { + printf("stray irq %d\n", irq); + if (intrcnt[0] >= MAX_STRAY_LOG) { + printf("got %d stray interrupts, not" + "logging anymore\n", MAX_STRAY_LOG); + } + } +} + +void +intr_handle(u_int irq) +{ + struct ppc_intr *i; + struct intr_event *ie; + int error; + + i = ppc_intrs[irq]; + if (i == NULL) { + stray_int(irq); + return; + } + + atomic_add_long(i->cntp, 1); + + ie = i->event; + KASSERT(ie != NULL, ("%s: interrupt without an event", __func__)); + + res = mi_handle_intr(ie, NULL, intr_eoi_src_stub, + intr_disab_eoi_src_stub, NULL); + switch(res) { + case 0: + break; + case ECHILD: + irq_enable(irq); + break; + case EFAULT: + panic("%s: impossible stray interrupt", __func__); + break; + case EINVAL: + stray_int(irq); + break; + default: + printf("Ouch! Return code from mi_handle_intr()" + "not expected.\n"); + } +}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701042117.l04LHp3R031146>