From 7919e08986cb0a969c8198e5a8fd62f4bf889b45 Mon Sep 17 00:00:00 2001 From: dbj Date: Thu, 28 Jan 1999 11:46:22 +0000 Subject: [PATCH] wscons based console video & keyboard support for the NeXT from Matt DeBergalis --- sys/arch/next68k/conf/GENERIC | 17 ++ sys/arch/next68k/conf/files.next68k | 11 +- sys/arch/next68k/dev/intio.c | 7 +- sys/arch/next68k/dev/nextdisplay.c | 344 +++++++++++++++++++++ sys/arch/next68k/dev/nextdisplayvar.h | 72 +++++ sys/arch/next68k/dev/nextkbd.c | 424 ++++++++++++++++++++++++++ sys/arch/next68k/dev/nextkbdvar.h | 41 +++ sys/arch/next68k/dev/wskbdmap_mfii.c | 339 ++++++++++++++++++++ sys/arch/next68k/dev/wskbdmap_mfii.h | 39 +++ sys/dev/wscons/wsconsio.h | 3 +- sys/dev/wscons/wsksymdef.h | 6 +- 11 files changed, 1295 insertions(+), 8 deletions(-) create mode 100644 sys/arch/next68k/dev/nextdisplay.c create mode 100644 sys/arch/next68k/dev/nextdisplayvar.h create mode 100644 sys/arch/next68k/dev/nextkbd.c create mode 100644 sys/arch/next68k/dev/nextkbdvar.h create mode 100644 sys/arch/next68k/dev/wskbdmap_mfii.c create mode 100644 sys/arch/next68k/dev/wskbdmap_mfii.h diff --git a/sys/arch/next68k/conf/GENERIC b/sys/arch/next68k/conf/GENERIC index d5a63dbfe98a..dd1444b5eee8 100644 --- a/sys/arch/next68k/conf/GENERIC +++ b/sys/arch/next68k/conf/GENERIC @@ -107,6 +107,17 @@ options ZS_CONSOLE_ABORT options NFS_BOOT_BOOTP options NFS_BOOT_DHCP +# wscons options +options RCONS_2BPP # necessary for nextdisplay +options WSEMUL_SUN # sun terminal emulation +#options WSEMUL_VT100 # VT100 / VT220 emulation +options WSDISPLAY_COMPAT_SYSCONS # emulate some ioctls +options WSDISPLAY_COMPAT_USL # VT handling +options WSDISPLAY_COMPAT_RAWKBD # can get raw scancodes +# see dev/wscons/wskbdmap_mfii.h for implemented layouts +#options PCKBD_LAYOUT="(KB_DE | KB_NODEAD)" + + config netbsd root on ? type ? # @@ -121,6 +132,12 @@ mainbus0 at root # device space intio0 at mainbus? +nextkbd0 at intio? ipl 3 +nextdisplay0 at mainbus? + +wsdisplay* at nextdisplay? console ? +wskbd* at nextkbd? console ? + # INTIO zsc0 at intio? ipl 5 #zsc1 at intio? ipl 5 diff --git a/sys/arch/next68k/conf/files.next68k b/sys/arch/next68k/conf/files.next68k index 9e0469f771a4..3065bec59bec 100644 --- a/sys/arch/next68k/conf/files.next68k +++ b/sys/arch/next68k/conf/files.next68k @@ -1,4 +1,4 @@ -# $NetBSD: files.next68k,v 1.6 1999/01/27 11:27:16 dbj Exp $ +# $NetBSD: files.next68k,v 1.7 1999/01/28 11:46:24 dbj Exp $ # next68k-specific configuration info @@ -66,6 +66,15 @@ attach xe at intio file arch/next68k/dev/mb8795.c file arch/next68k/dev/if_xe.c +device nextdisplay: wsemuldisplaydev, wsrasteremulops +attach nextdisplay at mainbus +file arch/next68k/dev/nextdisplay.c nextdisplay needs-flag + +device nextkbd: wskbddev +attach nextkbd at intio +file arch/next68k/dev/nextkbd.c nextkbd needs-flag +file arch/next68k/dev/wskbdmap_mfii.c nextkbd + device esp: scsi, ncr53c9x, disk attach esp at intio file arch/next68k/dev/esp.c esp needs-flag diff --git a/sys/arch/next68k/dev/intio.c b/sys/arch/next68k/dev/intio.c index 2e53473ca582..fef2243f53f8 100644 --- a/sys/arch/next68k/dev/intio.c +++ b/sys/arch/next68k/dev/intio.c @@ -1,4 +1,4 @@ -/* $NetBSD: intio.c,v 1.1.1.1 1998/06/09 07:53:05 dbj Exp $ */ +/* $NetBSD: intio.c,v 1.2 1999/01/28 11:46:23 dbj Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -111,8 +111,7 @@ intiosearch(parent, cf, aux) bzero(&ia, sizeof(ia)); if ((*cf->cf_attach->ca_match)(parent, cf, &ia) > 0) { - config_attach(parent, cf, &ia, intioprint); - printf("\n"); - } + config_attach(parent, cf, &ia, intioprint); + } return (0); } diff --git a/sys/arch/next68k/dev/nextdisplay.c b/sys/arch/next68k/dev/nextdisplay.c new file mode 100644 index 000000000000..a27713064314 --- /dev/null +++ b/sys/arch/next68k/dev/nextdisplay.c @@ -0,0 +1,344 @@ +/* $NetBSD: nextdisplay.c,v 1.1 1999/01/28 11:46:23 dbj Exp $ */ +/* + * Copyright (c) 1998 Matt DeBergalis + * 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 Matt DeBergalis + * 4. The name of the author may not 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. + */ + + +#include /* RCS ID & Copyright macro defns */ + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include + +int nextdisplay_match __P((struct device *, struct cfdata *, void *)); +void nextdisplay_attach __P((struct device *, struct device *, void *)); + +struct cfattach nextdisplay_ca = { + sizeof(struct nextdisplay_softc), + nextdisplay_match, + nextdisplay_attach, +}; + +const struct wsdisplay_emulops nextdisplay_mono_emulops = { + rcons_cursor, + rcons_mapchar, + rcons_putchar, + rcons_copycols, + rcons_erasecols, + rcons_copyrows, + rcons_eraserows, + rcons_alloc_attr +}; + +struct wsscreen_descr nextdisplay_mono = { + "std", + 0, 0, /* will be filled in -- XXX shouldn't, it's global */ + &nextdisplay_mono_emulops, + 0, 0 +}; + +const struct wsscreen_descr *_nextdisplay_scrlist_mono[] = { + &nextdisplay_mono, +}; + +const struct wsscreen_list nextdisplay_screenlist_mono = { + sizeof(_nextdisplay_scrlist_mono) / sizeof(struct wsscreen_descr *), + _nextdisplay_scrlist_mono +}; + +static int nextdisplay_ioctl __P((void *, u_long, caddr_t, int, struct proc *)); +static int nextdisplay_mmap __P((void *, off_t, int)); +static int nextdisplay_alloc_screen __P((void *, const struct wsscreen_descr *, + void **, int *, int *, long *)); +static void nextdisplay_free_screen __P((void *, void *)); +static void nextdisplay_show_screen __P((void *, void *)); +static int nextdisplay_load_font __P((void *, void *, struct wsdisplay_font *)); + +const struct wsdisplay_accessops nextdisplay_accessops = { + nextdisplay_ioctl, + nextdisplay_mmap, + nextdisplay_alloc_screen, + nextdisplay_free_screen, + nextdisplay_show_screen, + nextdisplay_load_font +}; + +void nextdisplay_init(struct nextdisplay_config *, paddr_t); + +paddr_t nextdisplay_consaddr; +static int nextdisplay_is_console __P((paddr_t addr)); + +static struct nextdisplay_config nextdisplay_console_dc; + +static int +nextdisplay_is_console(paddr_t addr) +{ + return (nextdisplay_console_dc.isconsole + && (addr == nextdisplay_consaddr)); +} + +int +nextdisplay_match(parent, match, aux) + struct device *parent; + struct cfdata *match; + void *aux; +{ + return (1); +} + +void +nextdisplay_init(dc, addr) + struct nextdisplay_config *dc; + paddr_t addr; +{ + struct raster *rap; + struct rcons *rcp; + int i; + + /* printf("in nextdisplay_init\n"); */ + + dc->dc_vaddr = addr; + dc->dc_paddr = VIDEOP(addr); + dc->dc_size = NEXT_P_VIDEOSIZE; + + dc->dc_wid = 1152; + dc->dc_ht = 832; + dc->dc_depth = 2; + dc->dc_rowbytes = dc->dc_wid * dc->dc_depth / 8; + + dc->dc_videobase = dc->dc_vaddr; + +#if 0 + printf("intiobase at: %08x\n", intiobase); + printf("intiolimit at: %08x\n", intiolimit); + printf("videobase at: %08x\n", videobase); + printf("videolimit at: %08x\n", videolimit); + + printf("virtual fb at: %08x\n", dc->dc_vaddr); + printf("physical fb at: %08x\n", dc->dc_paddr); + printf("fb size: %08x\n", dc->dc_size); + + printf("dc_wid: %08x\n", dc->dc_wid); + printf("dc_ht: %08x\n", dc->dc_ht); + printf("dc_depth: %08x\n", dc->dc_depth); + printf("dc_rowbytes: %08x\n", dc->dc_rowbytes); + printf("dc_videobase: %08x\n", dc->dc_videobase); +#endif + + /* clear the screen */ + for (i = 0; i < dc->dc_ht * dc->dc_rowbytes; i += sizeof(u_int32_t)) + *(u_int32_t *)(dc->dc_videobase + i) = 0x00000000; + + rap = &dc->dc_raster; + rap->width = dc->dc_wid; + rap->height = dc->dc_ht; + rap->depth = 2; + rap->linelongs = dc->dc_rowbytes / sizeof(u_int32_t); + rap->pixels = (u_int32_t *)dc->dc_videobase; + + /* initialize the raster console blitter */ + rcp = &dc->dc_rcons; + rcp->rc_sp = rap; + rcp->rc_crow = rcp->rc_ccol = -1; + rcp->rc_crowp = &rcp->rc_crow; + rcp->rc_ccolp = &rcp->rc_ccol; + rcons_init(rcp, 34, 80); + + nextdisplay_mono.nrows = dc->dc_rcons.rc_maxrow; + nextdisplay_mono.ncols = dc->dc_rcons.rc_maxcol; +} + +void +nextdisplay_attach(parent, self, aux) + struct device *parent; + struct device *self; + void *aux; +{ + struct nextdisplay_softc *sc; + struct wsemuldisplaydev_attach_args waa; + int isconsole; + + sc = (struct nextdisplay_softc *)self; + + printf("\n"); + + isconsole = nextdisplay_is_console(videobase); + + if( isconsole ) { + sc->sc_dc = &nextdisplay_console_dc; + sc->nscreens = 1; + } else { + sc->sc_dc = (struct nextdisplay_config *) + malloc(sizeof(struct nextdisplay_config), M_DEVBUF, M_WAITOK); + nextdisplay_init(sc->sc_dc, videobase); + } + + /* initialize the raster */ + waa.console = isconsole; + waa.scrdata = &nextdisplay_screenlist_mono; + waa.accessops = &nextdisplay_accessops; + waa.accesscookie = sc; + + config_found(self, &waa, wsemuldisplaydevprint); +} + + +int +nextdisplay_ioctl(v, cmd, data, flag, p) + void *v; + u_long cmd; + caddr_t data; + int flag; + struct proc *p; +{ + struct nextdisplay_softc *sc = v; + struct nextdisplay_config *dc = sc->sc_dc; + + switch (cmd) { + case WSDISPLAYIO_GTYPE: + *(int *)data = dc->dc_type; + return 0; + + case WSDISPLAYIO_SCURSOR: + printf("nextdisplay_ioctl: wsdisplayio_scursor\n"); + return ENOTTY; + + case WSDISPLAYIO_SCURPOS: + printf("nextdisplay_ioctl: wsdisplayio_scurpos\n"); + return ENOTTY; + + case WSDISPLAYIO_GINFO: + case WSDISPLAYIO_GETCMAP: + case WSDISPLAYIO_PUTCMAP: + case WSDISPLAYIO_GVIDEO: + case WSDISPLAYIO_SVIDEO: + case WSDISPLAYIO_GCURPOS: + case WSDISPLAYIO_GCURMAX: + case WSDISPLAYIO_GCURSOR: + printf("nextdisplay_ioctl: listed but unsupported ioctl\n"); + return ENOTTY; + } + printf("nextdisplay_ioctl: unsupported ioctl\n"); + return -1; +} + +static int +nextdisplay_mmap(v, offset, prot) + void *v; + off_t offset; + int prot; +{ + + /* XXX */ + return -1; +} + +int +nextdisplay_alloc_screen(v, type, cookiep, curxp, curyp, defattrp) + void *v; + const struct wsscreen_descr *type; + void **cookiep; + int *curxp, *curyp; + long *defattrp; +{ + struct nextdisplay_softc *sc = v; + long defattr; + + if (sc->nscreens > 0) + return (ENOMEM); + + *cookiep = &sc->sc_dc->dc_rcons; /* one and only for now */ + *curxp = 0; + *curyp = 0; + rcons_alloc_attr(&sc->sc_dc->dc_rcons, 0, 0, 0, &defattr); + *defattrp = defattr; + sc->nscreens++; + return (0); +} + +void +nextdisplay_free_screen(v, cookie) + void *v; + void *cookie; +{ + struct nextdisplay_softc *sc = v; + + if (sc->sc_dc == &nextdisplay_console_dc) + panic("cfb_free_screen: console"); + + sc->nscreens--; +} + +void +nextdisplay_show_screen(v, cookie) + void *v; + void *cookie; +{ +} + +static int +nextdisplay_load_font(v, cookie, font) + void *v; + void *cookie; + struct wsdisplay_font *font; +{ + return (EINVAL); +} + +int +nextdisplay_cnattach(addr) + paddr_t addr; +{ + struct nextdisplay_config *dc = &nextdisplay_console_dc; + long defattr; + + /* set up the display */ + nextdisplay_init(&nextdisplay_console_dc, addr); + + rcons_alloc_attr(&dc->dc_rcons, 0, 0, 0, &defattr); + + wsdisplay_cnattach(&nextdisplay_mono, &dc->dc_rcons, + 0, 0, defattr); + + nextdisplay_consaddr = addr; + dc->isconsole = 1; + return (0); +} diff --git a/sys/arch/next68k/dev/nextdisplayvar.h b/sys/arch/next68k/dev/nextdisplayvar.h new file mode 100644 index 000000000000..c37fe940a030 --- /dev/null +++ b/sys/arch/next68k/dev/nextdisplayvar.h @@ -0,0 +1,72 @@ +/* $NetBSD: nextdisplayvar.h,v 1.1 1999/01/28 11:46:23 dbj Exp $ */ +/* + * Copyright (c) 1998 Matt DeBergalis + * 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 Matt DeBergalis + * 4. The name of the author may not 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. + */ + +#include +#include + +#include + +extern int nextdisplay_cnattach __P((paddr_t)); + +struct nextdisplay_config; +struct fbcmap; +struct fbcursor; +struct fbcurpos; + +struct nextdisplay_config { + int dc_type; /* WSCONS display type */ + + vaddr_t dc_vaddr; /* memory space virtual base address */ + paddr_t dc_paddr; /* memory space physical base address */ + psize_t dc_size; /* size of slot memory */ + + vaddr_t dc_videobase; /* base of flat frame buffer */ + + int dc_wid; /* width of frame buffer */ + int dc_ht; /* height of frame buffer */ + int dc_depth; /* depth of frame buffer */ + int dc_rowbytes; /* bytes in fb scan line */ + + struct raster dc_raster; /* raster description */ + struct rcons dc_rcons; /* raster blitter control info */ + + int dc_blanked; /* currently has video disabled */ + + int isconsole; +}; + +struct nextdisplay_softc { + struct device sc_dev; + + struct nextdisplay_config *sc_dc; + + int nscreens; +}; diff --git a/sys/arch/next68k/dev/nextkbd.c b/sys/arch/next68k/dev/nextkbd.c new file mode 100644 index 000000000000..207a198f7227 --- /dev/null +++ b/sys/arch/next68k/dev/nextkbd.c @@ -0,0 +1,424 @@ +/* $NetBSD: nextkbd.c,v 1.1 1999/01/28 11:46:23 dbj Exp $ */ +/* + * Copyright (c) 1998 Matt DeBergalis + * 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 Matt DeBergalis + * 4. The name of the author may not 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. + */ + +#include /* RCS ID & Copyright macro defns */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +struct nextkbd_internal { + int num_ints; /* interrupt total */ + int polling; + int isconsole; + + bus_space_tag_t iot; + bus_space_handle_t ioh; + struct nextkbd_softc *t_sc; /* back pointer */ + u_int32_t mods; +}; + +struct mon_regs { + u_int32_t mon_csr; + u_int32_t mon_1; + u_int32_t mon_data; +}; + +int nextkbd_match __P((struct device *, struct cfdata *, void *)); +void nextkbd_attach __P((struct device *, struct device *, void *)); + +int nextkbc_cnattach __P((bus_space_tag_t)); + +struct cfattach nextkbd_ca = { + sizeof(struct nextkbd_softc), nextkbd_match, nextkbd_attach +}; + +int nextkbd_enable __P((void *, int)); +void nextkbd_set_leds __P((void *, int)); +int nextkbd_ioctl __P((void *, u_long, caddr_t, int, struct proc *)); + +const struct wskbd_accessops nextkbd_accessops = { + nextkbd_enable, + nextkbd_set_leds, + nextkbd_ioctl, +}; + +void nextkbd_cngetc __P((void *, u_int *, int *)); +void nextkbd_cnpollc __P((void *, int)); + +const struct wskbd_consops nextkbd_consops = { + nextkbd_cngetc, + nextkbd_cnpollc, +}; + +const struct wskbd_mapdata nextkbd_keymapdata = { + nextkbd_keydesctab, + KB_US, +}; + +static int nextkbd_poll_data __P((bus_space_tag_t, bus_space_handle_t)); +static int nextkbd_decode __P((struct nextkbd_internal *, int, u_int *, int *)); + +static struct nextkbd_internal nextkbd_consdata; +static int nextkbd_is_console __P((bus_space_tag_t bst)); + +int nextkbdhard __P((void *)); + +static int +nextkbd_is_console(bst) + bus_space_tag_t bst; +{ + return (nextkbd_consdata.isconsole + && (bst == nextkbd_consdata.iot)); +} + +int +nextkbd_match(parent, match, aux) + struct device *parent; + struct cfdata *match; + void *aux; +{ + return 1; +} + +void +nextkbd_attach(parent, self, aux) + struct device *parent, *self; + void *aux; +{ + struct nextkbd_softc *sc = (struct nextkbd_softc *)self; + int isconsole; + struct wskbddev_attach_args a; + + printf("\n"); + + isconsole = nextkbd_is_console(NEXT68K_INTIO_BUS_SPACE); /* XXX */ + + if (isconsole) { + sc->id = &nextkbd_consdata; + } else { + sc->id = malloc(sizeof(struct nextkbd_internal), + M_DEVBUF, M_WAITOK); + + bzero(sc->id, sizeof(struct nextkbd_internal)); + sc->id->iot = NEXT68K_INTIO_BUS_SPACE; + if (bus_space_map(sc->id->iot, NEXT_P_MON, + sizeof(struct mon_regs), + 0, &sc->id->ioh)) { + printf("%s: can't map mon status control register\n", + sc->sc_dev.dv_xname); + return; + } + } + + sc->id->t_sc = sc; /* set back pointer */ + + isrlink_autovec(nextkbdhard, sc, NEXT_I_IPL(NEXT_I_KYBD_MOUSE), 0); + + INTR_ENABLE(NEXT_I_KYBD_MOUSE); + + a.console = isconsole; + a.keymap = &nextkbd_keymapdata; + a.accessops = &nextkbd_accessops; + a.accesscookie = sc; + + /* + * Attach the wskbd, saving a handle to it. + * XXX XXX XXX + */ + sc->sc_wskbddev = config_found(self, &a, wskbddevprint); +} + +int +nextkbd_enable(v, on) + void *v; + int on; +{ + /* XXX not sure if this should do anything */ + printf("nextkbd_enable %d\n", on); + return 0; +} + +/* XXX not yet implemented */ +void +nextkbd_set_leds(v, leds) + void *v; + int leds; +{ + return; +} + +int +nextkbd_ioctl(v, cmd, data, flag, p) + void *v; + u_long cmd; + caddr_t data; + int flag; + struct proc *p; +{ + /* XXX struct nextkbd_softc *nc = v; */ + + switch (cmd) { + case WSKBDIO_GTYPE: + /* XXX */ + *(int *)data = WSKBD_TYPE_PC_AT; + return (0); + case WSKBDIO_SETLEDS: + return (0); + case WSKBDIO_GETLEDS: + *(int *)data = 0; + return (0); + case WSKBDIO_COMPLEXBELL: + return (0); + } + return -1; +} + +int +nextkbdhard(arg) + void *arg; +{ + register struct nextkbd_softc *sc = arg; + struct mon_regs stat; + unsigned char device; + u_int32_t scan_code; + int type, key; + + if (!INTR_OCCURRED(NEXT_I_KYBD_MOUSE)) return 0; + +#define CSR_INT 0x00800000 +#define CSR_DATA 0x00400000 + +#define KD_KEYMASK 0x007f +#define KD_DIRECTION 0x0080 /* pressed or released */ +#define KD_CNTL 0x0100 +#define KD_LSHIFT 0x0200 +#define KD_RSHIFT 0x0400 +#define KD_LCOMM 0x0800 +#define KD_RCOMM 0x1000 +#define KD_LALT 0x2000 +#define KD_RALT 0x4000 +#define KD_VALID 0x8000 /* only set for scancode keys ? */ +#define KD_MODS 0x4f00 + + bus_space_read_region_4(sc->id->iot, sc->id->ioh, 0, &stat, 3); + if (stat.mon_csr & CSR_INT) { + if (stat.mon_csr & CSR_DATA) { + sc->id->num_ints++; + stat.mon_csr &= ~CSR_INT; + bus_space_write_4(sc->id->iot, sc->id->ioh, 0, stat.mon_csr); + device = stat.mon_data >> 28; + if (device != 1) return(0); + + scan_code = stat.mon_data & 0xffff; + if (nextkbd_decode(sc->id, scan_code, &type, &key)) { + wskbd_input(sc->sc_wskbddev, type, key); + } + } + } + + return(1); +} + +int +nextkbd_cnattach(bst) + bus_space_tag_t bst; +{ + bus_space_handle_t bsh; + + if (bus_space_map(bst, NEXT_P_MON, sizeof(struct mon_regs), + 0, &bsh)) + return (ENXIO); + + bzero(&nextkbd_consdata, sizeof(nextkbd_consdata)); + + nextkbd_consdata.iot = bst; + nextkbd_consdata.ioh = bsh; + nextkbd_consdata.isconsole = 1; + + wskbd_cnattach(&nextkbd_consops, &nextkbd_consdata, + &nextkbd_keymapdata); + + return (0); +} + +/* ARGSUSED */ +void +nextkbd_cngetc(v, type, data) + void *v; + u_int *type; + int *data; +{ + struct nextkbd_internal *t = v; + int val; + + /* printf("cngetc: data at %08x (%08x)\n", t, v); */ + for (;;) { + val = nextkbd_poll_data(t->iot, t->ioh); + /* printf("%08x\n", val); */ + if ((val != -1) && nextkbd_decode(t, val, type, data)) + return; + } +} + +void +nextkbd_cnpollc(v, on) + void *v; + int on; +{ + struct nextkbd_internal *t = v; + + printf("cnpollc %d\n", on); + t->polling = on; + if (on) { + INTR_DISABLE(NEXT_I_KYBD_MOUSE); + } else { + INTR_ENABLE(NEXT_I_KYBD_MOUSE); + } + +} + +static int +nextkbd_poll_data(iot, ioh) + bus_space_tag_t iot; + bus_space_handle_t ioh; +{ + int i; + struct mon_regs stat; + + /* printf("cnstart\n"); */ + for (i=100000; i; i--) { + bus_space_read_region_4(iot, ioh, 0, &stat, 3); + if ( (stat.mon_csr & CSR_DATA) ) { + stat.mon_csr &= ~CSR_INT; + if ( (stat.mon_data >> 28) == 1) { + /* printf("cnkey %08x %08x\n", stat.mon_csr, stat.mon_data); */ + bus_space_write_4(iot, ioh, 0, stat.mon_csr); + return (stat.mon_data & 0xffff); + } + } + } + /* printf("cnend %08x %08x\n", stat.mon_csr, stat.mon_data); */ + return (-1); +} + +static int +nextkbd_decode(id, datain, type, dataout) + struct nextkbd_internal *id; + int datain; + u_int *type; + int *dataout; +{ + /* printf("datain %08x mods %08x\n", datain, id->mods); */ + + if ((datain ^ id->mods) & KD_LSHIFT) { + id->mods ^= KD_LSHIFT; + *dataout = 90; + if (datain & KD_LSHIFT) + *type = WSCONS_EVENT_KEY_DOWN; + else + *type = WSCONS_EVENT_KEY_UP; + } else if ((datain ^ id->mods) & KD_RSHIFT) { + id->mods ^= KD_RSHIFT; + *dataout = 91; + if (datain & KD_RSHIFT) + *type = WSCONS_EVENT_KEY_DOWN; + else + *type = WSCONS_EVENT_KEY_UP; + } else if ((datain ^ id->mods) & KD_LALT) { + id->mods ^= KD_LALT; + *dataout = 92; + if (datain & KD_LALT) + *type = WSCONS_EVENT_KEY_DOWN; + else + *type = WSCONS_EVENT_KEY_UP; + } else if ((datain ^ id->mods) & KD_RALT) { + id->mods ^= KD_RALT; + *dataout = 93; + if (datain & KD_RALT) + *type = WSCONS_EVENT_KEY_DOWN; + else + *type = WSCONS_EVENT_KEY_UP; + } else if ((datain ^ id->mods) & KD_CNTL) { + id->mods ^= KD_CNTL; + *dataout = 94; + if (datain & KD_CNTL) + *type = WSCONS_EVENT_KEY_DOWN; + else + *type = WSCONS_EVENT_KEY_UP; + } else if ((datain ^ id->mods) & KD_LCOMM) { + id->mods ^= KD_LCOMM; + *dataout = 95; + if (datain & KD_LCOMM) + *type = WSCONS_EVENT_KEY_DOWN; + else + *type = WSCONS_EVENT_KEY_UP; + } else if ((datain ^ id->mods) & KD_RCOMM) { + id->mods ^= KD_RCOMM; + *dataout = 96; + if (datain & KD_RCOMM) + *type = WSCONS_EVENT_KEY_DOWN; + else + *type = WSCONS_EVENT_KEY_UP; + } else if (datain & KD_KEYMASK) { + if (datain & KD_DIRECTION) + *type = WSCONS_EVENT_KEY_UP; + else + *type = WSCONS_EVENT_KEY_DOWN; + + *dataout = (datain & KD_KEYMASK); + } else { + *dataout = 0; + } + + return 1; +} diff --git a/sys/arch/next68k/dev/nextkbdvar.h b/sys/arch/next68k/dev/nextkbdvar.h new file mode 100644 index 000000000000..87076fb376f4 --- /dev/null +++ b/sys/arch/next68k/dev/nextkbdvar.h @@ -0,0 +1,41 @@ +/* $NetBSD: nextkbdvar.h,v 1.1 1999/01/28 11:46:23 dbj Exp $ */ +/* + * Copyright (c) 1998 Matt DeBergalis + * 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 Matt DeBergalis + * 4. The name of the author may not 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. + */ + +int nextkbd_cnattach __P((bus_space_tag_t)); + +struct nextkbd_softc { + struct device sc_dev; + struct nextkbd_internal *id; + + struct device *sc_wskbddev; + + int enabled; /* XXX ? */ +}; diff --git a/sys/arch/next68k/dev/wskbdmap_mfii.c b/sys/arch/next68k/dev/wskbdmap_mfii.c new file mode 100644 index 000000000000..ec117566367f --- /dev/null +++ b/sys/arch/next68k/dev/wskbdmap_mfii.c @@ -0,0 +1,339 @@ +/* $NetBSD: wskbdmap_mfii.c,v 1.1 1999/01/28 11:46:23 dbj Exp $ */ + +/*- + * Copyright (c) 1997 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Juergen Hannken-Illjes. + * + * 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 the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``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 FOUNDATION OR CONTRIBUTORS + * 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. + */ + +#include +#include +#include +#include + +#define KC(n) (0xe000 | (n)) /* see wsksymvar.h */ + +static const keysym_t nextkbd_keydesc_us[] = { +/* pos command normal shifted */ + KC(3), KS_backslash, KS_bar, + KC(4), KS_bracketright, KS_braceright, + KC(5), KS_bracketleft, KS_braceleft, + KC(6), KS_i, + KC(7), KS_o, + KC(8), KS_p, + KC(9), KS_Left, + KC(15), KS_Down, + KC(16), KS_Right, + KC(22), KS_Up, + KC(27), KS_Delete, + KC(28), KS_equal, KS_plus, + KC(29), KS_minus, KS_underscore, + KC(30), KS_8, KS_asterisk, + KC(31), KS_9, KS_parenleft, + KC(32), KS_0, KS_parenright, + KC(38), KS_grave, KS_asciitilde, + KC(42), KS_Return, + KC(43), KS_apostrophe, KS_quotedbl, + KC(44), KS_semicolon, KS_colon, + KC(45), KS_l, + KC(46), KS_comma, KS_less, + KC(47), KS_period, KS_greater, + KC(48), KS_slash, KS_question, + KC(49), KS_z, + KC(50), KS_x, + KC(51), KS_c, + KC(52), KS_v, + KC(53), KS_b, + KC(54), KS_m, + KC(55), KS_n, + KC(56), KS_space, + KC(57), KS_a, + KC(58), KS_s, + KC(59), KS_d, + KC(60), KS_f, + KC(61), KS_g, + KC(62), KS_k, + KC(63), KS_j, + KC(64), KS_h, + KC(65), KS_Tab, + KC(66), KS_q, + KC(67), KS_w, + KC(68), KS_e, + KC(69), KS_r, + KC(70), KS_u, + KC(71), KS_y, + KC(72), KS_t, + KC(73), KS_Cmd_Debugger, KS_Escape, + KC(74), KS_1, KS_exclam, + KC(75), KS_2, KS_at, + KC(76), KS_3, KS_numbersign, + KC(77), KS_4, KS_dollar, + KC(78), KS_7, KS_ampersand, + KC(79), KS_6, KS_asciicircum, + KC(80), KS_5, KS_percent, + + KC(90), KS_Shift_L, + KC(91), KS_Shift_R, + KC(92), KS_Alt_L, + KC(93), KS_Alt_R, + KC(94), KS_Control_L, + KC(95), KS_Cmd1, + KC(96), KS_Cmd2, +#if 0 + //KC(55), KS_KP_Multiply, + //KC(58), KS_Caps_Lock, + //KC(59), KS_Cmd_Screen0, KS_f1, + //KC(60), KS_Cmd_Screen1, KS_f2, + //KC(61), KS_Cmd_Screen2, KS_f3, + //KC(62), KS_Cmd_Screen3, KS_f4, + //KC(63), KS_Cmd_Screen4, KS_f5, + //KC(64), KS_Cmd_Screen5, KS_f6, + //KC(65), KS_Cmd_Screen6, KS_f7, + //KC(66), KS_Cmd_Screen7, KS_f8, + //KC(67), KS_Cmd_Screen8, KS_f9, + //KC(68), KS_Cmd_Screen9, KS_f10, + //KC(69), KS_Num_Lock, + //KC(70), KS_Hold_Screen, + //KC(71), KS_KP_Home, KS_KP_7, + //KC(72), KS_KP_Up, KS_KP_8, + //KC(73), KS_KP_Prior, KS_KP_9, + //KC(74), KS_KP_Subtract, + //KC(75), KS_KP_Left, KS_KP_4, + //K/C(76), KS_KP_Begin, KS_KP_5, + //KC(77), KS_KP_Right, KS_KP_6, + //KC(78), KS_KP_Add, + //KC(79), KS_KP_End, KS_KP_1, + //KC(80), KS_KP_Down, KS_KP_2, + //KC(81), KS_KP_Next, KS_KP_3, + //KC(82), KS_KP_Insert, KS_KP_0, + //KC(83), KS_KP_Delete, KS_KP_Decimal, + //KC(87), KS_f11, + //KC(88), KS_f12, + /* 127, break, */ + //KC(156), KS_KP_Enter, + /* 170, print screen, */ + //KC(181), KS_KP_Divide, + /* 183, print screen, */ + //KC(184), KS_Alt_R, KS_Multi_key, + //KC(199), KS_Home, + //KC(201), KS_Prior, + //K/C(207), KS_End, + //K/C(209), KS_Next, + ///KC(210), KS_Insert, + //KC(211), KS_KP_Delete, + /* 219, left win, */ + /* 220, right win, */ + /* 221, menu, */ +#endif +}; + +static const keysym_t nextkbd_keydesc_de[] = { +/* pos normal shifted altgr shift-altgr */ + KC(3), KS_2, KS_quotedbl, KS_twosuperior, + KC(4), KS_3, KS_section, KS_threesuperior, + KC(7), KS_6, KS_ampersand, + KC(8), KS_7, KS_slash, KS_braceleft, + KC(9), KS_8, KS_parenleft, KS_bracketleft, + KC(10), KS_9, KS_parenright, KS_bracketright, + KC(11), KS_0, KS_equal, KS_braceright, + KC(12), KS_ssharp, KS_question, KS_backslash, + KC(13), KS_dead_acute, KS_dead_grave, + KC(16), KS_q, KS_Q, KS_at, + KC(21), KS_z, + KC(26), KS_udiaeresis, + KC(27), KS_plus, KS_asterisk, KS_dead_tilde, + KC(39), KS_odiaeresis, + KC(40), KS_adiaeresis, + KC(41), KS_dead_circumflex,KS_dead_abovering, + KC(43), KS_numbersign, KS_apostrophe, + KC(44), KS_y, + KC(50), KS_m, KS_M, KS_mu, + KC(51), KS_comma, KS_semicolon, + KC(52), KS_period, KS_colon, + KC(53), KS_minus, KS_underscore, + KC(86), KS_less, KS_greater, KS_bar, KS_brokenbar, + KC(184), KS_Mode_switch, KS_Multi_key, +}; + +static const keysym_t nextkbd_keydesc_de_nodead[] = { +/* pos normal shifted altgr shift-altgr */ + KC(13), KS_apostrophe, KS_grave, + KC(27), KS_plus, KS_asterisk, KS_asciitilde, + KC(41), KS_asciicircum, KS_degree, +}; + +static const keysym_t nextkbd_keydesc_dk[] = { +/* pos normal shifted altgr shift-altgr */ + KC(3), KS_2, KS_quotedbl, KS_at, + KC(4), KS_3, KS_numbersign, KS_sterling, + KC(5), KS_4, KS_currency, KS_dollar, + KC(7), KS_6, KS_ampersand, + KC(8), KS_7, KS_slash, KS_braceleft, + KC(9), KS_8, KS_parenleft, KS_bracketleft, + KC(10), KS_9, KS_parenright, KS_bracketright, + KC(11), KS_0, KS_equal, KS_braceright, + KC(12), KS_plus, KS_question, + KC(13), KS_dead_acute, KS_dead_grave, KS_bar, + KC(26), KS_aring, + KC(27), KS_dead_diaeresis, KS_dead_circumflex, KS_dead_tilde, + KC(39), KS_ae, + KC(40), KS_oslash, + KC(41), KS_onehalf, KS_paragraph, + KC(43), KS_apostrophe, KS_asterisk, + KC(51), KS_comma, KS_semicolon, + KC(52), KS_period, KS_colon, + KC(53), KS_minus, KS_underscore, + KC(86), KS_less, KS_greater, KS_backslash, + KC(184), KS_Mode_switch, KS_Multi_key, +}; + +static const keysym_t nextkbd_keydesc_dk_nodead[] = { +/* pos normal shifted altgr shift-altgr */ + KC(13), KS_apostrophe, KS_grave, KS_bar, + KC(27), KS_diaeresis, KS_asciicircum, KS_asciitilde, +}; + +static const keysym_t nextkbd_keydesc_fr[] = { +/* pos normal shifted altgr shift-altgr */ + KC(2), KS_ampersand, KS_1, + KC(3), KS_eacute, KS_2, KS_asciitilde, + KC(4), KS_quotedbl, KS_3, KS_numbersign, + KC(5), KS_apostrophe, KS_4, KS_braceleft, + KC(6), KS_parenleft, KS_5, KS_bracketleft, + KC(7), KS_minus, KS_6, KS_bar, + KC(8), KS_egrave, KS_7, KS_grave, + KC(9), KS_underscore, KS_8, KS_backslash, + KC(10), KS_ccedilla, KS_9, KS_asciicircum, + KC(11), KS_agrave, KS_0, KS_at, + KC(12), KS_parenright, KS_degree, KS_bracketright, + KC(13), KS_equal, KS_plus, KS_braceright, + KC(16), KS_a, + KC(17), KS_z, + KC(26), KS_dead_circumflex, KS_dead_diaeresis, + KC(27), KS_dollar, KS_sterling, KS_currency, + KC(30), KS_q, + KC(39), KS_m, + KC(40), KS_ugrave, KS_percent, + KC(41), KS_twosuperior, + KC(43), KS_asterisk, KS_mu, + KC(44), KS_w, + KC(50), KS_comma, KS_question, + KC(51), KS_semicolon, KS_period, + KC(52), KS_colon, KS_slash, + KC(53), KS_exclam, KS_section, + KC(86), KS_less, KS_greater, + KC(184), KS_Mode_switch, KS_Multi_key, +}; + +static const keysym_t nextkbd_keydesc_it[] = { +/* pos normal shifted altgr shift-altgr */ + KC(3), KS_2, KS_quotedbl, KS_twosuperior, + KC(4), KS_3, KS_sterling, KS_threesuperior, + KC(5), KS_4, KS_dollar, + KC(6), KS_5, KS_percent, + KC(7), KS_6, KS_ampersand, + KC(8), KS_7, KS_slash, + KC(9), KS_8, KS_parenleft, + KC(10), KS_9, KS_parenright, + KC(11), KS_0, KS_equal, + KC(12), KS_apostrophe, KS_question, + KC(13), KS_igrave, KS_asciicircum, + KC(26), KS_egrave, KS_eacute, KS_braceleft, KS_bracketleft, + KC(27), KS_plus, KS_asterisk, KS_braceright, KS_bracketright, + KC(39), KS_ograve, KS_Ccedilla, KS_at, + KC(40), KS_agrave, KS_degree, KS_numbersign, + KC(41), KS_backslash, KS_bar, + KC(43), KS_ugrave, KS_section, + KC(51), KS_comma, KS_semicolon, + KC(52), KS_period, KS_colon, + KC(53), KS_minus, KS_underscore, + KC(86), KS_less, KS_greater, + KC(184), KS_Mode_switch, KS_Multi_key, +}; + +static const keysym_t nextkbd_keydesc_us_declk[] = { +/* pos normal shifted altgr shift-altgr */ + KC(1), KS_grave, KS_asciitilde, /* replace escape */ + KC(41), KS_less, KS_greater, /* replace grave/tilde */ + KC(143), KS_Multi_key, /* left compose */ + KC(157), KS_Multi_key, /* right compose, replace right control */ + KC(87), KS_Cmd_Debugger, KS_Escape, /* replace F11 */ + KC(189), KS_f13, + KC(190), KS_f14, + KC(191), KS_Help, + KC(192), KS_Execute, + KC(193), KS_f17, + KC(183), KS_f18, + KC(70), KS_f19, /* replace scroll lock */ + KC(127), KS_f20, /* replace break */ + KC(69), KS_KP_F1, /* replace num lock */ + KC(181), KS_KP_F2, /* replace divide */ + KC(55), KS_KP_F3, /* replace multiply */ + KC(74), KS_KP_F4, /* replace subtract */ + + /* keypad is numbers only - no num lock */ + KC(71), KS_KP_7, + KC(72), KS_KP_8, + KC(73), KS_KP_9, + KC(75), KS_KP_4, + KC(76), KS_KP_5, + KC(77), KS_KP_6, + KC(79), KS_KP_1, + KC(80), KS_KP_2, + KC(81), KS_KP_3, + KC(82), KS_KP_0, + KC(83), KS_KP_Decimal, + + KC(206), KS_KP_Subtract, + KC(78), KS_KP_Separator, /* replace add */ + KC(199), KS_Find, /* replace home */ + KC(207), KS_Select, /* replace end */ +}; + +#define KBD_MAP(name, base, map) \ + { name, base, sizeof(map)/sizeof(keysym_t), map } + +const struct wscons_keydesc nextkbd_keydesctab[] = { + KBD_MAP(KB_US, 0, nextkbd_keydesc_us), + KBD_MAP(KB_DE, KB_US, nextkbd_keydesc_de), + KBD_MAP(KB_DE | KB_NODEAD, KB_DE, nextkbd_keydesc_de_nodead), + KBD_MAP(KB_FR, KB_US, nextkbd_keydesc_fr), + KBD_MAP(KB_DK, KB_US, nextkbd_keydesc_dk), + KBD_MAP(KB_DK | KB_NODEAD, KB_DK, nextkbd_keydesc_dk_nodead), + KBD_MAP(KB_IT, KB_US, nextkbd_keydesc_it), + KBD_MAP(KB_US | KB_DECLK, KB_US, nextkbd_keydesc_us_declk), + {0, 0, 0, 0} +}; + +#undef KBD_MAP +#undef KC diff --git a/sys/arch/next68k/dev/wskbdmap_mfii.h b/sys/arch/next68k/dev/wskbdmap_mfii.h new file mode 100644 index 000000000000..2f55e3ddf37d --- /dev/null +++ b/sys/arch/next68k/dev/wskbdmap_mfii.h @@ -0,0 +1,39 @@ +/* $NetBSD: wskbdmap_mfii.h,v 1.1 1999/01/28 11:46:23 dbj Exp $ */ + +/*- + * Copyright (c) 1997 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Juergen Hannken-Illjes. + * + * 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 the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``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 FOUNDATION OR CONTRIBUTORS + * 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 const struct wscons_keydesc nextkbd_keydesctab[]; diff --git a/sys/dev/wscons/wsconsio.h b/sys/dev/wscons/wsconsio.h index 6d23c90a7e48..5a72c52416c3 100644 --- a/sys/dev/wscons/wsconsio.h +++ b/sys/dev/wscons/wsconsio.h @@ -1,4 +1,4 @@ -/* $NetBSD: wsconsio.h,v 1.14 1999/01/26 13:43:00 drochner Exp $ */ +/* $NetBSD: wsconsio.h,v 1.15 1999/01/28 11:46:22 dbj Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -174,6 +174,7 @@ struct wskbd_map_data { #define WSDISPLAY_TYPE_TGA 9 /* DEC PCI TGA */ #define WSDISPLAY_TYPE_SFBP 10 /* DEC TC SFB+ */ #define WSDISPLAY_TYPE_PCIMISC 11 /* (generic) PCI misc. disp. */ +#define WSDISPLAY_TYPE_NEXTMONO 12 /* NeXT mono display */ /* Basic display information. Not applicable to all display types. */ struct wsdisplay_fbinfo { diff --git a/sys/dev/wscons/wsksymdef.h b/sys/dev/wscons/wsksymdef.h index 6f217d85a16b..5f22ebbe31c4 100644 --- a/sys/dev/wscons/wsksymdef.h +++ b/sys/dev/wscons/wsksymdef.h @@ -1,4 +1,4 @@ -/* $NetBSD: wsksymdef.h,v 1.22 1999/01/23 16:59:22 drochner Exp $ */ +/* $NetBSD: wsksymdef.h,v 1.23 1999/01/28 11:46:23 dbj Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -472,6 +472,7 @@ #define KB_DECLK 0x0002 /* DEC LKnnn layout */ #define KB_LK401 0x0004 /* DEC LK401 instead LK201 */ #define KB_SWAPCTRLCAPS 0x0008 /* Swap Control-L and Caps-Lock */ +#define KB_NEXT 0x0010 /* NeXT keyboard */ #define KB_NAMETAB \ { KB_USER, "user" }, \ @@ -485,6 +486,7 @@ { KB_NODEAD, "nodead" }, \ { KB_DECLK, "declk" }, \ { KB_LK401, "lk401" }, \ - { KB_SWAPCTRLCAPS, "swapctrlcaps" } + { KB_SWAPCTRLCAPS, "swapctrlcaps" }, \ + { KB_NEXT, "next" } #endif /* !_DEV_WSCONS_WSKSYMDEF_H_ */