Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Check for console input and output separately.



details:   https://anonhg.NetBSD.org/src/rev/4e16a04e4665
branches:  trunk
changeset: 483829:4e16a04e4665
user:      pk <pk%NetBSD.org@localhost>
date:      Sun Mar 19 12:42:45 2000 +0000

description:
Check for console input and output separately.
XXX - split input/output for /dev/console is not yet supported.

diffstat:

 sys/dev/ic/z8530tty.c |  38 +++++++++++++++++++++++++++++---------
 1 files changed, 29 insertions(+), 9 deletions(-)

diffs (79 lines):

diff -r c0dd6e9e3380 -r 4e16a04e4665 sys/dev/ic/z8530tty.c
--- a/sys/dev/ic/z8530tty.c     Sun Mar 19 12:39:47 2000 +0000
+++ b/sys/dev/ic/z8530tty.c     Sun Mar 19 12:42:45 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: z8530tty.c,v 1.63 2000/03/14 21:20:52 jdc Exp $        */
+/*     $NetBSD: z8530tty.c,v 1.64 2000/03/19 12:42:45 pk Exp $ */
 
 /*-
  * Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999
@@ -273,6 +273,7 @@
        struct tty *tp;
        int channel, s, tty_unit;
        dev_t dev;
+       char *i, *o;
 
        tty_unit = zst->zst_dev.dv_unit;
        channel = args->channel;
@@ -288,26 +289,45 @@
        if (zst->zst_swflags)
                printf(" flags 0x%x", zst->zst_swflags);
 
-       if (ISSET(zst->zst_hwflags, ZS_HWFLAG_CONSOLE)) {
-               printf(" (console)\n");
-               DELAY(20000);
+       /*
+        * Check whether we serve as a console device.
+        * XXX - split console input/output channels aren't
+        *       supported yet on /dev/console
+        */
+       i = o = NULL;
+       if ((zst->zst_hwflags & ZS_HWFLAG_CONSOLE_INPUT) != 0) {
+               i = "input";
+               if ((args->hwflags & ZS_HWFLAG_USE_CONSDEV) != 0) {
+                       cn_tab->cn_pollc = args->consdev->cn_pollc;
+                       cn_tab->cn_getc = args->consdev->cn_getc;
+               }
                cn_tab->cn_dev = dev;
-       } else
+       }
+       if ((zst->zst_hwflags & ZS_HWFLAG_CONSOLE_OUTPUT) != 0) {
+               o = "output";
+               if ((args->hwflags & ZS_HWFLAG_USE_CONSDEV) != 0) {
+                       cn_tab->cn_putc = args->consdev->cn_putc;
+               }
+               cn_tab->cn_dev = dev;
+       }
+       if (i != NULL || o != NULL)
+               printf(" (console %s)", i ? (o ? "i/o" : i) : o);
+
 #ifdef KGDB
        if (zs_check_kgdb(cs, dev)) {
                /*
                 * Allow kgdb to "take over" this port.  Returns true
                 * if this serial port is in-use by kgdb.
                 */
-               printf(" (kgdb)\n");
+               printf(" (kgdb)");
                /*
                 * This is the kgdb port (exclusive use)
                 * so skip the normal attach code.
                 */
                return;
-       } else
+       }
 #endif
-               printf("\n");
+       printf("\n");
 
        tp = ttymalloc();
        tp->t_dev = dev;
@@ -1477,7 +1497,7 @@
         * even when interrupts are locking up the machine.
         */
        if (ISSET(rr0, ZSRR0_BREAK) &&
-           ISSET(zst->zst_hwflags, ZS_HWFLAG_CONSOLE)) {
+           ISSET(zst->zst_hwflags, ZS_HWFLAG_CONSOLE_INPUT)) {
                zs_abort(cs);
                return;
        }



Home | Main Index | Thread Index | Old Index