summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2014-09-02 18:57:19 +0000
committerjhb <jhb@FreeBSD.org>2014-09-02 18:57:19 +0000
commitcd84c2ff5b6de08d97719b8c1eee2c828fa65e06 (patch)
tree5f107b99c97266021deec55e5a8f1a716bd06000
parent7d4adb3d0b52c2830c5caffc306bfd487c4f8b2b (diff)
downloadFreeBSD-src-cd84c2ff5b6de08d97719b8c1eee2c828fa65e06.zip
FreeBSD-src-cd84c2ff5b6de08d97719b8c1eee2c828fa65e06.tar.gz
Use callout(9) instead of timeout(9).
Tested by: danfe
-rw-r--r--sys/dev/ofw/ofw_console.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c
index 7e02768..63d378b 100644
--- a/sys/dev/ofw/ofw_console.c
+++ b/sys/dev/ofw/ofw_console.c
@@ -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
OpenPOWER on IntegriCloud