summaryrefslogtreecommitdiffstats
path: root/sys/dev/cfe
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2014-05-30 15:46:10 +0000
committerjhb <jhb@FreeBSD.org>2014-05-30 15:46:10 +0000
commit725f0ee0bde88f4a9722f7b0f85cb4218ee26b68 (patch)
treeae3ef33d0b926d2087a32a9cbdbf82a0ae20512d /sys/dev/cfe
parent30105e96518e8d4585263b6028a1b645a5c0b28f (diff)
downloadFreeBSD-src-725f0ee0bde88f4a9722f7b0f85cb4218ee26b68.zip
FreeBSD-src-725f0ee0bde88f4a9722f7b0f85cb4218ee26b68.tar.gz
Use callout_*() rather than timeout()/untimeout().
Reviewed by: imp
Diffstat (limited to 'sys/dev/cfe')
-rw-r--r--sys/dev/cfe/cfe_console.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/dev/cfe/cfe_console.c b/sys/dev/cfe/cfe_console.c
index 485fd08..e42f087 100644
--- a/sys/dev/cfe/cfe_console.c
+++ b/sys/dev/cfe/cfe_console.c
@@ -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
OpenPOWER on IntegriCloud