diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2001-03-01 23:19:35 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2001-03-01 23:19:35 +0000 |
commit | 2e04744fe2860ea73d6248af21e1784927bdb584 (patch) | |
tree | c061f76f3fe569dd23e01063ddb51b6fb467c690 /sys | |
parent | a613fbdf3fd8cb6d89873d11d1dd70d3b00c9d27 (diff) |
Fix (or a least hack around) console configuration changes to wscons.
Needs to be looked at closer, but seems to work. Mostly copied from i386.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/powerpc/conf/files.powerpc | 1 | ||||
-rw-r--r-- | sys/arch/powerpc/powerpc/conf.c | 6 | ||||
-rw-r--r-- | sys/arch/powerpc/powerpc/machdep.c | 3 | ||||
-rw-r--r-- | sys/arch/powerpc/powerpc/wscons_machdep.c | 105 |
4 files changed, 113 insertions, 2 deletions
diff --git a/sys/arch/powerpc/conf/files.powerpc b/sys/arch/powerpc/conf/files.powerpc index 9eac2382c24..41ee9f4aa3c 100644 --- a/sys/arch/powerpc/conf/files.powerpc +++ b/sys/arch/powerpc/conf/files.powerpc @@ -20,6 +20,7 @@ file arch/powerpc/powerpc/fuswintr.c file arch/powerpc/powerpc/in_cksum.c file arch/powerpc/powerpc/ipkdb_glue.c ipkdb file arch/powerpc/powerpc/machdep.c +file arch/powerpc/powerpc/wscons_machdep.c file arch/powerpc/powerpc/mem.c file arch/powerpc/powerpc/dma.c file arch/powerpc/powerpc/ofw_machdep.c diff --git a/sys/arch/powerpc/powerpc/conf.c b/sys/arch/powerpc/powerpc/conf.c index 21454053eff..3a5626d170f 100644 --- a/sys/arch/powerpc/powerpc/conf.c +++ b/sys/arch/powerpc/powerpc/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.18 2000/10/01 00:23:26 rahnds Exp $ */ +/* $OpenBSD: conf.c,v 1.19 2001/03/01 23:19:34 drahn Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom @@ -362,10 +362,14 @@ blktochr(dev) #include <dev/cons.h> #include <vgafb_pci.h> +cons_decl(ws); cons_decl(com); cons_decl(ofc); struct consdev constab[] = { +#if NWSDISPLAY > 0 + cons_init(ws), +#endif #if NOFCONS > 0 cons_init(ofc), #endif diff --git a/sys/arch/powerpc/powerpc/machdep.c b/sys/arch/powerpc/powerpc/machdep.c index 13bbc868842..06a4a848bac 100644 --- a/sys/arch/powerpc/powerpc/machdep.c +++ b/sys/arch/powerpc/powerpc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.53 2001/02/15 04:11:11 drahn Exp $ */ +/* $OpenBSD: machdep.c,v 1.54 2001/03/01 23:19:34 drahn Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -387,6 +387,7 @@ where = 3; /* * Replace with real console. */ + cninit(); ofwconprobe(); #if NIPKDB > 0 diff --git a/sys/arch/powerpc/powerpc/wscons_machdep.c b/sys/arch/powerpc/powerpc/wscons_machdep.c new file mode 100644 index 00000000000..2b7a354b4cd --- /dev/null +++ b/sys/arch/powerpc/powerpc/wscons_machdep.c @@ -0,0 +1,105 @@ +/* $OpenBSD: wscons_machdep.c,v 1.1 2001/03/01 23:19:34 drahn Exp $ */ + +/* + * Copyright (c) 2001 Aaron Campbell + * 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 Aaron Campbell. + * 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 <dev/cons.h> + +#include "wsdisplay.h" +#if NWSDISPLAY > 0 +#include <dev/wscons/wsdisplayvar.h> +#endif + +void wscnprobe __P((struct consdev *)); +void wscninit __P((struct consdev *)); +void wscnputc __P((dev_t, char)); +int wscngetc __P((dev_t)); +void wscnpollc __P((dev_t, int)); + +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) { + /* we are not in cdevsw[], give up */ + panic("wsdisplay is not in cdevsw[]"); + } + + cp->cn_dev = makedev(maj, 0); + cp->cn_pri = CN_INTERNAL; +} + +void +wscninit(cp) + struct consdev *cp; +{ + return; +} + +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); +} |