Home | History | Annotate | Line # | Download | only in dev
nextcons.c revision 1.1
      1 /*	$NetBSD: nextcons.c,v 1.1 1999/03/26 04:42:59 dbj Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1999 Darrin B. Jewell
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *      This product includes software developed by Darrin B. Jewell
     18  * 4. The name of the author may not be used to endorse or promote products
     19  *    derived from this software without specific prior written permission
     20  *
     21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     22  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     23  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     24  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     26  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     30  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31  */
     32 
     33 #include <sys/cdefs.h>
     34 
     35 #include <sys/param.h>
     36 #include <sys/systm.h>
     37 #include <sys/kernel.h>
     38 #include <sys/proc.h>
     39 #include <sys/device.h>
     40 #include <sys/malloc.h>
     41 #include <sys/errno.h>
     42 #include <sys/queue.h>
     43 #include <sys/lock.h>
     44 
     45 #include <machine/autoconf.h>
     46 #include <machine/cpu.h>
     47 #include <machine/intr.h>
     48 #include <machine/bus.h>
     49 
     50 #include <dev/cons.h>
     51 #include <dev/wscons/wskbdvar.h>
     52 #include <dev/wscons/wsdisplayvar.h>
     53 #include <next68k/dev/nextdisplayvar.h>
     54 #include <next68k/dev/nextkbdvar.h>
     55 
     56 void nextcnprobe __P((struct consdev *));
     57 void nextcninit __P((struct consdev *));
     58 int nextcngetc __P((dev_t));
     59 void nextcnputc __P((dev_t, int));
     60 void nextcnpollc __P((dev_t, int));
     61 
     62 
     63 void
     64 nextcnprobe(struct consdev *cp)
     65 {
     66 	cp->cn_pri = CN_INTERNAL;
     67 	cp->cn_dev = NODEV;
     68 }
     69 
     70 void
     71 nextcninit(struct consdev *cp)
     72 {
     73 	nextkbd_cnattach(NEXT68K_INTIO_BUS_SPACE);
     74 	nextdisplay_cnattach();
     75 }
     76 
     77 int
     78 nextcngetc (dev_t dev)
     79 {
     80 	return wskbd_cngetc(dev);
     81 }
     82 
     83 void
     84 nextcnputc(dev_t dev, int c)
     85 {
     86 	wsdisplay_cnputc(dev,c);
     87 }
     88 
     89 void
     90 nextcnpollc(dev_t dev, int on)
     91 {
     92 	wskbd_cnpollc(dev,on);
     93 }
     94