diff options
Diffstat (limited to 'sys/dev/wscons')
-rw-r--r-- | sys/dev/wscons/ascii.h | 2 | ||||
-rw-r--r-- | sys/dev/wscons/event.c | 31 | ||||
-rw-r--r-- | sys/dev/wscons/event_var.h | 8 | ||||
-rw-r--r-- | sys/dev/wscons/kbd.c | 18 | ||||
-rw-r--r-- | sys/dev/wscons/kbd.h | 49 | ||||
-rw-r--r-- | sys/dev/wscons/ms.c | 22 | ||||
-rw-r--r-- | sys/dev/wscons/ms.h | 45 | ||||
-rw-r--r-- | sys/dev/wscons/wscons.c | 8 | ||||
-rw-r--r-- | sys/dev/wscons/wscons_emul.c | 22 | ||||
-rw-r--r-- | sys/dev/wscons/wscons_emul.h | 2 | ||||
-rw-r--r-- | sys/dev/wscons/wscons_raster.h | 8 | ||||
-rw-r--r-- | sys/dev/wscons/wscons_rfont.h | 2 | ||||
-rw-r--r-- | sys/dev/wscons/wscons_rinit.c | 8 | ||||
-rw-r--r-- | sys/dev/wscons/wscons_rops.c | 2 | ||||
-rw-r--r-- | sys/dev/wscons/wsconsvar.h | 2 |
15 files changed, 192 insertions, 37 deletions
diff --git a/sys/dev/wscons/ascii.h b/sys/dev/wscons/ascii.h index 7569e04fa31..e5a508d5d9c 100644 --- a/sys/dev/wscons/ascii.h +++ b/sys/dev/wscons/ascii.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ascii.h,v 1.2 1996/07/29 23:02:46 niklas Exp $ */ +/* $OpenBSD: ascii.h,v 1.3 1996/10/30 22:41:35 niklas Exp $ */ /* $NetBSD: ascii.h,v 1.1 1996/04/12 02:00:42 cgd Exp $ */ #define ASCII_BEL 0x07 /* bell */ diff --git a/sys/dev/wscons/event.c b/sys/dev/wscons/event.c index 614704b3f9d..57874c90736 100644 --- a/sys/dev/wscons/event.c +++ b/sys/dev/wscons/event.c @@ -1,5 +1,5 @@ -/* $OpenBSD: event.c,v 1.2 1996/07/29 23:02:48 niklas Exp $ */ -/* $NetBSD: event.c,v 1.1.4.1 1996/05/29 22:26:54 cgd Exp $ */ +/* $OpenBSD: event.c,v 1.3 1996/10/30 22:41:36 niklas Exp $ */ +/* $NetBSD: event.c,v 1.3 1996/09/15 17:15:26 cgd Exp $ */ /* * Copyright (c) 1992, 1993 @@ -55,6 +55,10 @@ #include <sys/proc.h> #include <sys/systm.h> #include <sys/vnode.h> +#include <sys/select.h> +#ifdef notyet +#include <sys/poll.h> +#endif #include <machine/vuid_event.h> #include <alpha/wscons/event_var.h> @@ -85,7 +89,7 @@ ev_fini(ev) } /* - * User-level interface: read, select. + * User-level interface: read, poll. * (User cannot write an event queue.) */ int @@ -145,6 +149,26 @@ ev_read(ev, uio, flags) return (error); } +#ifdef notyet +int +ev_poll(ev, events, p) + register struct evvar *ev; + int events; + struct proc *p; +{ + int revents = 0; + int s = splev(); + + if (events & (POLLIN | POLLRDNORM)) + if (ev->ev_get != ev->ev_put) + revents |= events & (POLLIN | POLLRDNORM); + else + selrecord(p, &ev->ev_sel); + + splx(s); + return (revents); +} +#else int ev_select(ev, rw, p) register struct evvar *ev; @@ -171,3 +195,4 @@ ev_select(ev, rw, p) splx(s); return (0); } +#endif diff --git a/sys/dev/wscons/event_var.h b/sys/dev/wscons/event_var.h index bb8d9337c32..f9f0e00070c 100644 --- a/sys/dev/wscons/event_var.h +++ b/sys/dev/wscons/event_var.h @@ -1,5 +1,5 @@ -/* $OpenBSD: event_var.h,v 1.2 1996/07/29 23:02:50 niklas Exp $ */ -/* $NetBSD: event_var.h,v 1.1 1996/04/12 02:00:45 cgd Exp $ */ +/* $OpenBSD: event_var.h,v 1.3 1996/10/30 22:41:37 niklas Exp $ */ +/* $NetBSD: event_var.h,v 1.2 1996/09/15 17:15:27 cgd Exp $ */ /* * Copyright (c) 1992, 1993 @@ -79,7 +79,11 @@ struct evvar { void ev_init __P((struct evvar *)); void ev_fini __P((struct evvar *)); int ev_read __P((struct evvar *, struct uio *, int)); +#ifdef notyet +int ev_poll __P((struct evvar *, int, struct proc *)); +#else int ev_select __P((struct evvar *, int, struct proc *)); +#endif /* * PEVENT is set just above PSOCK, which is just above TTIPRI, on the diff --git a/sys/dev/wscons/kbd.c b/sys/dev/wscons/kbd.c index dbc00f0c542..c2782435e2b 100644 --- a/sys/dev/wscons/kbd.c +++ b/sys/dev/wscons/kbd.c @@ -1,5 +1,5 @@ -/* $OpenBSD: kbd.c,v 1.2 1996/07/29 23:02:51 niklas Exp $ */ -/* $NetBSD: kbd.c,v 1.1 1996/04/12 02:00:46 cgd Exp $ */ +/* $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 $ */ /* * Copyright (c) 1992, 1993 @@ -57,6 +57,7 @@ #include <sys/ioctl.h> #include <sys/kernel.h> #include <sys/proc.h> +#include <sys/signalvar.h> #include <sys/syslog.h> #include <sys/systm.h> #include <sys/tty.h> @@ -68,6 +69,7 @@ #include <machine/wsconsio.h> /* XXX for bell ioctls */ #include <alpha/wscons/event_var.h> #include <alpha/wscons/wsconsvar.h> +#include <alpha/wscons/kbd.h> struct kbd_softc { struct device *k_idev; /* the input device */ @@ -169,9 +171,6 @@ kbd_input(register int c) int kbdopen(dev_t dev, int flags, int mode, struct proc *p) { - int s; - struct tty *tp; - if (kbd_softc.k_events.ev_io) return (EBUSY); kbd_softc.k_events.ev_io = p; @@ -286,12 +285,19 @@ kbdioctl(dev_t dev, u_long cmd, register caddr_t data, int flag, struct proc *p) return (rv); } +#ifdef notyet +int +kbdpoll(dev_t dev, int events, struct proc *p) +{ + return (ev_poll(&kbd_softc.k_events, events, p)); +} +#else int kbdselect(dev_t dev, int rw, struct proc *p) { - return (ev_select(&kbd_softc.k_events, rw, p)); } +#endif /* Ring the console bell. (For wscons terminal emulator and other code) */ void diff --git a/sys/dev/wscons/kbd.h b/sys/dev/wscons/kbd.h new file mode 100644 index 00000000000..e2bcf6ed5af --- /dev/null +++ b/sys/dev/wscons/kbd.h @@ -0,0 +1,49 @@ +/* $OpenBSD: kbd.h,v 1.1 1996/10/30 22:41:41 niklas Exp $ */ + +/* + * Copyright (c) 1996 Niklas Hallqvist + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Niklas Hallqvist. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +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 +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 ed544fec876..938cffd4b8d 100644 --- a/sys/dev/wscons/ms.c +++ b/sys/dev/wscons/ms.c @@ -1,5 +1,5 @@ -/* $OpenBSD: ms.c,v 1.2 1996/07/29 23:02:53 niklas Exp $ */ -/* $NetBSD: ms.c,v 1.1 1996/04/12 02:00:47 cgd Exp $ */ +/* $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 $ */ /* * Copyright (c) 1992, 1993 @@ -54,6 +54,7 @@ #include <sys/ioctl.h> #include <sys/kernel.h> #include <sys/proc.h> +#include <sys/signalvar.h> #include <sys/syslog.h> #include <sys/systm.h> #include <sys/tty.h> @@ -61,6 +62,7 @@ #include <machine/vuid_event.h> #include <alpha/wscons/event_var.h> #include <alpha/wscons/wsconsvar.h> +#include <alpha/wscons/ms.h> struct ms_softc { struct device *ms_dev; @@ -177,7 +179,7 @@ msopen(dev, flags, mode, p) int flags, mode; struct proc *p; { - int s, error; + int error; if (ms_softc.ms_dev == NULL) /* never attached! */ return (ENXIO); @@ -246,8 +248,6 @@ msioctl(dev, cmd, data, flag, p) int flag; struct proc *p; { - int s; - switch (cmd) { case FIONBIO: /* we will remove this someday (soon???) */ @@ -275,12 +275,22 @@ msioctl(dev, cmd, data, flag, p) return (ENOTTY); } +#ifdef notyet +int +mspoll(dev, events, p) + dev_t dev; + int events; + struct proc *p; +{ + return (ev_poll(&ms_softc.ms_events, events, p)); +} +#else int msselect(dev, rw, p) dev_t dev; int rw; struct proc *p; { - return (ev_select(&ms_softc.ms_events, rw, p)); } +#endif diff --git a/sys/dev/wscons/ms.h b/sys/dev/wscons/ms.h new file mode 100644 index 00000000000..cedfd65f73b --- /dev/null +++ b/sys/dev/wscons/ms.h @@ -0,0 +1,45 @@ +/* $OpenBSD: ms.h,v 1.1 1996/10/30 22:41:44 niklas Exp $ */ + +/* + * Copyright (c) 1996 Niklas Hallqvist + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Niklas Hallqvist. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +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 diff --git a/sys/dev/wscons/wscons.c b/sys/dev/wscons/wscons.c index 9d8be9ab787..c86feeea15e 100644 --- a/sys/dev/wscons/wscons.c +++ b/sys/dev/wscons/wscons.c @@ -1,5 +1,5 @@ -/* $OpenBSD: wscons.c,v 1.2 1996/07/29 23:02:55 niklas Exp $ */ -/* $NetBSD: wscons.c,v 1.3.4.1 1996/06/03 18:54:35 cgd Exp $ */ +/* $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 $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -42,6 +42,7 @@ #include <dev/cons.h> #include <alpha/wscons/wsconsvar.h> #include <alpha/wscons/wscons_emul.h> +#include <alpha/wscons/kbd.h> #include <machine/wsconsio.h> cdev_decl(wscons); @@ -432,6 +433,7 @@ wsconsstop(tp, flag) if (!ISSET(tp->t_state, TS_TTSTOP)) SET(tp->t_state, TS_FLUSH); splx(s); + return 0; } /* @@ -492,5 +494,5 @@ wscons_cnpollc(dev, i) int i; { - kbd_cngetc(dev, i); /* XXX XXX */ + kbd_cnpollc(dev, i); /* XXX XXX */ } diff --git a/sys/dev/wscons/wscons_emul.c b/sys/dev/wscons/wscons_emul.c index 623ee8d2511..0fd4450c4a3 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.2 1996/07/29 23:02:57 niklas Exp $ */ -/* $NetBSD: wscons_emul.c,v 1.2 1996/04/12 06:10:29 cgd Exp $ */ +/* $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 $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -36,8 +36,18 @@ #include <sys/systm.h> #include <alpha/wscons/wsconsvar.h> #include <alpha/wscons/wscons_emul.h> +#include <alpha/wscons/kbd.h> #include <alpha/wscons/ascii.h> +static __inline int wscons_emul_input_normal + __P((struct wscons_emul_data *, char)); +static __inline int wscons_emul_input_haveesc + __P((struct wscons_emul_data *, char)); +static __inline void wscons_emul_docontrol + __P((struct wscons_emul_data *, char)); +static __inline int wscons_emul_input_control + __P((struct wscons_emul_data *, char)); + void wscons_emul_attach(we, wo) struct wscons_emul_data *we; @@ -74,7 +84,7 @@ wscons_emul_attach(we, wo) (*we->ac_ef->wef_cursor)(we->ac_efa, 1, we->ac_crow, we->ac_ccol); } -static inline int +static __inline int wscons_emul_input_normal(we, c) struct wscons_emul_data *we; char c; @@ -195,7 +205,7 @@ wscons_emul_input_normal(we, c) return newstate; } -static inline int +static __inline int wscons_emul_input_haveesc(we, c) struct wscons_emul_data *we; char c; @@ -219,7 +229,7 @@ wscons_emul_input_haveesc(we, c) return newstate; } -static inline void +static __inline void wscons_emul_docontrol(we, c) struct wscons_emul_data *we; char c; @@ -349,7 +359,7 @@ wscons_emul_docontrol(we, c) } } -static inline int +static __inline int wscons_emul_input_control(we, c) struct wscons_emul_data *we; char c; diff --git a/sys/dev/wscons/wscons_emul.h b/sys/dev/wscons/wscons_emul.h index 334e556464d..12368860050 100644 --- a/sys/dev/wscons/wscons_emul.h +++ b/sys/dev/wscons/wscons_emul.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wscons_emul.h,v 1.2 1996/07/29 23:02:59 niklas Exp $ */ +/* $OpenBSD: wscons_emul.h,v 1.3 1996/10/30 22:41:49 niklas Exp $ */ /* $NetBSD: wscons_emul.h,v 1.2 1996/04/12 06:10:32 cgd Exp $ */ /* diff --git a/sys/dev/wscons/wscons_raster.h b/sys/dev/wscons/wscons_raster.h index 9de352b40cd..5a1d4a6b336 100644 --- a/sys/dev/wscons/wscons_raster.h +++ b/sys/dev/wscons/wscons_raster.h @@ -1,5 +1,5 @@ -/* $OpenBSD: wscons_raster.h,v 1.2 1996/07/29 23:03:00 niklas Exp $ */ -/* $NetBSD: wscons_raster.h,v 1.1 1996/04/12 02:00:51 cgd Exp $ */ +/* $OpenBSD: wscons_raster.h,v 1.3 1996/10/30 22:41:50 niklas Exp $ */ +/* $NetBSD: wscons_raster.h,v 1.2 1996/07/09 00:55:47 cgd Exp $ */ /* * Copyright (c) 1992, 1993 @@ -75,7 +75,9 @@ struct rcons { }; #define RC_STANDOUT 0x001 /* standout mode */ -/* #define RC_BOLD 0x? /* boldface mode */ +#if 0 +#define RC_BOLD 0x? /* boldface mode */ +#endif #define RC_INVERT 0x002 /* inverted screen colors */ #define RC_CURSOR 0x004 /* cursor currently displayed */ diff --git a/sys/dev/wscons/wscons_rfont.h b/sys/dev/wscons/wscons_rfont.h index b9321173025..65c1e878dc9 100644 --- a/sys/dev/wscons/wscons_rfont.h +++ b/sys/dev/wscons/wscons_rfont.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wscons_rfont.h,v 1.2 1996/07/29 23:03:02 niklas Exp $ */ +/* $OpenBSD: wscons_rfont.h,v 1.3 1996/10/30 22:41:52 niklas Exp $ */ /* $NetBSD: wscons_rfont.h,v 1.1 1996/04/12 02:00:52 cgd Exp $ */ /* diff --git a/sys/dev/wscons/wscons_rinit.c b/sys/dev/wscons/wscons_rinit.c index 66e3dcaeb6d..3556c285800 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.2 1996/07/29 23:03:04 niklas Exp $ */ -/* $NetBSD: wscons_rinit.c,v 1.1 1996/04/12 02:00:54 cgd Exp $ */ +/* $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 $ */ /* * Copyright (c) 1991, 1993 @@ -46,7 +46,7 @@ */ #include <sys/param.h> -#include <sys/kernel.h> +#include <sys/systm.h> #include <sys/device.h> #include <dev/rcons/raster.h> @@ -54,6 +54,8 @@ #include <alpha/wscons/wscons_rfont.h> +void rcons_initfont __P((struct rcons *, struct raster_font *)); + void rcons_initfont(rc, fp) struct rcons *rc; diff --git a/sys/dev/wscons/wscons_rops.c b/sys/dev/wscons/wscons_rops.c index 98ed8eab10b..24a461cca38 100644 --- a/sys/dev/wscons/wscons_rops.c +++ b/sys/dev/wscons/wscons_rops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wscons_rops.c,v 1.2 1996/07/29 23:03:06 niklas Exp $ */ +/* $OpenBSD: wscons_rops.c,v 1.3 1996/10/30 22:41:55 niklas Exp $ */ /* $NetBSD: wscons_rops.c,v 1.1 1996/04/12 02:00:55 cgd Exp $ */ /* diff --git a/sys/dev/wscons/wsconsvar.h b/sys/dev/wscons/wsconsvar.h index 361113545eb..27db5939d40 100644 --- a/sys/dev/wscons/wsconsvar.h +++ b/sys/dev/wscons/wsconsvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wsconsvar.h,v 1.2 1996/07/29 23:03:07 niklas Exp $ */ +/* $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 $ */ /* |