summaryrefslogtreecommitdiffstats
path: root/sys/dev/hil
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2005-12-22 07:09:49 +0000
committermiod <miod@openbsd.org>2005-12-22 07:09:49 +0000
commit2be62f2231343bbeb1579a40257dbc55c4ab8480 (patch)
tree0780e3a575e0104da5654f3b0ea8d2f9b8a00e42 /sys/dev/hil
parent1. when signalling a process group, don't deliver a copy to every thread (diff)
downloadwireguard-openbsd-2be62f2231343bbeb1579a40257dbc55c4ab8480.tar.xz
wireguard-openbsd-2be62f2231343bbeb1579a40257dbc55c4ab8480.zip
Postpone the hil console detection logic to the first detection of a keyboard.
On hp300, hil would claim console against dnkbd if no dnkbd was found at the time the loop is probed, even if the loop is empty. Because of this, plugging dnkbd later would not select it as console keyboard, which is really annoying on kernels without wsmux, such as hp300 RAMDISK. Now the first keyboard plugged will become the console keyboard, whatever its type. No functional change on hppa, since the console path gives a definite console device setting.
Diffstat (limited to 'sys/dev/hil')
-rw-r--r--sys/dev/hil/hil.c19
-rw-r--r--sys/dev/hil/hilvar.h6
2 files changed, 19 insertions, 6 deletions
diff --git a/sys/dev/hil/hil.c b/sys/dev/hil/hil.c
index 272b35b7ea9..f9989d7c44c 100644
--- a/sys/dev/hil/hil.c
+++ b/sys/dev/hil/hil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hil.c,v 1.20 2005/05/13 15:22:37 miod Exp $ */
+/* $OpenBSD: hil.c,v 1.21 2005/12/22 07:09:52 miod Exp $ */
/*
* Copyright (c) 2003, 2004, Miodrag Vallat.
* All rights reserved.
@@ -82,6 +82,8 @@
#include <dev/hil/hildevs.h>
#include <dev/hil/hildevs_data.h>
+#include "hilkbd.h"
+
/*
* splhigh is extremely conservative but insures atomic operation,
* splvm (clock only interrupts) seems to be good enough in practice.
@@ -140,7 +142,7 @@ hildatawait(struct hil_softc *sc)
*/
void
-hil_attach(struct hil_softc *sc, int hil_is_console)
+hil_attach(struct hil_softc *sc, int *hil_is_console)
{
printf("\n");
@@ -500,7 +502,7 @@ hilconfig(struct hil_softc *sc, u_int knowndevs)
if (sc->sc_cmdbuf[0] >= hd->minid &&
sc->sc_cmdbuf[0] <= hd->maxid) {
- ha.ha_console = sc->sc_console;
+ ha.ha_console = *sc->sc_console;
ha.ha_code = id;
ha.ha_type = hd->type;
ha.ha_descr = hd->descr;
@@ -510,6 +512,17 @@ hilconfig(struct hil_softc *sc, u_int knowndevs)
sc->sc_devices[id] = (struct hildev_softc *)
config_found_sm(&sc->sc_dev, &ha, hildevprint,
hilsubmatch);
+
+#if NHILKBD > 0
+ /*
+ * If we just attached a keyboard as console,
+ * console choice is not indeterminate anymore.
+ */
+ if (sc->sc_devices[id] != NULL &&
+ ha.ha_type == HIL_DEVICE_KEYBOARD &&
+ ha.ha_console != 0)
+ *sc->sc_console = 1;
+#endif
}
}
diff --git a/sys/dev/hil/hilvar.h b/sys/dev/hil/hilvar.h
index 9253bed0ba4..8b7c1ef0738 100644
--- a/sys/dev/hil/hilvar.h
+++ b/sys/dev/hil/hilvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: hilvar.h,v 1.8 2005/01/11 00:11:05 miod Exp $ */
+/* $OpenBSD: hilvar.h,v 1.9 2005/12/22 07:09:52 miod Exp $ */
/*
* Copyright (c) 2003, Miodrag Vallat.
* All rights reserved.
@@ -72,7 +72,7 @@ struct hil_softc {
struct device sc_dev;
bus_space_handle_t sc_bsh;
bus_space_tag_t sc_bst;
- int sc_console; /* console path set to hil */
+ int *sc_console; /* console path set to hil */
int sc_cmddone;
int sc_cmdending;
@@ -100,7 +100,7 @@ int send_hildev_cmd(struct hildev_softc *, u_int, u_int8_t *, u_int *);
void hil_set_poll(struct hil_softc *, int);
int hil_poll_data(struct hildev_softc *, u_int8_t *, u_int8_t *);
-void hil_attach(struct hil_softc *, int);
+void hil_attach(struct hil_softc *, int *);
void hil_attach_deferred(void *);
int hil_intr(void *);
int hildevprint(void *, const char *);