From owner-svn-src-all@FreeBSD.ORG Fri May 30 15:46:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FCECA39; Fri, 30 May 2014 15:46:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D02A234D; Fri, 30 May 2014 15:46:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UFkBZZ027772; Fri, 30 May 2014 15:46:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UFkB43027771; Fri, 30 May 2014 15:46:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405301546.s4UFkB43027771@svn.freebsd.org> From: John Baldwin Date: Fri, 30 May 2014 15:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266891 - head/sys/dev/cfe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 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: Fri, 30 May 2014 15:46:11 -0000 Author: jhb Date: Fri May 30 15:46:10 2014 New Revision: 266891 URL: http://svnweb.freebsd.org/changeset/base/266891 Log: Use callout_*() rather than timeout()/untimeout(). Reviewed by: imp Modified: head/sys/dev/cfe/cfe_console.c Modified: head/sys/dev/cfe/cfe_console.c ============================================================================== --- head/sys/dev/cfe/cfe_console.c Fri May 30 15:02:29 2014 (r266890) +++ head/sys/dev/cfe/cfe_console.c Fri May 30 15:46:10 2014 (r266891) @@ -62,8 +62,7 @@ static struct ttydevsw cfe_ttydevsw = { static int conhandle = -1; /* XXX does cfe have to poll? */ static int polltime; -static struct callout_handle cfe_timeouthandle - = CALLOUT_HANDLE_INITIALIZER(&cfe_timeouthandle); +static struct callout cfe_timer; #if defined(KDB) static int alt_break_state; @@ -89,6 +88,7 @@ cn_drvinit(void *unused) if (cfe_consdev.cn_pri != CN_DEAD && cfe_consdev.cn_name[0] != '\0') { tp = tty_alloc(&cfe_ttydevsw, NULL); + callout_init_mtx(&cfe_timer, tty_getlock(tp), 0); tty_makedev(tp, NULL, "cfecons"); } } @@ -99,7 +99,7 @@ cfe_tty_open(struct tty *tp) polltime = hz / CFECONS_POLL_HZ; if (polltime < 1) polltime = 1; - cfe_timeouthandle = timeout(cfe_timeout, tp, polltime); + callout_reset(&cfe_timer, polltime, cfe_timeout, tp); return (0); } @@ -108,8 +108,7 @@ static void cfe_tty_close(struct tty *tp) { - /* XXX Should be replaced with callout_stop(9) */ - untimeout(cfe_timeout, tp, cfe_timeouthandle); + callout_stop(&cfe_timer); } static void @@ -141,13 +140,12 @@ cfe_timeout(void *v) tp = (struct tty *)v; - tty_lock(tp); + tty_lock_assert(tp, MA_OWNED); while ((c = cfe_cngetc(NULL)) != -1) ttydisc_rint(tp, c, 0); ttydisc_rint_done(tp); - tty_unlock(tp); - cfe_timeouthandle = timeout(cfe_timeout, tp, polltime); + callout_reset(&cfe_timer, polltime, cfe_timeout, tp); } static void