Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/dev make sure we pass a valid consdev pointer...



details:   https://anonhg.NetBSD.org/src/rev/4e585583933a
branches:  trunk
changeset: 755386:4e585583933a
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Jun 04 06:04:15 2010 +0000

description:
make sure we pass a valid consdev pointer to the console keyboard so kbd
knows it's console and passes the right flags to wskbd, now the wskbd will
not drop off the mux when leaving event mode.
Symptoms: now the keyboard should no longer be dead when leaving X and there
          should be no more panics caused by it
I tested this on an SS5 and an SS20, may need some more attention and zs.c
sure could use some cleanup - there are a few differences to sparc64 that
really don't make much sense to me, like not passing console flags to zstty
which sparc64 does but sparc avoids, which caused this problem in the first
place.

diffstat:

 sys/arch/sparc/dev/zs.c |  17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diffs (46 lines):

diff -r 44cbb2b0dd62 -r 4e585583933a sys/arch/sparc/dev/zs.c
--- a/sys/arch/sparc/dev/zs.c   Fri Jun 04 05:42:24 2010 +0000
+++ b/sys/arch/sparc/dev/zs.c   Fri Jun 04 06:04:15 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zs.c,v 1.117 2010/01/17 16:23:43 tsutsui Exp $ */
+/*     $NetBSD: zs.c,v 1.118 2010/06/04 06:04:15 macallan Exp $        */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.117 2010/01/17 16:23:43 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.118 2010/06/04 06:04:15 macallan Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -454,6 +454,9 @@
                 * mouse line disciplines for SUN4 machines below.
                 * Also, don't set the console flags, otherwise we
                 * tell zstty_attach() to attach as console.
+                * XXX
+                * is this still necessary? sparc64 passes the console flags to
+                * zstty etc. 
                 */
                if (zsc->zsc_promunit == 1) {
                        if ((hwflags & ZS_HWFLAG_CONSOLE_INPUT) != 0 &&
@@ -535,8 +538,16 @@
                        struct tty *tp = zstty_get_tty_from_dev(child);
                        kma.kmta_tp = tp;
                        kma.kmta_dev = tp->t_dev;
-                       kma.kmta_consdev = zsc_args.consdev;
 
+                       /*
+                        * we need to pass a consdev since that's how kbd knows
+                        * it's the console keyboard
+                        */
+                       if (hwflags & ZS_HWFLAG_CONSOLE_INPUT) {
+                               kma.kmta_consdev = &zs_consdev;
+                       } else
+                               kma.kmta_consdev = zsc_args.consdev;
+                       
                        /* Attach 'em if we got 'em. */
 #if (NKBD > 0)
                        if (channel == 0) {



Home | Main Index | Thread Index | Old Index