PERFORCE change 112803 for review

Paolo Pisati piso at FreeBSD.org
Thu Jan 11 19:16:21 PST 2007


http://perforce.freebsd.org/chv.cgi?CH=112803

Change 112803 by piso at piso_longino on 2007/01/12 03:15:31

	o resurrect stray MD code lost during previous IFC
	o comment out old code (kept there as a reference)
	o fix compilation

Affected files ...

.. //depot/projects/soc2006/intr_filter/powerpc/powerpc/intr_machdep.c#25 edit

Differences ...

==== //depot/projects/soc2006/intr_filter/powerpc/powerpc/intr_machdep.c#25 (text+ko) ====

@@ -97,6 +97,8 @@
 
 static void (*irq_enable)(uintptr_t);
 static void intr_eoi_src(void *arg);
+extern struct callout stray_callout_handle;
+void intr_callout_reset(void);
 
 static void
 intrcnt_setname(const char *name, int index)
@@ -134,7 +136,7 @@
 }
 
 int
-inthand_add(const char *name, u_int irq, void (*handler)(void *), void *arg,
+inthand_add(const char *name, u_int irq, int (*filter)(void *), void (*handler)(void *), void *arg,
     int flags, void **cookiep)
 {
 	struct ppc_intr *i, *orphan;
@@ -155,7 +157,7 @@
 			return (ENOMEM);
 		error = intr_event_create(&i->event, (void *)irq, 0,
 		    (void (*)(void *))irq_enable, NULL, intr_eoi_src, 
-		    intr_disab_eoi_src, "irq%d:", irq);
+		    NULL, "irq%d:", irq);
 		if (error) {
 			free(i, M_INTR);
 			return (error);
@@ -180,7 +182,7 @@
 		}
 	}
 
-	error = intr_event_add_handler(i->event, name, handler, arg,
+	error = intr_event_add_handler(i->event, name, filter, handler, arg,
 	    intr_priority(flags), flags, cookiep);
 	if (!error)
 		intrcnt_setname(i->event->ie_fullname, i->cntidx);
@@ -194,7 +196,8 @@
 	return (intr_event_remove_handler(cookie));
 }
 
-__unused void
+#if 0
+void
 intr_handle_old(u_int irq)
 {
 	struct ppc_intr *i;
@@ -249,9 +252,10 @@
 		}
 	}
 }
+#endif
 
 static void
-stray_int(uint irq)
+stray_int(u_int irq)
 {
 
 	atomic_add_long(&intrcnt[0], 1);
@@ -273,6 +277,33 @@
 	irq_enable(nb);
 }
 
+static struct intr_event *
+walk_intr_ppc(void)
+{
+	struct ppc_intr *intr;
+	static int i = 0;
+	int j;
+
+	for (; i < ppc_nintrs; ) {
+		j = i++;
+		intr = ppc_intrs[j];
+		if (intr != NULL && intr->event != NULL)
+			return (intr->event);
+	}
+	i = 0;
+	return (NULL);
+}
+
+void
+intr_callout_reset(void) 
+{
+
+	mtx_lock_spin(&ppc_intrs_lock);
+	callout_reset(&stray_callout_handle, hz, &stray_detection, 
+	    &walk_intr_ppc);
+	mtx_unlock_spin(&ppc_intrs_lock);
+}
+
 void
 intr_handle(u_int irq)
 {


More information about the p4-projects mailing list