Convert to new console api

This commit is contained in:
Poul-Henning Kamp 2006-05-26 13:54:27 +00:00
parent a58a1ea03d
commit 7672c95932
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158960
3 changed files with 20 additions and 34 deletions

View File

@ -217,15 +217,13 @@ static int update_kbd_state(scr_stat *scp, int state, int mask);
static int update_kbd_leds(scr_stat *scp, int which);
static timeout_t blink_screen;
static cn_probe_t sccnprobe;
static cn_init_t sccninit;
static cn_getc_t sccngetc;
static cn_checkc_t sccncheckc;
static cn_putc_t sccnputc;
static cn_term_t sccnterm;
static cn_probe_t sc_cnprobe;
static cn_init_t sc_cninit;
static cn_term_t sc_cnterm;
static cn_getc_t sc_cngetc;
static cn_putc_t sc_cnputc;
CONS_DRIVER(sc, sccnprobe, sccninit, sccnterm, sccngetc, sccncheckc, sccnputc,
NULL);
CONSOLE_DRIVER(sc);
static d_open_t scopen;
static d_close_t scclose;
@ -1404,7 +1402,7 @@ scstart(struct tty *tp)
}
static void
sccnprobe(struct consdev *cp)
sc_cnprobe(struct consdev *cp)
{
int unit;
int flags;
@ -1426,7 +1424,7 @@ sccnprobe(struct consdev *cp)
}
static void
sccninit(struct consdev *cp)
sc_cninit(struct consdev *cp)
{
int unit;
int flags;
@ -1439,7 +1437,7 @@ sccninit(struct consdev *cp)
}
static void
sccnterm(struct consdev *cp)
sc_cnterm(struct consdev *cp)
{
/* we are not the kernel console any more, release everything */
@ -1457,7 +1455,7 @@ sccnterm(struct consdev *cp)
}
static void
sccnputc(struct consdev *cd, int c)
sc_cnputc(struct consdev *cd, int c)
{
u_char buf[1];
scr_stat *scp = sc_console;
@ -1499,13 +1497,7 @@ sccnputc(struct consdev *cd, int c)
}
static int
sccngetc(struct consdev *cd)
{
return sccngetch(0);
}
static int
sccncheckc(struct consdev *cd)
sc_cngetc(struct consdev *cd)
{
return sccngetch(SCGETC_NONBLOCK);
}

View File

@ -54,11 +54,9 @@ static cn_probe_t uart_cnprobe;
static cn_init_t uart_cninit;
static cn_term_t uart_cnterm;
static cn_getc_t uart_cngetc;
static cn_checkc_t uart_cncheckc;
static cn_putc_t uart_cnputc;
CONS_DRIVER(uart, uart_cnprobe, uart_cninit, uart_cnterm, uart_cngetc,
uart_cncheckc, uart_cnputc, NULL);
CONSOLE_DRIVER(uart);
static struct uart_devinfo uart_console;
@ -117,18 +115,11 @@ uart_cnputc(struct consdev *cp, int c)
uart_putc(cp->cn_arg, c);
}
static int
uart_cncheckc(struct consdev *cp)
{
return (uart_poll(cp->cn_arg));
}
static int
uart_cngetc(struct consdev *cp)
{
return (uart_getc(cp->cn_arg));
return (uart_poll(cp->cn_arg));
}
static int

View File

@ -82,8 +82,13 @@ gdb_cninit(struct consdev *cp)
}
}
static void
gdb_cnterm(struct consdev *cp)
{
}
static int
gdb_nogetc(struct consdev *cp)
gdb_cngetc(struct consdev *cp)
{
return -1;
}
@ -154,9 +159,7 @@ gdb_cnputc(struct consdev *cp, int c)
}
}
/* NB: no get interface, we supply nogetc for checkc too */
CONS_DRIVER(gdb, gdb_cnprobe, gdb_cninit, NULL, gdb_nogetc, gdb_nogetc,
gdb_cnputc, NULL);
CONSOLE_DRIVER(gdb);
/*
* Our console device only gets attached if the system is booted