diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2006-05-26 18:25:34 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2006-05-26 18:25:34 +0000 |
| commit | 05c3592e13991b031ac8923f30d0cf2792280b28 (patch) | |
| tree | 3f3cd595cd0f70677e1a66f528ea88d2ee17bc09 /sys | |
| parent | af8d1678e17e6c29ca7ac8be722c13358a573d0a (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/dev/ofw/ofw_console.c | 39 | ||||
| -rw-r--r-- | sys/dev/zs/zs.c | 14 | ||||
| -rw-r--r-- | sys/ia64/ia64/ssc.c | 26 |
3 files changed, 22 insertions, 57 deletions
diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c index b74832a3eb143..91ed16565b212 100644 --- a/sys/dev/ofw/ofw_console.c +++ b/sys/dev/ofw/ofw_console.c @@ -73,13 +73,13 @@ static int ofw_tty_param(struct tty *, struct termios *); static void ofw_tty_stop(struct tty *, int); static void ofw_timeout(void *); -static cn_probe_t ofw_cons_probe; -static cn_init_t ofw_cons_init; -static cn_getc_t ofw_cons_getc; -static cn_checkc_t ofw_cons_checkc; -static cn_putc_t ofw_cons_putc; +static cn_probe_t ofw_cnprobe; +static cn_init_t ofw_cninit; +static cn_term_t ofw_cnterm; +static cn_getc_t ofw_cngetc; +static cn_putc_t ofw_cnputc; -CONS_DRIVER(ofw, ofw_cons_probe, ofw_cons_init, NULL, ofw_cons_getc, +CONSOLE_DRIVER(ofw) ofw_cons_checkc, ofw_cons_putc, NULL); static void @@ -260,7 +260,7 @@ ofw_cons_probe(struct consdev *cp) } static void -ofw_cons_init(struct consdev *cp) +ofw_cninit(struct consdev *cp) { /* XXX: This is the alias, but that should be good enough */ @@ -268,30 +268,13 @@ ofw_cons_init(struct consdev *cp) cp->cn_tp = ofw_tp; } -static int -ofw_cons_getc(struct consdev *cp) +static void +ofw_cneterm(struct consdev *cp) { - unsigned char ch; - int l; - - ch = '\0'; - - while ((l = OF_read(stdin, &ch, 1)) != 1) { - if (l != -2 && l != 0) { - return (-1); - } - } - -#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) - if (kdb_alt_break(ch, &alt_break_state)) - kdb_enter("Break sequence on console"); -#endif - - return (ch); } static int -ofw_cons_checkc(struct consdev *cp) +ofw_cngetc(struct consdev *cp) { unsigned char ch; @@ -307,7 +290,7 @@ ofw_cons_checkc(struct consdev *cp) } static void -ofw_cons_putc(struct consdev *cp, int c) +ofw_cnputc(struct consdev *cp, int c) { char cbuf; diff --git a/sys/dev/zs/zs.c b/sys/dev/zs/zs.c index 11d4cca458199..199a26e5ff13f 100644 --- a/sys/dev/zs/zs.c +++ b/sys/dev/zs/zs.c @@ -129,7 +129,6 @@ static cn_probe_t zs_cnprobe; static cn_init_t zs_cninit; static cn_term_t zs_cnterm; static cn_getc_t zs_cngetc; -static cn_checkc_t zs_cncheckc; static cn_putc_t zs_cnputc; static int zstty_cngetc(struct zstty_softc *sc); @@ -155,8 +154,7 @@ static struct cdevsw zstty_cdevsw = { static struct zstty_softc *zstty_cons; -CONS_DRIVER(zs, zs_cnprobe, zs_cninit, zs_cnterm, zs_cngetc, zs_cncheckc, - zs_cnputc, NULL); +CONSOLE_DRIVER(zs); int zs_probe(device_t dev) @@ -835,16 +833,6 @@ zs_cngetc(struct consdev *cn) if (sc == NULL) return (-1); - return (zstty_cngetc(sc)); -} - -static int -zs_cncheckc(struct consdev *cn) -{ - struct zstty_softc *sc = zstty_cons; - - if (sc == NULL) - return (-1); return (zstty_cncheckc(sc)); } diff --git a/sys/ia64/ia64/ssc.c b/sys/ia64/ia64/ssc.c index 5d03b28dbb6d1..532254164525f 100644 --- a/sys/ia64/ia64/ssc.c +++ b/sys/ia64/ia64/ssc.c @@ -87,14 +87,19 @@ ssc(u_int64_t in0, u_int64_t in1, u_int64_t in2, u_int64_t in3, int which) } static void -ssccnprobe(struct consdev *cp) +ssc_cnprobe(struct consdev *cp) { sprintf(cp->cn_name, "ssccons"); cp->cn_pri = CN_INTERNAL; } static void -ssccninit(struct consdev *cp) +ssc_cninit(struct consdev *cp) +{ +} + +static void +ssc_cnterm(struct consdev *cp) { } @@ -108,24 +113,13 @@ ssccnattach(void *arg) SYSINIT(ssccnattach, SI_SUB_DRIVERS, SI_ORDER_ANY, ssccnattach, 0); static void -ssccnputc(struct consdev *cp, int c) +ssc_cnputc(struct consdev *cp, int c) { ssc(c, 0, 0, 0, SSC_PUTCHAR); } static int -ssccngetc(struct consdev *cp) -{ - int c; - do { - c = ssc(0, 0, 0, 0, SSC_GETCHAR); - } while (c == 0); - - return c; -} - -static int -ssccncheckc(struct consdev *cp) +ssc_cngetc(struct consdev *cp) { int c; c = ssc(0, 0, 0, 0, SSC_GETCHAR); @@ -243,4 +237,4 @@ ssctimeout(void *v) ssctimeouthandle = timeout(ssctimeout, tp, polltime); } -CONS_DRIVER(ssc, ssccnprobe, ssccninit, NULL, ssccngetc, ssccncheckc, ssccnputc, NULL); +CONSOLE_DRIVER(ssc); |
