Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amiga Initial, still incomplete wscons support by J...



details:   https://anonhg.NetBSD.org/src/rev/2e71a93cbf49
branches:  trunk
changeset: 503208:2e71a93cbf49
user:      is <is%NetBSD.org@localhost>
date:      Fri Feb 02 21:52:11 2001 +0000

description:
Initial, still incomplete wscons support by Jukka Andberg, PR 11068

diffstat:

 sys/arch/amiga/amiga/autoconf.c     |     3 +-
 sys/arch/amiga/amiga/conf.c         |    16 +-
 sys/arch/amiga/conf/GENERIC         |    23 +-
 sys/arch/amiga/conf/files.amiga     |    20 +-
 sys/arch/amiga/dev/amidisplaycc.c   |  1098 +++++++++++++++++++++++++++++++++++
 sys/arch/amiga/dev/kbd.c            |   184 +++++-
 sys/arch/amiga/dev/wskbdmap_amiga.c |   552 +++++++++++++++++
 sys/arch/amiga/dev/wskbdmap_amiga.h |    39 +
 8 files changed, 1924 insertions(+), 11 deletions(-)

diffs (truncated from 2101 to 300 lines):

diff -r c05deb715c30 -r 2e71a93cbf49 sys/arch/amiga/amiga/autoconf.c
--- a/sys/arch/amiga/amiga/autoconf.c   Fri Feb 02 21:17:45 2001 +0000
+++ b/sys/arch/amiga/amiga/autoconf.c   Fri Feb 02 21:52:11 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.77 2000/06/10 19:34:46 frueauf Exp $    */
+/*     $NetBSD: autoconf.c,v 1.78 2001/02/02 21:52:12 is Exp $ */
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -275,6 +275,7 @@
                config_found(dp, "kbd", simple_devprint);
                config_found(dp, "ms", simple_devprint);
                config_found(dp, "grfcc", simple_devprint);
+               config_found(dp, "amidisplaycc", simple_devprint);
                config_found(dp, "fdc", simple_devprint);
        }
        if (is_a4000() || is_a1200()) {
diff -r c05deb715c30 -r 2e71a93cbf49 sys/arch/amiga/amiga/conf.c
--- a/sys/arch/amiga/amiga/conf.c       Fri Feb 02 21:17:45 2001 +0000
+++ b/sys/arch/amiga/amiga/conf.c       Fri Feb 02 21:52:11 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: conf.c,v 1.60 2001/01/14 11:17:28 martin Exp $ */
+/*     $NetBSD: conf.c,v 1.61 2001/02/02 21:52:12 is Exp $     */
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -111,6 +111,12 @@
 #include "rnd.h"
 #include "scsibus.h"
 
+#include "wsdisplay.h"
+#include "amidisplaycc.h"
+#include "wskbd.h"
+cdev_decl(wsdisplay);
+cdev_decl(wskbd);
+
 cdev_decl(wd);
 
 /* open, close, ioctl */
@@ -214,6 +220,10 @@
        cdev_disk_init(NRAID,raid),     /* 50: RAIDframe disk driver */
        cdev_svr4_net_init(NSVR4_NET,svr4_net), /* 51: svr4 net pseudo-device */
        cdev_disk_init(NWD,wd),         /* 52: IDE disk */
+       cdev_wsdisplay_init(NWSDISPLAY,
+                           wsdisplay), /* 53: display */
+
+       cdev_mouse_init(NWSKBD,wskbd),  /* 54: keyboard */
 };
 int    nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
 
@@ -356,11 +366,15 @@
  */
 cons_decl(ser);
 cons_decl(ite);
+cons_decl(amidisplaycc_);
 
 struct consdev constab[] = {
 #if NSER > 0
        cons_init(ser),
 #endif
+#if NAMIDISPLAYCC>0
+       cons_init(amidisplaycc_),
+#endif
 #if NITE > 0
        cons_init(ite),
 #endif
diff -r c05deb715c30 -r 2e71a93cbf49 sys/arch/amiga/conf/GENERIC
--- a/sys/arch/amiga/conf/GENERIC       Fri Feb 02 21:17:45 2001 +0000
+++ b/sys/arch/amiga/conf/GENERIC       Fri Feb 02 21:52:11 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: GENERIC,v 1.155 2001/01/21 20:38:20 is Exp $
+#      $NetBSD: GENERIC,v 1.156 2001/02/02 21:52:13 is Exp $
 
 #
 #if 0
@@ -16,7 +16,7 @@
 
 include "arch/amiga/conf/std.amiga"
 
-#ident                 "GENERIC-$Revision: 1.155 $"
+#ident                 "GENERIC-$Revision: 1.156 $"
 
 #ifdef INSTALL_CONFIGURATION
 makeoptions    COPTS="-Os"
@@ -238,6 +238,15 @@
 #options       RH_HARDWARECURSOR
 
 #ifdef AMIGA_CONFIGURATION
+# wscons aware interface to amiga custom chips. Text-only console.
+# If you enable it enable also wskbd. 
+# 
+#amidisplaycc0 at mainbus0             # wscons interface to custom chips
+#wsdisplay0    at amidisplaycc0 console ?
+#options       WSEMUL_VT100
+#endif
+
+#ifdef AMIGA_CONFIGURATION
 grfcc0         at mainbus0             # custom chips
 grfrt0         at zbus0                # retina II
 #endif
@@ -295,6 +304,16 @@
 #com*          at iobl? port ?         # IOBlix serial ports
 #lpt*          at iobl? port ?         # IOBlix parallel ports
 
+
+#
+# Keyboard device. Optionally can attach a wskbd.
+# wskbd works together with a wsdisplay so enable them both if you will.
+# Don't enable wskbd if you use ite.
+#
+# XXX in std.amiga: kbd0 at mainbus0
+#wskbd0                at kbd0 console ?
+
+
 #ifdef AMIGA_CONFIGURATION
 #
 # Amiga Mainboard devices (sans graphics and keyboard)
diff -r c05deb715c30 -r 2e71a93cbf49 sys/arch/amiga/conf/files.amiga
--- a/sys/arch/amiga/conf/files.amiga   Fri Feb 02 21:17:45 2001 +0000
+++ b/sys/arch/amiga/conf/files.amiga   Fri Feb 02 21:52:11 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.amiga,v 1.103 2001/01/26 10:31:29 aymeric Exp $
+#      $NetBSD: files.amiga,v 1.104 2001/02/02 21:52:12 is Exp $
 
 # maxpartitions must be first item in files.${ARCH}.newconf
 maxpartitions 16                       # NOTE THAT AMIGA IS SPECIAL!
@@ -67,9 +67,10 @@
 file   arch/amiga/dev/a34kbbc.c        a34kbbc
 
 # keyboard
-device kbd: event
+device kbd: event,wskbddev
 attach kbd at mainbus
 file   arch/amiga/dev/kbd.c            kbd needs-flag
+file   arch/amiga/dev/wskbdmap_amiga.c kbd
 
 # serial port
 device ser: tty
@@ -115,7 +116,7 @@
 attach ite at grf
 file   arch/amiga/dev/ite.c            ite needs-flag
 file   arch/amiga/dev/kbdmap.c         ite
-file   arch/amiga/dev/kf_8x8.c         ite
+file   arch/amiga/dev/kf_8x8.c         ite | amidisplaycc
 file   arch/amiga/dev/kf_8x11.c        kfont_8x11
 file   arch/amiga/dev/kf_custom.c      kfont_custom
 
@@ -125,11 +126,18 @@
 file   arch/amiga/dev/grf_cc.c         grfcc needs-flag
 file   arch/amiga/dev/ite_cc.c         grfcc & ite
 
+# wscons interface to custom chips
+device amidisplaycc: wsemuldisplaydev
+attach amidisplaycc at mainbus
+file   arch/amiga/dev/amidisplaycc.c   amidisplaycc needs-flag
+
+include "dev/wscons/files.wscons"
+
 defpseudo      view
 file   arch/amiga/dev/view.c           view | grfcc needs-count
-file   arch/amiga/dev/grfabs.c         grfcc | view
-file   arch/amiga/dev/grfabs_cc.c      grfcc | view
-file   arch/amiga/dev/grfabs_ccglb.c   grfcc | view
+file   arch/amiga/dev/grfabs.c         grfcc | view | amidisplaycc
+file   arch/amiga/dev/grfabs_cc.c      grfcc | view | amidisplaycc
+file   arch/amiga/dev/grfabs_ccglb.c   grfcc | view | amidisplaycc
 
 # retina ZII grf (ite1 grf1)
 device grfrt: grfbus
diff -r c05deb715c30 -r 2e71a93cbf49 sys/arch/amiga/dev/amidisplaycc.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/amiga/dev/amidisplaycc.c Fri Feb 02 21:52:11 2001 +0000
@@ -0,0 +1,1098 @@
+/*-
+ * Copyright (c) 2000 Jukka Andberg.
+ * 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. 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.
+ */
+
+/*
+ * wscons interface to amiga custom chips. Contains the necessary functions
+ * to render text on bitmapped screens. Uses the functions defined in 
+ * grfabs_reg.h for display creation/destruction and low level setup.
+ */
+
+#include "amidisplaycc.h"
+#include "grfcc.h"
+#include "view.h"
+
+#if NAMIDISPLAYCC>0
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/device.h>
+#include <sys/malloc.h>
+#include <sys/systm.h>
+
+#include <sys/conf.h>
+
+#include <amiga/dev/grfabs_reg.h>
+#include <amiga/dev/viewioctl.h>
+#include <amiga/amiga/device.h>
+#include <dev/wscons/wsconsio.h>
+#include <dev/rcons/raster.h>
+#include <dev/wscons/wscons_raster.h>
+#include <dev/wscons/wsdisplayvar.h>
+#include <dev/cons.h>
+
+struct amidisplaycc_softc
+{
+       struct device dev;
+};
+
+
+/* 
+ * Configuration stuff.
+ */
+
+static int  amidisplaycc_match  __P((struct device *, 
+                                    struct cfdata *, 
+                                    void *));
+static void amidisplaycc_attach __P((struct device *, 
+                                    struct device *, 
+                                    void *));
+
+struct cfattach amidisplaycc_ca = {
+       sizeof(struct amidisplaycc_softc), 
+       amidisplaycc_match, 
+       amidisplaycc_attach
+};
+
+cons_decl(amidisplaycc_);
+
+/* end of configuration stuff */
+
+/* These can be lowered if you are sure you dont need that much colors. */
+#define MAXDEPTH 8
+#define MAXCOLORS (1<<MAXDEPTH)
+#define MAXROWS 128
+
+/* Perform validity checking on parameters on some functions? */
+#define PARANOIA
+
+#define ADJUSTCOLORS
+
+/* emulops for wscons */
+void amidisplaycc_cursor       __P(( void *, int, int, int         ));
+int  amidisplaycc_mapchar      __P(( void *, int, unsigned int *   ));
+void amidisplaycc_putchar      __P(( void *, int, int, u_int, long ));
+void amidisplaycc_copycols     __P(( void *, int, int, int, int    ));
+void amidisplaycc_erasecols    __P(( void *, int, int, int, long   ));
+void amidisplaycc_copyrows     __P(( void *, int, int, int         ));
+void amidisplaycc_eraserows    __P(( void *, int, int, long        ));
+int  amidisplaycc_alloc_attr   __P(( void *, int, int, int, long * ));
+/* end of emulops for wscons */
+
+/* accessops for wscons */
+int      amidisplaycc_ioctl        __P(( void *, u_long, caddr_t, 
+                                        int, struct proc *              ));
+paddr_t  amidisplaycc_mmap         __P(( void *, off_t, int              ));
+int      amidisplaycc_alloc_screen __P(( void *, 
+                                        const struct wsscreen_descr *,
+                                        void **, int *, int *, long *   ));
+
+void     amidisplaycc_free_screen  __P(( void *, void *                  ));
+int      amidisplaycc_show_screen  __P(( void *, void *, int, 
+                                        void (*) (void *, int, int), 
+                                        void *                          ));
+int      amidisplaycc_load_font    __P(( void *, void *, 
+                                        struct wsdisplay_font *         ));
+/* end of accessops for wscons */
+
+/* 
+ * These structures are passed to wscons, and they contain the
+ * display-specific callback functions.
+ */
+
+const struct wsdisplay_accessops amidisplaycc_accessops = {
+       amidisplaycc_ioctl,



Home | Main Index | Thread Index | Old Index