Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2007 10:11:48 GMT
From:      Paolo Pisati <piso@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 112980 for review
Message-ID:  <200701161011.l0GABmDf081094@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=112980

Change 112980 by piso@piso_newluxor on 2007/01/16 10:10:55

	Move spin lock acquisition inside the interrupt scanning
	function.
	While here, fix spacing and indentation.

Affected files ...

.. //depot/projects/soc2006/intr_filter/ia64/ia64/interrupt.c#20 edit

Differences ...

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

@@ -273,7 +273,7 @@
 {
 
 	mtx_init(&ia64_intrs_lock, "intr table", NULL, MTX_SPIN);
-	callout_init_mtx(&stray_callout_handle, &ia64_intrs_lock, 0);
+	callout_init(&stray_callout_handle, 1);
 }
 SYSINIT(ithds_init, SI_SUB_INTR, SI_ORDER_SECOND, ithds_init, NULL);
 
@@ -361,10 +361,13 @@
 walk_intr_ia64(void) {
 	struct ia64_intr *ia64_i;
 	static int i = 0;
+	int j;
 
-	for (; i < IA64_NUMI; ) {
-		int j = i++;
+	for (; i < IA64_NUMI;) {
+		j = i++;
+		mtx_lock_spin(&ia64_intrs_lock);
 		ia64_i = ia64_intrs[j];
+		mtx_unlock_spin(&ia64_intrs_lock);
 		if (ia64_i != NULL && ia64_i->event != NULL)
 			return (ia64_i->event);
 	}
@@ -374,12 +377,10 @@
 
 void
 intr_callout_reset(void) 
-{
-	
-	mtx_lock_spin(&ia64_intrs_lock);
+{	
+
 	callout_reset(&stray_callout_handle, hz, 
-		      &stray_detection, &walk_intr_ia64);
-	mtx_unlock_spin(&ia64_intrs_lock);	
+	    &stray_detection, &walk_intr_ia64);
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701161011.l0GABmDf081094>