Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_cons.c
Show First 20 Lines • Show All 626 Lines • ▼ Show 20 Lines | SYSCTL_INT(_kern, OID_AUTO, constty_wakeups_per_second, CTLFLAG_RW, | ||||
"Times per second to check for pending console tty messages"); | "Times per second to check for pending console tty messages"); | ||||
static void | static void | ||||
constty_timeout(void *arg) | constty_timeout(void *arg) | ||||
{ | { | ||||
int c; | int c; | ||||
if (constty != NULL) { | if (constty != NULL) { | ||||
tty_lock(constty); | ttydisc_lock(constty); | ||||
while ((c = msgbuf_getchar(&consmsgbuf)) != -1) { | while ((c = msgbuf_getchar(&consmsgbuf)) != -1) { | ||||
if (tty_putchar(constty, c) < 0) { | if (tty_putchar(constty, c) < 0) { | ||||
tty_unlock(constty); | ttydisc_unlock(constty); | ||||
constty = NULL; | constty = NULL; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
if (constty != NULL) | if (constty != NULL) | ||||
tty_unlock(constty); | ttydisc_unlock(constty); | ||||
} | } | ||||
if (constty != NULL) { | if (constty != NULL) { | ||||
callout_reset(&conscallout, hz / constty_wakeups_per_second, | callout_reset(&conscallout, hz / constty_wakeups_per_second, | ||||
constty_timeout, NULL); | constty_timeout, NULL); | ||||
} else { | } else { | ||||
/* Deallocate the constty buffer memory. */ | /* Deallocate the constty buffer memory. */ | ||||
constty_clear(); | constty_clear(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines |