Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/arch/hp300/dev Pull up following revision(s) (request...



details:   https://anonhg.NetBSD.org/src/rev/0917ef945aa7
branches:  netbsd-9
changeset: 948678:0917ef945aa7
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Dec 28 20:02:30 2020 +0000

description:
Pull up following revision(s) (requested by tsutsui in ticket #1161):

        sys/arch/hp300/dev/dnkbd.c: revision 1.11
        sys/arch/hp300/dev/hil_intio.c: revision 1.4

Fix a longstanding bug in hilkbd (and dnkbd) console attachment.
cn_tab->cn_dev is initialized in wsdisplay_emul_attach()
(but not in wsdiaplay_cnattach()) so it cannot be used
when hil(4) is attached before wsdisplay(4) is attached.

Instead, use exported wsdisplay_cnputc() that is actually
set in early wsdisplay_cnattach().

Now we can use ddb and RB_ASKNAME via HIL keyboard console.

Should be pulleld up to netbsd-8 and netbsd-9.

diffstat:

 sys/arch/hp300/dev/dnkbd.c     |  15 ++++++++++++---
 sys/arch/hp300/dev/hil_intio.c |  13 +++++++++++--
 2 files changed, 23 insertions(+), 5 deletions(-)

diffs (93 lines):

diff -r f3cbb3cd528b -r 0917ef945aa7 sys/arch/hp300/dev/dnkbd.c
--- a/sys/arch/hp300/dev/dnkbd.c        Mon Dec 28 16:00:51 2020 +0000
+++ b/sys/arch/hp300/dev/dnkbd.c        Mon Dec 28 20:02:30 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dnkbd.c,v 1.10 2017/04/08 17:04:56 tsutsui Exp $       */
+/*     $NetBSD: dnkbd.c,v 1.10.18.1 2020/12/28 20:02:30 martin Exp $   */
 /*     $OpenBSD: dnkbd.c,v 1.17 2009/07/23 21:05:56 blambert Exp $     */
 
 /*
@@ -69,6 +69,9 @@
 
 #include "opt_wsdisplay_compat.h"
 
+#include "wsdisplay.h"
+#include "wsmouse.h"
+
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
@@ -87,7 +90,9 @@
 #include <dev/wscons/wskbdvar.h>
 #include <dev/wscons/wsksymdef.h>
 #include <dev/wscons/wsksymvar.h>
-#include "wsmouse.h"
+#if NWSDISPLAY > 0
+#include <dev/wscons/wsdisplayvar.h>
+#endif
 #if NWSMOUSE > 0
 #include <dev/wscons/wsmousevar.h>
 #endif
@@ -354,7 +359,8 @@
         * plugged), unless the console keyboard has been claimed already
         * (i.e. late hotplug with hil keyboard plugged first).
         */
-       if (major(cn_tab->cn_dev) == devsw_name2chr("wsdisplay", NULL, 0)) {
+#if NWSDISPLAY > 0
+       if (cn_tab->cn_putc == wsdisplay_cnputc) {
 #if NHILKBD > 0
                if (hil_is_console == -1) {
                        ka.console = 1;
@@ -365,7 +371,10 @@
                ka.console = 1;
 #endif
        } else
+#endif
+       {
                ka.console = 0;
+       }
 
        ka.keymap = &dnkbd_keymapdata;
        ka.accessops = &dnkbd_accessops;
diff -r f3cbb3cd528b -r 0917ef945aa7 sys/arch/hp300/dev/hil_intio.c
--- a/sys/arch/hp300/dev/hil_intio.c    Mon Dec 28 16:00:51 2020 +0000
+++ b/sys/arch/hp300/dev/hil_intio.c    Mon Dec 28 20:02:30 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hil_intio.c,v 1.3 2011/02/19 05:36:49 tsutsui Exp $    */
+/*     $NetBSD: hil_intio.c,v 1.3.64.1 2020/12/28 20:02:30 martin Exp $        */
 /*     $OpenBSD: hil_intio.c,v 1.8 2007/01/06 20:10:57 miod Exp $      */
 
 /*
@@ -28,6 +28,8 @@
  *
  */
 
+#include "wsdisplay.h"
+
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
@@ -38,6 +40,9 @@
 #include <machine/intr.h>
 
 #include <dev/cons.h>
+#if NWSDISPLAY > 0
+#include <dev/wscons/wsdisplayvar.h>
+#endif
 
 #include <hp300/dev/intiovar.h>
 
@@ -88,8 +93,12 @@
        /*
         * Check that the configured console device is a wsdisplay.
         */
-       if (major(cn_tab->cn_dev) != devsw_name2chr("wsdisplay", NULL, 0))
+#if NWSDISPLAY > 0
+       if (cn_tab->cn_putc != wsdisplay_cnputc)
+#endif
+       {
                hil_is_console = 0;
+       }
 
        hil_attach(sc, &hil_is_console);
        intr_establish(hil_intr, sc, ia->ia_ipl, IPL_TTY);



Home | Main Index | Thread Index | Old Index