Changeset View
Changeset View
Standalone View
Standalone View
sys/riscv/riscv/riscv_console.c
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | cn_drvinit(void *unused) | ||||
if (riscv_consdev.cn_pri != CN_DEAD && | if (riscv_consdev.cn_pri != CN_DEAD && | ||||
riscv_consdev.cn_name[0] != '\0') { | riscv_consdev.cn_name[0] != '\0') { | ||||
tp = tty_alloc(&riscv_ttydevsw, NULL); | tp = tty_alloc(&riscv_ttydevsw, NULL); | ||||
tty_init_console(tp, 0); | tty_init_console(tp, 0); | ||||
tty_makedev(tp, NULL, "%s", "rcons"); | tty_makedev(tp, NULL, "%s", "rcons"); | ||||
polltime = 1; | polltime = 1; | ||||
callout_init(&riscv_callout, 1); | callout_init_mtx(&riscv_callout, ttydisc_getlock(tp), 0); | ||||
ttydisc_lock(tp); | |||||
callout_reset(&riscv_callout, polltime, riscv_timeout, NULL); | callout_reset(&riscv_callout, polltime, riscv_timeout, NULL); | ||||
ttydisc_unlock(tp); | |||||
} | } | ||||
} | } | ||||
SYSINIT(cndev, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, cn_drvinit, NULL); | SYSINIT(cndev, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, cn_drvinit, NULL); | ||||
static void | static void | ||||
riscvtty_outwakeup(struct tty *tp) | riscvtty_outwakeup(struct tty *tp) | ||||
{ | { | ||||
Show All 13 Lines | riscvtty_outwakeup(struct tty *tp) | ||||
} | } | ||||
} | } | ||||
static void | static void | ||||
riscv_timeout(void *v) | riscv_timeout(void *v) | ||||
{ | { | ||||
int c; | int c; | ||||
tty_lock(tp); | |||||
while ((c = riscv_cngetc(NULL)) != -1) | while ((c = riscv_cngetc(NULL)) != -1) | ||||
ttydisc_rint(tp, c, 0); | ttydisc_rint(tp, c, 0); | ||||
ttydisc_rint_done(tp); | ttydisc_rint_done(tp); | ||||
tty_unlock(tp); | |||||
callout_reset(&riscv_callout, polltime, riscv_timeout, NULL); | callout_reset(&riscv_callout, polltime, riscv_timeout, NULL); | ||||
} | } | ||||
static void | static void | ||||
riscv_cnprobe(struct consdev *cp) | riscv_cnprobe(struct consdev *cp) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |