From owner-p4-projects@FreeBSD.ORG Fri Jan 12 03:16:21 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 08C6016A416; Fri, 12 Jan 2007 03:16:21 +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 AB68716A412 for ; Fri, 12 Jan 2007 03:16:20 +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 9C16B13C44C for ; Fri, 12 Jan 2007 03:16:20 +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 l0C3GK6j066973 for ; Fri, 12 Jan 2007 03:16:20 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l0C3GKab066970 for perforce@freebsd.org; Fri, 12 Jan 2007 03:16:20 GMT (envelope-from piso@freebsd.org) Date: Fri, 12 Jan 2007 03:16:20 GMT Message-Id: <200701120316.l0C3GKab066970@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 112803 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: Fri, 12 Jan 2007 03:16:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=112803 Change 112803 by piso@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) {