PERFORCE change 112493 for review
Paolo Pisati
piso at FreeBSD.org
Thu Jan 4 13:17:52 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=112493
Change 112493 by piso at 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");
+ }
+}
More information about the p4-projects
mailing list