PERFORCE change 112658 for review

Paolo Pisati piso at FreeBSD.org
Sun Jan 7 10:33:36 PST 2007


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

Change 112658 by piso at piso_newluxor on 2007/01/07 18:33:13

	Do not use empty stub functions: kill intr_eoi_src_stub() and
	intr_eoi_disab_src_stub(), check for NULL in 
	kerne_intr.c::intr_event_handle() instead.

Affected files ...

.. //depot/projects/soc2006/intr_filter/arm/arm/intr.c#18 edit
.. //depot/projects/soc2006/intr_filter/ia64/ia64/interrupt.c#18 edit
.. //depot/projects/soc2006/intr_filter/kern/kern_intr.c#30 edit
.. //depot/projects/soc2006/intr_filter/sparc64/sparc64/intr_machdep.c#18 edit
.. //depot/projects/soc2006/intr_filter/sys/interrupt.h#15 edit

Differences ...

==== //depot/projects/soc2006/intr_filter/arm/arm/intr.c#18 (text+ko) ====

@@ -78,7 +78,7 @@
 	event = intr_events[irq];
 	if (event == NULL) {
 		error = intr_event_create(&event, (void *)irq, 0,
-		    (void (*)(void *))arm_unmask_irq, NULL, intr_eoi_src_stub,
+		    (void (*)(void *))arm_unmask_irq, NULL, NULL,
 		    intr_disab_eoi_src, "intr%d:", irq);
 		if (error)
 			return;

==== //depot/projects/soc2006/intr_filter/ia64/ia64/interrupt.c#18 (text+ko) ====

@@ -329,7 +329,7 @@
 		}
 		errcode = intr_event_create(&i->event, (void *)vector, 0,
 		    (void (*)(void *))ia64_send_eoi, NULL, intr_eoi_src, 
-		    intr_disab_eoi_src_stub, "intr:");
+		    NULL, "intr:");
 		if (errcode) {
 			free(i, M_DEVBUF);
 			return errcode;

==== //depot/projects/soc2006/intr_filter/kern/kern_intr.c#30 (text+ko) ====

@@ -962,23 +962,6 @@
 	}
 }
 
-/* 
- * To avoid code duplication across different archs, use these functions 
- * for interrupt eoiing and disabling when you don't actually need to do
- * any real action on the interrupt controller.
- */
-void
-intr_eoi_src_stub(void *arg __unused)
-{ 
-	;
-}
-
-void
-intr_disab_eoi_src_stub(void *arg __unused)
-{
-	;
-}
-
 /*
  * Main interrupt handling body.
  *
@@ -1013,10 +996,13 @@
 	 * it unmasked. Otherwise, mask the source as well as sending
 	 * it an EOI.
 	 */
-	if (thread & FILTER_HANDLED)
-		ie->ie_eoi(ie->ie_source);
-	else
-		ie->ie_disab(ie->ie_source);
+	if (thread & FILTER_HANDLED) {
+		if (ie->ie_eoi != NULL)
+			ie->ie_eoi(ie->ie_source);
+	} else {
+		if (ie->ie_disab != NULL)
+			ie->ie_disab(ie->ie_source);
+	}
 	critical_exit();
 	
 	/* Interrupt storm logic */

==== //depot/projects/soc2006/intr_filter/sparc64/sparc64/intr_machdep.c#18 (text+ko) ====

@@ -304,7 +304,7 @@
 	mtx_unlock_spin(&intr_table_lock);
 	if (ie == NULL) {
 		errcode = intr_event_create(&ie, (void *)(intptr_t)vec, 0, NULL,
-		    NULL, intr_eoi_src_stub, intr_disab_eoi_src_stub, "vec%d:", 
+		    NULL, NULL, NULL, "vec%d:", 
 		    vec);
 		if (errcode)
 			return (errcode);

==== //depot/projects/soc2006/intr_filter/sys/interrupt.h#15 (text+ko) ====

@@ -119,8 +119,6 @@
 int     intr_filter_loop(struct intr_event *ie, struct trapframe *frame, 
 			 struct intr_thread **ithd);
 void    stray_detection(void *_arg);
-void    intr_eoi_src_stub(void *arg __unused);
-void    intr_disab_eoi_src_stub(void *arg __unused);
 int     intr_event_handle(struct intr_event *ie, struct trapframe *frame,
 	    void (*intr_eoi_src)(void *), void (*intr_disab_eoi_src)(void *));
 u_char	intr_priority(enum intr_type flags);


More information about the p4-projects mailing list