Module Name: src Committed By: martin Date: Mon Dec 28 20:02:30 UTC 2020
Modified Files: src/sys/arch/hp300/dev [netbsd-9]: dnkbd.c hil_intio.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.10.18.1 src/sys/arch/hp300/dev/dnkbd.c cvs rdiff -u -r1.3 -r1.3.64.1 src/sys/arch/hp300/dev/hil_intio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/hp300/dev/dnkbd.c diff -u src/sys/arch/hp300/dev/dnkbd.c:1.10 src/sys/arch/hp300/dev/dnkbd.c:1.10.18.1 --- src/sys/arch/hp300/dev/dnkbd.c:1.10 Sat Apr 8 17:04:56 2017 +++ src/sys/arch/hp300/dev/dnkbd.c Mon Dec 28 20:02:30 2020 @@ -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 @@ dnkbd_attach_subdevices(struct dnkbd_sof * 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 @@ dnkbd_attach_subdevices(struct dnkbd_sof ka.console = 1; #endif } else +#endif + { ka.console = 0; + } ka.keymap = &dnkbd_keymapdata; ka.accessops = &dnkbd_accessops; Index: src/sys/arch/hp300/dev/hil_intio.c diff -u src/sys/arch/hp300/dev/hil_intio.c:1.3 src/sys/arch/hp300/dev/hil_intio.c:1.3.64.1 --- src/sys/arch/hp300/dev/hil_intio.c:1.3 Sat Feb 19 05:36:49 2011 +++ src/sys/arch/hp300/dev/hil_intio.c Mon Dec 28 20:02:30 2020 @@ -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 @@ hil_intio_attach(device_t parent, device /* * 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);