From owner-svn-src-all@FreeBSD.ORG Thu Mar 19 16:11:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EC6A10658CE; Thu, 19 Mar 2009 16:11:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96FDD8FC24; Thu, 19 Mar 2009 16:11:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JGBExY068396; Thu, 19 Mar 2009 16:11:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JGBEh4068394; Thu, 19 Mar 2009 16:11:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903191611.n2JGBEh4068394@svn.freebsd.org> From: Marius Strobl Date: Thu, 19 Mar 2009 16:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190078 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb sparc64/include sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 16:11:23 -0000 Author: marius Date: Thu Mar 19 16:11:14 2009 New Revision: 190078 URL: http://svn.freebsd.org/changeset/base/190078 Log: MFC: r185109 Use the interrupt level right below PIL_FAST for executing interrupt filters instead of PIL_FAST and allow special filters and handlers for interrupts which need to be able to interrupt even filters, f.e. bus error interrupts, to be registered with the revived INTR_FAST at PIL_FAST. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sparc64/include/intr_machdep.h stable/7/sys/sparc64/sparc64/intr_machdep.c Modified: stable/7/sys/sparc64/include/intr_machdep.h ============================================================================== --- stable/7/sys/sparc64/include/intr_machdep.h Thu Mar 19 16:03:21 2009 (r190077) +++ stable/7/sys/sparc64/include/intr_machdep.h Thu Mar 19 16:11:14 2009 (r190078) @@ -47,8 +47,9 @@ #define PIL_AST 4 /* ast ipi */ #define PIL_STOP 5 /* stop cpu ipi */ #define PIL_PREEMPT 6 /* preempt idle thread cpu ipi */ +#define PIL_FILTER 12 /* filter interrupts */ #define PIL_FAST 13 /* fast interrupts */ -#define PIL_TICK 14 +#define PIL_TICK 14 /* tick interrupts */ #ifndef LOCORE Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/intr_machdep.c Thu Mar 19 16:03:21 2009 (r190077) +++ stable/7/sys/sparc64/sparc64/intr_machdep.c Thu Mar 19 16:11:14 2009 (r190078) @@ -89,7 +89,7 @@ struct intr_vector intr_vectors[IV_MAX]; uint16_t intr_countp[IV_MAX]; static u_long intr_stray_count[IV_MAX]; -static const char *pil_names[] = { +static const char *const pil_names[] = { "stray", "low", /* PIL_LOW */ "ithrd", /* PIL_ITHREAD */ @@ -97,7 +97,8 @@ static const char *pil_names[] = { "ast", /* PIL_AST */ "stop", /* PIL_STOP */ "preempt", /* PIL_PREEMPT */ - "stray", "stray", "stray", "stray", "stray", "stray", + "stray", "stray", "stray", "stray", "stray", + "filter", /* PIL_FILTER */ "fast", /* PIL_FAST */ "tick", /* PIL_TICK */ }; @@ -374,10 +375,16 @@ inthand_add(const char *name, int vec, d struct intr_event *ie; struct intr_handler *ih; struct intr_vector *iv; - int error, fast; + int error, filter; if (vec < 0 || vec >= IV_MAX) return (EINVAL); + /* + * INTR_FAST filters/handlers are special purpose only, allowing + * them to be shared just would complicate things unnecessarily. + */ + if ((flags & INTR_FAST) != 0 && (flags & INTR_EXCL) == 0) + return (EINVAL); sx_xlock(&intr_table_lock); iv = &intr_vectors[vec]; ic = iv->iv_ic; @@ -394,24 +401,25 @@ inthand_add(const char *name, int vec, d ic->ic_disable(iv); iv->iv_refcnt++; if (iv->iv_refcnt == 1) - intr_setup(filt != NULL ? PIL_FAST : PIL_ITHREAD, intr_fast, + intr_setup((flags & INTR_FAST) != 0 ? PIL_FAST : + filt != NULL ? PIL_FILTER : PIL_ITHREAD, intr_fast, vec, intr_execute_handlers, iv); else if (filt != NULL) { /* - * Check if we need to upgrade from PIL_ITHREAD to PIL_FAST. + * Check if we need to upgrade from PIL_ITHREAD to PIL_FILTER. * Given that apart from the on-board SCCs and UARTs shared * interrupts are rather uncommon on sparc64 this sould be * pretty rare in practice. */ - fast = 0; + filter = 0; TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { if (ih->ih_filter != NULL && ih->ih_filter != filt) { - fast = 1; + filter = 1; break; } } - if (fast == 0) - intr_setup(PIL_FAST, intr_fast, vec, + if (filter == 0) + intr_setup(PIL_FILTER, intr_fast, vec, intr_execute_handlers, iv); } intr_stray_count[vec] = 0;