PERFORCE change 112959 for review

Paolo Pisati piso at FreeBSD.org
Mon Jan 15 23:15:52 UTC 2007


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

Change 112959 by piso at piso_newluxor on 2007/01/15 23:15:43

	Looks like we don't need intr_table_lock while scanning
	through interrupt_sources[].
	While here, do some spacing and indentation according
	to style. 

Affected files ...

.. //depot/projects/soc2006/intr_filter/amd64/amd64/intr_machdep.c#21 edit

Differences ...

==== //depot/projects/soc2006/intr_filter/amd64/amd64/intr_machdep.c#21 (text+ko) ====

@@ -227,10 +227,13 @@
 walk_intr_src(void) {
 	struct intsrc *isrc;
 	static int i = 0;
+	int j;
 
-	for (; i<NUM_IO_INTS; ) {
-		int j = i++;
+	for (; i < NUM_IO_INTS;) {
+		j = i++;
+		mtx_lock_spin(&intr_table_lock);
 		isrc = interrupt_sources[j];
+		mtx_unlock_spin(&intr_table_lock);	
 		if (isrc != NULL && isrc->is_event != NULL)
 			return (isrc->is_event);
 	}
@@ -242,9 +245,8 @@
 intr_callout_reset(void)
 {
 
-	mtx_lock_spin(&intr_table_lock);
-	callout_reset(&stray_callout_handle, hz, &stray_detection, &walk_intr_src);
-	mtx_unlock_spin(&intr_table_lock);	
+	callout_reset(&stray_callout_handle, hz, &stray_detection, 
+	    &walk_intr_src);
 }
 
 void
@@ -397,7 +399,7 @@
 	intrcnt_index = 1;
 	STAILQ_INIT(&pics);
 	mtx_init(&intr_table_lock, "intr table", NULL, MTX_SPIN);
-	callout_init_mtx(&stray_callout_handle, &intr_table_lock, 0);
+	callout_init(&stray_callout_handle, 1);
 }
 SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL)
 


More information about the p4-projects mailing list