From owner-p4-projects@FreeBSD.ORG Tue Jan 16 10:11:50 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 36CBE16A47C; Tue, 16 Jan 2007 10:11:50 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E611F16A416 for ; Tue, 16 Jan 2007 10:11:49 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id D66E413C428 for ; Tue, 16 Jan 2007 10:11:49 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l0GABmYW081098 for ; Tue, 16 Jan 2007 10:11:48 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l0GABmDf081094 for perforce@freebsd.org; Tue, 16 Jan 2007 10:11:48 GMT (envelope-from piso@freebsd.org) Date: Tue, 16 Jan 2007 10:11:48 GMT Message-Id: <200701161011.l0GABmDf081094@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 112980 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2007 10:11:50 -0000 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