From owner-p4-projects@FreeBSD.ORG Thu Jul 27 16:16:31 2006 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 63C2D16A4E0; Thu, 27 Jul 2006 16:16:31 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 394AE16A4DD for ; Thu, 27 Jul 2006 16:16:31 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9A7543D5A for ; Thu, 27 Jul 2006 16:16:30 +0000 (GMT) (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 k6RGGUIi090191 for ; Thu, 27 Jul 2006 16:16:30 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6RGGUtl090188 for perforce@freebsd.org; Thu, 27 Jul 2006 16:16:30 GMT (envelope-from piso@freebsd.org) Date: Thu, 27 Jul 2006 16:16:30 GMT Message-Id: <200607271616.k6RGGUtl090188@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 102570 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: Thu, 27 Jul 2006 16:16:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=102570 Change 102570 by piso@piso_newluxor on 2006/07/27 16:16:12 Turn fast+taskqueue handler into filter+ithread. Affected files ... .. //depot/projects/soc2006/intr_filter/dev/aac/aac.c#5 edit Differences ... ==== //depot/projects/soc2006/intr_filter/dev/aac/aac.c#5 (text+ko) ==== @@ -75,6 +75,7 @@ /* Command Processing */ static void aac_timeout(struct aac_softc *sc); static void aac_complete(void *context, int pending); +static void aac_complete_wrapper(void *context); static int aac_bio_command(struct aac_softc *sc, struct aac_command **cmp); static void aac_bio_complete(struct aac_command *cm); static int aac_wait_command(struct aac_command *cm); @@ -313,7 +314,7 @@ } else { if (bus_setup_intr(sc->aac_dev, sc->aac_irq, INTR_TYPE_BIO, - aac_fast_intr, NULL, + aac_fast_intr, aac_complete_wrapper, sc, &sc->aac_intr)) { device_printf(sc->aac_dev, "can't set up FAST interrupt\n"); @@ -786,7 +787,7 @@ { struct aac_softc *sc; u_int16_t reason; - int flag = 0; + int ret = 0; debug_called(2); @@ -802,14 +803,12 @@ AAC_CLEAR_ISTATUS(sc, reason); /* handle completion processing */ - if (reason & AAC_DB_RESPONSE_READY) { - flag = 1; - taskqueue_enqueue_fast(taskqueue_fast, &sc->aac_task_complete); - } + if (reason & AAC_DB_RESPONSE_READY) + ret = FILTER_HANDLED | FILTER_SCHEDULE_THREAD; /* controller wants to talk to us */ if (reason & (AAC_DB_PRINTF | AAC_DB_COMMAND_READY)) { - flag = 1; + ret |= FILTER_HANDLED; /* * XXX Make sure that we don't get fooled by strange messages * that start with a NULL. @@ -827,7 +826,7 @@ */ wakeup(sc->aifthread); } - return((flag)?FILTER_HANDLED:FILTER_STRAY); + return((ret)?ret:FILTER_STRAY); } void @@ -1092,6 +1091,12 @@ mtx_unlock(&sc->aac_io_lock); } +static void +aac_complete_wrapper(void *context) +{ + aac_complete(context, 0); +} + /* * Handle a bio submitted from a disk device. */