diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-03-15 22:50:06 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-03-15 22:50:06 +0000 |
commit | cdf872aa3a33094a37059b33935aaf5126bb87fb (patch) | |
tree | 888ece5672fcf788c0905f04c21c0a3df22eed4f /sys/arch | |
parent | b1e63c54339bd39a119cfdb973254ea2e58763f5 (diff) |
here will be a wscons-garden
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/hppa/conf/files.hppa | 14 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/conf.c | 8 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/wscons_machdep.c | 135 |
3 files changed, 145 insertions, 12 deletions
diff --git a/sys/arch/hppa/conf/files.hppa b/sys/arch/hppa/conf/files.hppa index 5cb5f02464e..40ecfdf94e1 100644 --- a/sys/arch/hppa/conf/files.hppa +++ b/sys/arch/hppa/conf/files.hppa @@ -1,4 +1,4 @@ -# $OpenBSD: files.hppa,v 1.33 2002/03/15 21:49:44 mickey Exp $ +# $OpenBSD: files.hppa,v 1.34 2002/03/15 22:50:05 mickey Exp $ # # hppa-specific configuration info @@ -11,6 +11,7 @@ maxusers 2 8 64 # "workstation console" routines # include "dev/wscons/files.wscons" +file arch/hppa/hppa/wscons_machdep.c wsdisplay # # Media Independent Interface (mii) @@ -34,8 +35,6 @@ include "dev/i2o/files.i2o" #include "dev/atapiscsi/files.atapiscsi" #include "dev/ata/files.ata" -include "dev/pckbc/files.pckbc" - # # ISA Bus support # @@ -182,11 +181,10 @@ file arch/hppa/gsc/com_harmony.c com_harmony #attach myri at pci #file dev/pci/myri.c myri -# -# PC Keyboard controller (ps2) -# - -#include "dev/pckbc/files.pckbc" +device ps2p: wskbddev, wsmousedev +attach ps2p at gsc +file arch/hppa/gsc/ps2p.c ps2p needs-flag +file arch/hppa/gsc/ps2kbd_map.c ps2p # # Compatibility diff --git a/sys/arch/hppa/hppa/conf.c b/sys/arch/hppa/hppa/conf.c index 312682bafd2..abe06cb4bb5 100644 --- a/sys/arch/hppa/hppa/conf.c +++ b/sys/arch/hppa/hppa/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.15 2001/09/28 02:53:13 mickey Exp $ */ +/* $OpenBSD: conf.c,v 1.16 2002/03/15 22:50:05 mickey Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -274,13 +274,13 @@ iskmemdev(dev) #include <dev/cons.h> cons_decl(pdc); -/*cons_decl(wscons);*/ +cons_decl(ws); cons_decl(com); struct consdev constab[] = { cons_init(pdc), /* XXX you'd better leave it here for pdc.c */ -#if NWSCONS1 > 0 - cons_init(wscons), +#if NWSDISPLAY > 0 + cons_init(ws), #endif #if NCOM > 0 cons_init(com), diff --git a/sys/arch/hppa/hppa/wscons_machdep.c b/sys/arch/hppa/hppa/wscons_machdep.c new file mode 100644 index 00000000000..a055c012237 --- /dev/null +++ b/sys/arch/hppa/hppa/wscons_machdep.c @@ -0,0 +1,135 @@ +/* $OpenBSD: wscons_machdep.c,v 1.1 2002/03/15 22:50:05 mickey Exp $ */ + +/* + * Copyright (c) 2002 Michael Shalayeff + * 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 Michael Shalayeff. + * 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 OR HIS RELATIVES 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 MIND, 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 <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/conf.h> +#include <sys/device.h> +#include <sys/extent.h> + +#include <machine/bus.h> +#include <machine/pdc.h> +#include <machine/iomod.h> + +#include <dev/cons.h> + +#include "sti.h" +#if NSTI > 0 +#include <dev/ic/stireg.h> +#include <dev/ic/stivar.h> +#endif + +#include "ps2p.h" +#if NPS2P > 0 +#include <hppa/gsc/ps2pvar.h> +#endif + +#include "wsdisplay.h" +#if NWSDISPLAY > 0 +#include <dev/wscons/wsdisplayvar.h> +#endif + +#include "wskbd.h" +#if NWSKBD > 0 +#include <dev/wscons/wskbdvar.h> +#endif + +cons_decl(ws); + +void +wscnprobe(cp) + struct consdev *cp; +{ + int maj; + + /* locate the major number */ + for (maj = 0; maj < nchrdev; maj++) + if (cdevsw[maj].d_open == wsdisplayopen) + break; + + if (maj == nchrdev) + panic("wsdisplay is not in cdevsw[]"); + + /* TODO check the page0 console path */ +#if NSTI > 0 + if (PAGE0->mem_cons.pz_class == PCL_DISPL) { + + } else + return; +#else + return; +#endif +#if NPS2P > 0 + if (PAGE0->mem_kbd.pz_class == PCL_KEYBD) { + + } + else + return; +#else + return; +#endif + + cp->cn_dev = makedev(maj, 0); + cp->cn_pri = CN_INTERNAL; +} + +void +wscninit(cp) + struct consdev *cp; +{ + /* TODO map the page0's console/keyboard devices */ +} + +void +wscnputc(dev, i) + dev_t dev; + char i; +{ + wsdisplay_cnputc(dev, (int)i); +} + +int +wscngetc(dev) + dev_t dev; +{ + return (wskbd_cngetc(dev)); +} + +void +wscnpollc(dev, on) + dev_t dev; + int on; +{ + wskbd_cnpollc(dev, on); +} |