summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1997-01-24 19:58:34 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1997-01-24 19:58:34 +0000
commit0ef244d8476654749f2eaf9441dc06b2fd4d4f7b (patch)
tree270851bce850e6dddd96484e78fa648cb8bec296 /sys/dev
parenta77b8c21d70779c5365903c1f86d3c3126549212 (diff)
Sync with NetBSD 961207
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/isa/vga_isa.c145
-rw-r--r--sys/dev/isa/vga_isavar.h31
-rw-r--r--sys/dev/pci/vga_pci.c155
-rw-r--r--sys/dev/pci/vga_pcivar.h37
-rw-r--r--sys/dev/wscons/kbd.c7
-rw-r--r--sys/dev/wscons/kbd.h16
-rw-r--r--sys/dev/wscons/ms.c4
-rw-r--r--sys/dev/wscons/ms.h14
-rw-r--r--sys/dev/wscons/wscons.c22
-rw-r--r--sys/dev/wscons/wscons_emul.c21
-rw-r--r--sys/dev/wscons/wscons_rinit.c6
-rw-r--r--sys/dev/wscons/wsconsvar.h30
12 files changed, 440 insertions, 48 deletions
diff --git a/sys/dev/isa/vga_isa.c b/sys/dev/isa/vga_isa.c
new file mode 100644
index 00000000000..615f16590a5
--- /dev/null
+++ b/sys/dev/isa/vga_isa.c
@@ -0,0 +1,145 @@
+/* $NetBSD: vga_isa.c,v 1.4 1996/12/05 01:39:32 cgd Exp $ */
+
+/*
+ * Copyright (c) 1995, 1996 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/device.h>
+#include <sys/malloc.h>
+
+#include <machine/autoconf.h>
+#include <machine/pte.h>
+
+#include <dev/isa/isavar.h>
+
+#include <alpha/common/vgavar.h>
+#include <alpha/isa/vga_isavar.h>
+
+struct vga_isa_softc {
+ struct device sc_dev;
+
+ struct vga_config *sc_vc; /* VGA configuration */
+};
+
+#ifdef __BROKEN_INDIRECT_CONFIG
+int vga_isa_match __P((struct device *, void *, void *));
+#else
+int vga_isa_match __P((struct device *, struct cfdata *, void *));
+#endif
+void vga_isa_attach __P((struct device *, struct device *, void *));
+
+struct cfattach vga_isa_ca = {
+ sizeof(struct vga_isa_softc), vga_isa_match, vga_isa_attach,
+};
+
+int vga_isa_console_tag; /* really just a boolean. */
+struct vga_config vga_isa_console_vc;
+
+int
+vga_isa_match(parent, match, aux)
+ struct device *parent;
+#ifdef __BROKEN_INDIRECT_CONFIG
+ void *match;
+#else
+ struct cfdata *match;
+#endif
+ void *aux;
+{
+ struct isa_attach_args *ia = aux;
+ int rv;
+
+ /* If values are hardwired to something that they can't be, punt. */
+ if (ia->ia_iobase != IOBASEUNK || /* ia->ia_iosize != 0 || XXX isa.c */
+ (ia->ia_maddr != MADDRUNK && ia->ia_maddr != 0xb8000) ||
+ (ia->ia_msize != 0 && ia->ia_msize != 0x8000) ||
+ ia->ia_irq != IRQUNK || ia->ia_drq != DRQUNK)
+ return (0);
+
+ if (vga_isa_console_tag)
+ return (1);
+
+ rv = vga_common_probe(ia->ia_iot, ia->ia_memt);
+
+ if (rv) {
+ ia->ia_iobase = 0x3b0;
+ ia->ia_iosize = 0x30;
+ ia->ia_maddr = 0xb8000;
+ ia->ia_msize = 0x8000;
+ }
+ return (rv);
+}
+
+void
+vga_isa_attach(parent, self, aux)
+ struct device *parent, *self;
+ void *aux;
+{
+ struct isa_attach_args *ia = aux;
+ struct vga_isa_softc *sc = (struct vga_isa_softc *)self;
+ struct vga_config *vc;
+ int console;
+
+ console = vga_isa_console_tag;
+ if (console)
+ vc = sc->sc_vc = &vga_isa_console_vc;
+ else {
+ vc = sc->sc_vc = (struct vga_config *)
+ malloc(sizeof(struct vga_config), M_DEVBUF, M_WAITOK);
+
+ /* set up bus-independent VGA configuration */
+ vga_common_setup(ia->ia_iot, ia->ia_memt, vc);
+ }
+
+ printf("\n");
+
+ vga_wscons_attach(self, vc, console);
+}
+
+int
+vga_isa_console_match(iot, memt)
+ bus_space_tag_t iot, memt;
+{
+
+ return (vga_common_probe(iot, memt));
+}
+
+void
+vga_isa_console_attach(iot, memt)
+ bus_space_tag_t iot, memt;
+{
+ struct vga_config *vc = &vga_isa_console_vc;
+
+ /* for later recognition */
+ vga_isa_console_tag = 1;
+
+ /* set up bus-independent VGA configuration */
+ vga_common_setup(iot, memt, vc);
+
+ vga_wscons_console(vc);
+}
diff --git a/sys/dev/isa/vga_isavar.h b/sys/dev/isa/vga_isavar.h
new file mode 100644
index 00000000000..618eb26b51b
--- /dev/null
+++ b/sys/dev/isa/vga_isavar.h
@@ -0,0 +1,31 @@
+/* $NetBSD: vga_isavar.h,v 1.2 1996/11/23 06:06:45 cgd Exp $ */
+
+/*
+ * Copyright (c) 1996 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+int vga_isa_console_match __P((bus_space_tag_t, bus_space_tag_t));
+void vga_isa_console_attach __P((bus_space_tag_t, bus_space_tag_t));
diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c
new file mode 100644
index 00000000000..4cb4ca703cf
--- /dev/null
+++ b/sys/dev/pci/vga_pci.c
@@ -0,0 +1,155 @@
+/* $NetBSD: vga_pci.c,v 1.4 1996/12/05 01:39:38 cgd Exp $ */
+
+/*
+ * Copyright (c) 1995, 1996 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/device.h>
+#include <sys/malloc.h>
+
+#include <machine/autoconf.h>
+#include <machine/pte.h>
+
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcidevs.h>
+
+#include <alpha/common/vgavar.h>
+#include <alpha/pci/vga_pcivar.h>
+
+struct vga_pci_softc {
+ struct device sc_dev;
+
+ pcitag_t sc_pcitag; /* PCI tag, in case we need it. */
+ struct vga_config *sc_vc; /* VGA configuration */
+};
+
+#ifdef __BROKEN_INDIRECT_CONFIG
+int vga_pci_match __P((struct device *, void *, void *));
+#else
+int vga_pci_match __P((struct device *, struct cfdata *, void *));
+#endif
+void vga_pci_attach __P((struct device *, struct device *, void *));
+
+struct cfattach vga_pci_ca = {
+ sizeof(struct vga_pci_softc), vga_pci_match, vga_pci_attach,
+};
+
+pcitag_t vga_pci_console_tag;
+struct vga_config vga_pci_console_vc;
+
+int
+vga_pci_match(parent, match, aux)
+ struct device *parent;
+#ifdef __BROKEN_INDIRECT_CONFIG
+ void *match;
+#else
+ struct cfdata *match;
+#endif
+ void *aux;
+{
+ struct pci_attach_args *pa = aux;
+ int potential;
+
+ potential = 0;
+
+ /*
+ * If it's prehistoric/vga or display/vga, we might match.
+ * For the console device, this is jut a sanity check.
+ */
+ if (PCI_CLASS(pa->pa_class) == PCI_CLASS_PREHISTORIC &&
+ PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_PREHISTORIC_VGA)
+ potential = 1;
+ if (PCI_CLASS(pa->pa_class) == PCI_CLASS_DISPLAY &&
+ PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_DISPLAY_VGA)
+ potential = 1;
+
+ if (!potential)
+ return (0);
+
+ /* If it's the console, we have a winner! */
+ if (pa->pa_tag == vga_pci_console_tag)
+ return (1);
+
+ /*
+ * If we might match, make sure that the card actually looks OK.
+ */
+ if (!vga_common_probe(pa->pa_iot, pa->pa_memt))
+ return (0);
+
+ return (1);
+}
+
+void
+vga_pci_attach(parent, self, aux)
+ struct device *parent, *self;
+ void *aux;
+{
+ struct pci_attach_args *pa = aux;
+ struct vga_pci_softc *sc = (struct vga_pci_softc *)self;
+ struct vga_config *vc;
+ char devinfo[256];
+ int console;
+
+ console = (pa->pa_tag == vga_pci_console_tag);
+ if (console)
+ vc = sc->sc_vc = &vga_pci_console_vc;
+ else {
+ vc = sc->sc_vc = (struct vga_config *)
+ malloc(sizeof(struct vga_config), M_DEVBUF, M_WAITOK);
+
+ /* set up bus-independent VGA configuration */
+ vga_common_setup(pa->pa_iot, pa->pa_memt, vc);
+ }
+
+ sc->sc_pcitag = pa->pa_tag;
+
+ pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo);
+ printf(": %s (rev. 0x%02x)\n", devinfo,
+ PCI_REVISION(pa->pa_class));
+
+ vga_wscons_attach(self, vc, console);
+}
+
+void
+vga_pci_console(iot, memt, pc, bus, device, function)
+ bus_space_tag_t iot, memt;
+ pci_chipset_tag_t pc;
+ int bus, device, function;
+{
+ struct vga_config *vc = &vga_pci_console_vc;
+
+ /* for later recognition */
+ vga_pci_console_tag = pci_make_tag(pc, bus, device, function);
+
+ /* set up bus-independent VGA configuration */
+ vga_common_setup(iot, memt, vc);
+
+ vga_wscons_console(vc);
+}
diff --git a/sys/dev/pci/vga_pcivar.h b/sys/dev/pci/vga_pcivar.h
new file mode 100644
index 00000000000..29e258c862d
--- /dev/null
+++ b/sys/dev/pci/vga_pcivar.h
@@ -0,0 +1,37 @@
+/* $NetBSD: vga_pcivar.h,v 1.1 1996/11/19 04:38:36 cgd Exp $ */
+
+/*
+ * Copyright (c) 1995, 1996 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#define DEVICE_IS_VGA_PCI(class, id) \
+ (((PCI_CLASS(class) == PCI_CLASS_DISPLAY && \
+ PCI_SUBCLASS(class) == PCI_SUBCLASS_DISPLAY_VGA) || \
+ (PCI_CLASS(class) == PCI_CLASS_PREHISTORIC && \
+ PCI_SUBCLASS(class) == PCI_SUBCLASS_PREHISTORIC_VGA)) ? 1 : 0)
+
+void vga_pci_console __P((bus_space_tag_t, bus_space_tag_t,
+ pci_chipset_tag_t, int, int, int));
diff --git a/sys/dev/wscons/kbd.c b/sys/dev/wscons/kbd.c
index c2782435e2b..05e43d07eea 100644
--- a/sys/dev/wscons/kbd.c
+++ b/sys/dev/wscons/kbd.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: kbd.c,v 1.3 1996/10/30 22:41:39 niklas Exp $ */
-/* $NetBSD: kbd.c,v 1.2 1996/09/15 17:15:28 cgd Exp $ */
+/* $OpenBSD: kbd.c,v 1.4 1997/01/24 19:58:25 niklas Exp $ */
+/* $NetBSD: kbd.c,v 1.3 1996/11/13 21:13:39 cgd Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -61,6 +61,7 @@
#include <sys/syslog.h>
#include <sys/systm.h>
#include <sys/tty.h>
+#include <sys/signalvar.h>
#include <machine/autoconf.h>
@@ -71,6 +72,8 @@
#include <alpha/wscons/wsconsvar.h>
#include <alpha/wscons/kbd.h>
+void kbd_repeat __P((void *));
+
struct kbd_softc {
struct device *k_idev; /* the input device */
struct wscons_idev_spec k_ispec; /* the input device information */
diff --git a/sys/dev/wscons/kbd.h b/sys/dev/wscons/kbd.h
index e2bcf6ed5af..a0bd8205746 100644
--- a/sys/dev/wscons/kbd.h
+++ b/sys/dev/wscons/kbd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: kbd.h,v 1.1 1996/10/30 22:41:41 niklas Exp $ */
+/* $OpenBSD: kbd.h,v 1.2 1997/01/24 19:58:26 niklas Exp $ */
/*
* Copyright (c) 1996 Niklas Hallqvist
@@ -32,18 +32,10 @@
*/
extern void kbdattach __P((struct device *, struct wscons_idev_spec *));
-extern void kbd_repeat __P((void *));
extern void kbd_input __P((int));
-extern int kbdopen __P((dev_t, int, int, struct proc *));
-extern int kbdclose __P((dev_t, int, int, struct proc *p));
-extern int kbdread __P((dev_t, struct uio *, int));
-extern int kbdwrite __P((dev_t, struct uio *, int));
-extern int kbdioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
-#ifdef notyet
-extern int kbdpoll __P((dev_t, int, struct proc *));
-#else
-extern int kbdselect __P((dev_t, int, struct proc *));
-#endif
+
+cdev_decl(kbd);
+
extern int kbd_cngetc __P((dev_t));
extern void kbd_cnpollc __P((dev_t, int));
extern void wscons_kbd_bell __P((void));
diff --git a/sys/dev/wscons/ms.c b/sys/dev/wscons/ms.c
index 938cffd4b8d..76a72d67721 100644
--- a/sys/dev/wscons/ms.c
+++ b/sys/dev/wscons/ms.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ms.c,v 1.3 1996/10/30 22:41:43 niklas Exp $ */
-/* $NetBSD: ms.c,v 1.2 1996/09/15 17:15:29 cgd Exp $ */
+/* $OpenBSD: ms.c,v 1.4 1997/01/24 19:58:27 niklas Exp $ */
+/* $NetBSD: ms.c,v 1.3 1996/11/13 21:13:40 cgd Exp $ */
/*
* Copyright (c) 1992, 1993
diff --git a/sys/dev/wscons/ms.h b/sys/dev/wscons/ms.h
index cedfd65f73b..fa69749e73c 100644
--- a/sys/dev/wscons/ms.h
+++ b/sys/dev/wscons/ms.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ms.h,v 1.1 1996/10/30 22:41:44 niklas Exp $ */
+/* $OpenBSD: ms.h,v 1.2 1997/01/24 19:58:28 niklas Exp $ */
/*
* Copyright (c) 1996 Niklas Hallqvist
@@ -33,13 +33,5 @@
extern void msattach __P((struct device *, struct wscons_mdev_spec *));
extern void ms_event __P((char, int, int));
-extern int msopen __P((dev_t, int, int, struct proc *));
-extern int msclose __P((dev_t, int, int, struct proc *));
-extern int msread __P((dev_t, struct uio *, int));
-extern int mswrite __P((dev_t, struct uio *, int));
-extern int msioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
-#ifdef notyet
-extern int mspoll __P((dev_t, int, struct proc *));
-#else
-extern int msselect __P((dev_t, int, struct proc *));
-#endif
+
+cdev_decl(ms);
diff --git a/sys/dev/wscons/wscons.c b/sys/dev/wscons/wscons.c
index c86feeea15e..1bc38095b02 100644
--- a/sys/dev/wscons/wscons.c
+++ b/sys/dev/wscons/wscons.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: wscons.c,v 1.3 1996/10/30 22:41:46 niklas Exp $ */
-/* $NetBSD: wscons.c,v 1.7 1996/10/13 03:00:45 christos Exp $ */
+/* $OpenBSD: wscons.c,v 1.4 1997/01/24 19:58:30 niklas Exp $ */
+/* $NetBSD: wscons.c,v 1.10 1996/12/05 01:39:47 cgd Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -61,11 +61,16 @@ struct wscons_softc {
struct wscons_emul_data *sc_emul_data;
struct tty *sc_tty;
+ void *sc_fn_cookie;
wscons_ioctl_t sc_ioctl;
wscons_mmap_t sc_mmap;
};
+#ifdef __BROKEN_INDIRECT_CONFIG
int wsconsmatch __P((struct device *, void *, void *));
+#else
+int wsconsmatch __P((struct device *, struct cfdata *, void *));
+#endif
void wsconsattach __P((struct device *, struct device *, void *));
struct cfattach wscons_ca = {
@@ -110,13 +115,23 @@ int wsconsparam __P((struct tty *, struct termios *));
*/
int
+#ifdef __BROKEN_INDIRECT_CONFIG
wsconsmatch(parent, cfdata, aux)
+#else
+wsconsmatch(parent, cf, aux)
+#endif
struct device *parent;
+#ifdef __BROKEN_INDIRECT_CONFIG
void *cfdata;
+#else
+ struct cfdata *cf;
+#endif
void *aux;
{
struct wscons_attach_args *waa = aux;
+#ifdef __BROKEN_INDIRECT_CONFIG
struct cfdata *cf = cfdata;
+#endif
if (waa->waa_isconsole && wscons_console_unit != -1)
panic("wsconsmatch: multiple consoles?");
@@ -182,6 +197,7 @@ wsconsattach(parent, self, aux)
/*
* Record other relevant information: ioctl and mmap functions.
*/
+ sc->sc_fn_cookie = waa->waa_odev_spec.wo_miscfuncs_cookie;
sc->sc_ioctl = waa->waa_odev_spec.wo_ioctl;
sc->sc_mmap = waa->waa_odev_spec.wo_mmap;
@@ -347,7 +363,7 @@ wsconsioctl(dev, cmd, data, flag, p)
/* then the underlying frame buffer device ioctls */
if (sc->sc_ioctl != NULL)
- error = (*sc->sc_ioctl)(sc->sc_dev.dv_parent, cmd, data,
+ error = (*sc->sc_ioctl)(sc->sc_fn_cookie, cmd, data,
flag, p);
if (error >= 0)
return error;
diff --git a/sys/dev/wscons/wscons_emul.c b/sys/dev/wscons/wscons_emul.c
index 0fd4450c4a3..fc40d12638c 100644
--- a/sys/dev/wscons/wscons_emul.c
+++ b/sys/dev/wscons/wscons_emul.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: wscons_emul.c,v 1.3 1996/10/30 22:41:47 niklas Exp $ */
-/* $NetBSD: wscons_emul.c,v 1.4 1996/10/13 03:00:47 christos Exp $ */
+/* $OpenBSD: wscons_emul.c,v 1.4 1997/01/24 19:58:31 niklas Exp $ */
+/* $NetBSD: wscons_emul.c,v 1.7 1996/11/19 05:23:13 cgd Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -34,6 +34,7 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/conf.h>
#include <alpha/wscons/wsconsvar.h>
#include <alpha/wscons/wscons_emul.h>
#include <alpha/wscons/kbd.h>
@@ -48,6 +49,11 @@ static __inline void wscons_emul_docontrol
static __inline int wscons_emul_input_control
__P((struct wscons_emul_data *, char));
+static int wscons_emul_input_normal __P((struct wscons_emul_data *, char));
+static int wscons_emul_input_haveesc __P((struct wscons_emul_data *, char));
+static void wscons_emul_docontrol __P((struct wscons_emul_data *, char));
+static int wscons_emul_input_control __P((struct wscons_emul_data *, char));
+
void
wscons_emul_attach(we, wo)
struct wscons_emul_data *we;
@@ -58,19 +64,20 @@ wscons_emul_attach(we, wo)
#ifdef DIAGNOSTIC
if (we == NULL || wo == NULL)
panic("wscons_emul_attach: bogus args");
- if (wo->wo_ef == NULL)
+ if (wo->wo_emulfuncs == NULL)
panic("wscons_emul_attach: bogus emul functions");
#endif
- if (wo->wo_nrows < 0 || wo->wo_ncols < 0)
- panic("wscons_emul_attach: bogus size");
+ if (wo->wo_nrows <= 0 || wo->wo_ncols <= 0)
+ panic("wscons_emul_attach: bogus size (%d/%d)",
+ wo->wo_nrows, wo->wo_ncols);
if (wo->wo_crow < 0 || wo->wo_ccol < 0 ||
wo->wo_crow >= wo->wo_nrows || wo->wo_ccol >= wo->wo_ncols)
panic("wscons_emul_attach: bogus location (n: %d/%d, c: %d/%d",
wo->wo_nrows, wo->wo_ncols, wo->wo_crow, wo->wo_ccol);
we->ac_state = ANSICONS_STATE_NORMAL;
- we->ac_ef = wo->wo_ef;
- we->ac_efa = wo->wo_efa;
+ we->ac_ef = wo->wo_emulfuncs;
+ we->ac_efa = wo->wo_emulfuncs_cookie;
we->ac_nrow = wo->wo_nrows;
we->ac_ncol = wo->wo_ncols;
diff --git a/sys/dev/wscons/wscons_rinit.c b/sys/dev/wscons/wscons_rinit.c
index 3556c285800..f6911f17118 100644
--- a/sys/dev/wscons/wscons_rinit.c
+++ b/sys/dev/wscons/wscons_rinit.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: wscons_rinit.c,v 1.3 1996/10/30 22:41:54 niklas Exp $ */
-/* $NetBSD: wscons_rinit.c,v 1.2 1996/07/09 00:55:50 cgd Exp $ */
+/* $OpenBSD: wscons_rinit.c,v 1.4 1997/01/24 19:58:32 niklas Exp $ */
+/* $NetBSD: wscons_rinit.c,v 1.3 1996/11/13 21:13:42 cgd Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -56,6 +56,8 @@
void rcons_initfont __P((struct rcons *, struct raster_font *));
+void rcons_initfont __P((struct rcons *, struct raster_font *));
+
void
rcons_initfont(rc, fp)
struct rcons *rc;
diff --git a/sys/dev/wscons/wsconsvar.h b/sys/dev/wscons/wsconsvar.h
index 27db5939d40..27a14d3f96d 100644
--- a/sys/dev/wscons/wsconsvar.h
+++ b/sys/dev/wscons/wsconsvar.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: wsconsvar.h,v 1.3 1996/10/30 22:41:56 niklas Exp $ */
-/* $NetBSD: wsconsvar.h,v 1.2 1996/04/12 06:10:36 cgd Exp $ */
+/* $OpenBSD: wsconsvar.h,v 1.4 1997/01/24 19:58:33 niklas Exp $ */
+/* $NetBSD: wsconsvar.h,v 1.4 1996/11/19 05:17:00 cgd Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -33,9 +33,9 @@
struct device;
-typedef int (*wscons_ioctl_t) __P((struct device *dev, u_long cmd,
+typedef int (*wscons_ioctl_t) __P((void *v, u_long cmd,
caddr_t data, int flag, struct proc *p));
-typedef int (*wscons_mmap_t) __P((struct device *dev, off_t off,
+typedef int (*wscons_mmap_t) __P((void *v, off_t off,
int prot));
struct wscons_emulfuncs {
@@ -54,14 +54,15 @@ struct wscons_emulfuncs {
};
struct wscons_odev_spec {
- const struct wscons_emulfuncs *wo_ef; /* emulation functions */
- void *wo_efa; /* emulation function cookie */
-
- int wo_nrows, wo_ncols; /* number of rows & cols */
- int wo_crow, wo_ccol; /* current row & col */
+ const struct wscons_emulfuncs *wo_emulfuncs; /* emulation functions */
+ void *wo_emulfuncs_cookie;
wscons_ioctl_t wo_ioctl;
wscons_mmap_t wo_mmap;
+ void *wo_miscfuncs_cookie;
+
+ int wo_nrows, wo_ncols; /* number of rows & cols */
+ int wo_crow, wo_ccol; /* current row & col */
};
struct wsconsio_bell_data;
@@ -109,4 +110,15 @@ void wscons_attach_input __P((struct device *,
*/
void wscons_input __P((char *));
+void msattach __P((struct device *, struct wscons_mdev_spec *));
+void ms_event __P((char, int, int));
+
+void kbdattach __P((struct device *, struct wscons_idev_spec *));
+void kbd_input __P((int));
+void wscons_kbd_bell __P((void));
+int kbd_cngetc __P((dev_t));
+void kbd_cnpollc __P((dev_t, int));
+int kbdioctl __P((dev_t dev, u_long cmd, register caddr_t data,
+ int flag, struct proc *p));
+
#endif /* _ALPHA_WSCONS_WSCONSVAR_H_ */