From owner-svn-src-all@FreeBSD.ORG Tue Sep 2 18:57:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFAE950B; Tue, 2 Sep 2014 18:57:19 +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 9B9C41399; Tue, 2 Sep 2014 18:57:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s82IvJtN098662; Tue, 2 Sep 2014 18:57:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s82IvJl1098661; Tue, 2 Sep 2014 18:57:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409021857.s82IvJl1098661@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 2 Sep 2014 18:57:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270975 - head/sys/dev/ofw 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-1 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: Tue, 02 Sep 2014 18:57:19 -0000 Author: jhb Date: Tue Sep 2 18:57:19 2014 New Revision: 270975 URL: http://svnweb.freebsd.org/changeset/base/270975 Log: Use callout(9) instead of timeout(9). Tested by: danfe Modified: head/sys/dev/ofw/ofw_console.c Modified: head/sys/dev/ofw/ofw_console.c ============================================================================== --- head/sys/dev/ofw/ofw_console.c Tue Sep 2 18:54:40 2014 (r270974) +++ head/sys/dev/ofw/ofw_console.c Tue Sep 2 18:57:19 2014 (r270975) @@ -60,8 +60,7 @@ static struct ttydevsw ofw_ttydevsw = { }; static int polltime; -static struct callout_handle ofw_timeouthandle - = CALLOUT_HANDLE_INITIALIZER(&ofw_timeouthandle); +static struct callout ofw_timer; #if defined(KDB) static int alt_break_state; @@ -101,6 +100,7 @@ cn_drvinit(void *unused) return; if (strlen(output) > 0) tty_makealias(tp, "%s", output); + callout_init_mtx(&ofw_timer, tty_getlock(tp), 0); } } @@ -116,7 +116,7 @@ ofwtty_open(struct tty *tp) if (polltime < 1) polltime = 1; - ofw_timeouthandle = timeout(ofw_timeout, tp, polltime); + callout_reset(&ofw_timer, polltime, ofw_timeout, tp); return (0); } @@ -125,8 +125,7 @@ static void ofwtty_close(struct tty *tp) { - /* XXX Should be replaced with callout_stop(9) */ - untimeout(ofw_timeout, tp, ofw_timeouthandle); + callout_stop(&ofw_timer); } static void @@ -151,13 +150,12 @@ ofw_timeout(void *v) tp = (struct tty *)v; - tty_lock(tp); + tty_lock_assert(tp, MA_OWNED); while ((c = ofw_cngetc(NULL)) != -1) ttydisc_rint(tp, c, 0); ttydisc_rint_done(tp); - tty_unlock(tp); - ofw_timeouthandle = timeout(ofw_timeout, tp, polltime); + callout_schedule(&ofw_timer, polltime); } static void