diff options
author | 2005-12-22 07:09:49 +0000 | |
---|---|---|
committer | 2005-12-22 07:09:49 +0000 | |
commit | 2be62f2231343bbeb1579a40257dbc55c4ab8480 (patch) | |
tree | 0780e3a575e0104da5654f3b0ea8d2f9b8a00e42 | |
parent | 1. when signalling a process group, don't deliver a copy to every thread (diff) | |
download | wireguard-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.
-rw-r--r-- | sys/arch/hp300/dev/hil_intio.c | 16 | ||||
-rw-r--r-- | sys/arch/hppa/gsc/hil_gsc.c | 17 | ||||
-rw-r--r-- | sys/dev/hil/hil.c | 19 | ||||
-rw-r--r-- | sys/dev/hil/hilvar.h | 6 |
4 files changed, 34 insertions, 24 deletions
diff --git a/sys/arch/hp300/dev/hil_intio.c b/sys/arch/hp300/dev/hil_intio.c index 0362f616779..3f17de0ebd7 100644 --- a/sys/arch/hp300/dev/hil_intio.c +++ b/sys/arch/hp300/dev/hil_intio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hil_intio.c,v 1.5 2005/11/16 21:37:02 miod Exp $ */ +/* $OpenBSD: hil_intio.c,v 1.6 2005/12/22 07:09:49 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat. @@ -68,7 +68,7 @@ static int hil_matched = 0; } struct isr hil_isr; -int hil_is_console = -1; +int hil_is_console = -1; /* undecided */ void hil_intio_attach(struct device *parent, struct device *self, void *aux) @@ -86,16 +86,8 @@ hil_intio_attach(struct device *parent, struct device *self, void *aux) /* * Check that the configured console device is a wsdisplay. */ - if (cn_tab == &wsdisplay_cons) { - /* - * If we did not find and attach a Domain keyboard earlier, - * claim the console keyboard. - */ - if (hil_is_console == -1) - hil_is_console = 1; - } else { + if (cn_tab != &wsdisplay_cons) hil_is_console = 0; - } hil_isr.isr_func = hil_intr; hil_isr.isr_arg = sc; @@ -104,7 +96,7 @@ hil_intio_attach(struct device *parent, struct device *self, void *aux) printf(" ipl %d", hil_isr.isr_ipl); - hil_attach(sc, hil_is_console); + hil_attach(sc, &hil_is_console); intr_establish(&hil_isr, self->dv_xname); startuphook_establish(hil_attach_deferred, sc); diff --git a/sys/arch/hppa/gsc/hil_gsc.c b/sys/arch/hppa/gsc/hil_gsc.c index be3ba456ff4..9b0e3cb5103 100644 --- a/sys/arch/hppa/gsc/hil_gsc.c +++ b/sys/arch/hppa/gsc/hil_gsc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hil_gsc.c,v 1.4 2004/02/13 21:28:19 mickey Exp $ */ +/* $OpenBSD: hil_gsc.c,v 1.5 2005/12/22 07:09:52 miod Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. * All rights reserved. @@ -46,8 +46,13 @@ int hil_gsc_match(struct device *, void *, void *); void hil_gsc_attach(struct device *, struct device *, void *); +struct hil_gsc_softc { + struct hil_softc sc_hs; + int sc_hil_console; +}; + struct cfattach hil_gsc_ca = { - sizeof(struct hil_softc), hil_gsc_match, hil_gsc_attach + sizeof(struct hil_gsc_softc), hil_gsc_match, hil_gsc_attach }; int @@ -65,9 +70,9 @@ hil_gsc_match(struct device *parent, void *match, void *aux) void hil_gsc_attach(struct device *parent, struct device *self, void *aux) { - struct hil_softc *sc = (void *)self; + struct hil_gsc_softc *gsc = (void *)self; + struct hil_softc *sc = &gsc->sc_hs; struct gsc_attach_args *ga = aux; - int hil_is_console; sc->sc_bst = ga->ga_iot; if (bus_space_map(ga->ga_iot, ga->ga_hpa, @@ -76,10 +81,10 @@ hil_gsc_attach(struct device *parent, struct device *self, void *aux) return; } - hil_is_console = ga->ga_dp.dp_mod == PAGE0->mem_kbd.pz_dp.dp_mod && + gsc->sc_hil_console = ga->ga_dp.dp_mod == PAGE0->mem_kbd.pz_dp.dp_mod && bcmp(ga->ga_dp.dp_bc, PAGE0->mem_kbd.pz_dp.dp_bc, 6) == 0; - hil_attach(sc, hil_is_console); + hil_attach(sc, &gsc->sc_hil_console); gsc_intr_establish((struct gsc_softc *)parent, ga->ga_irq, IPL_TTY, hil_intr, sc, sc->sc_dev.dv_xname); 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 *); |