Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/vax/uba Revamped QVSS (VCB01) support. (from Charl...
details: https://anonhg.NetBSD.org/src/rev/38512356d809
branches: trunk
changeset: 339212:38512356d809
user: matt <matt%NetBSD.org@localhost>
date: Sun Jul 05 03:07:21 2015 +0000
description:
Revamped QVSS (VCB01) support. (from Charles Dickman)
diffstat:
sys/arch/vax/uba/qv.c | 2091 ++++++++++++++++++------------------------
sys/arch/vax/uba/qv_ic.h | 70 +
sys/arch/vax/uba/qvareg.h | 284 +++++
sys/arch/vax/uba/qvaux.c | 935 +++++++++++++++++++
sys/arch/vax/uba/qvavar.h | 128 ++
sys/arch/vax/uba/qvkbd.c | 315 ++++++
sys/arch/vax/uba/qvkbdvar.h | 50 +
sys/arch/vax/uba/qvms.c | 237 ++++
8 files changed, 2916 insertions(+), 1194 deletions(-)
diffs (truncated from 4278 to 300 lines):
diff -r b3878eab13cd -r 38512356d809 sys/arch/vax/uba/qv.c
--- a/sys/arch/vax/uba/qv.c Sun Jul 05 03:06:27 2015 +0000
+++ b/sys/arch/vax/uba/qv.c Sun Jul 05 03:07:21 2015 +0000
@@ -1,13 +1,9 @@
-/* $NetBSD: qv.c,v 1.30 2014/07/25 08:10:35 dholland Exp $ */
-
-/*-
- * Copyright (c) 1988
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
+/*$Header: /cvsroot/src/sys/arch/vax/uba/qv.c,v 1.31 2015/07/05 03:07:21 matt Exp $*/
+/*
+ * Copyright (c) 2015 Charles H. Dickman. All rights reserved.
+ * Derived from smg.c
+ * Copyright (c) 1998 Ludd, University of Lule}, Sweden.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -17,1316 +13,1023 @@
* 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. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * @(#)qv.c 7.2 (Berkeley) 1/21/94
- */
-
-/*
- * derived from: @(#)qv.c 1.8 (ULTRIX) 8/21/85
- */
-
-/************************************************************************
- * *
- * Copyright (c) 1985 by *
- * Digital Equipment Corporation, Maynard, MA *
- * All rights reserved. *
- * *
- * This software is furnished under a license and may be used and *
- * copied only in accordance with the terms of such license and *
- * with the inclusion of the above copyright notice. This *
- * software or any other copies thereof may not be provided or *
- * otherwise made available to any other person. No title to and *
- * ownership of the software is hereby transferred. *
- * *
- * This software is derived from software received from the *
- * University of California, Berkeley, and from Bell *
- * Laboratories. Use, duplication, or disclosure is subject to *
- * restrictions under license agreements with University of *
- * California and with AT&T. *
- * *
- * The information in this software is subject to change without *
- * notice and should not be construed as a commitment by Digital *
- * Equipment Corporation. *
- * *
- * Digital assumes no responsibility for the use or reliability *
- * of its software on equipment which is not supplied by Digital. *
- * *
- ************************************************************************
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed at Ludd, University of
+ * Lule}, Sweden and its contributors.
+ * 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 driver provides glass tty functionality to the qvss. It is a strange
- * device in that it supports three subchannels. The first being the asr,
- * the second being a channel that intercepts the chars headed for the screen
- * ( like a pseudo tty ) and the third being a source of mouse state changes.
- * NOTE: the second is conditional on #ifdef CONS_HACK in this version
- * of the driver, as it's a total crock.
- *
- * There may be one and only one qvss in the system. This restriction is based
- * on the inability to map more than one at a time. This restriction will
- * exist until the kernel has shared memory services. This driver therefore
- * support a single unit. No attempt was made to have it service more.
- *
- * (this belongs in sccs - not here)
- *
- * 02 Aug 85 -- rjl
- * Changed the names of the special setup routines so that the system
- * can have a qvss or a qdss system console.
- *
- * 03 Jul 85 -- rjl
- * Added a check for virtual mode in qvputc so that the driver
- * doesn't crash while in a dump which is done in physical mode.
- *
- * 10 Apr 85 -- jg
- * Well, our theory about keyboard handling was wrong; most of the
- * keyboard is in autorepeat, down mode. These changes are to make
- * the qvss work the same as the Vs100, which is not necessarily
- * completely correct, as some chord usage may fail. But since we
- * can't easily change the Vs100, we might as well propagate the
- * problem to another device. There are also changes for screen and
- * mouse accellaration.
- *
- * 27 Mar 85 -- rjl
- * MicroVAX-II systems have interval timers that interrupt at ipl4.
- * Everything else is higher and thus causes us to miss clock ticks. The
- * problem isn't severe except in the case of a device like this one that
- * generates lots of interrupts. We aren't willing to make this change to
- * all device drivers but it seems acceptable in this case.
- *
- * 3 Dec 84 -- jg
- * To continue the tradition of building a better mouse trap, this
- * driver has been extended to form Vs100 style event queues. If the
- * mouse device is open, the keyboard events are intercepted and put
- * into the shared memory queue. Unfortunately, we are ending up with
- * one of the longest Unix device drivers. Sigh....
- *
- * 20 Nov 84 -- rjl
- * As a further complication this driver is required to function as the
- * virtual system console. This code runs before and during auto-
- * configuration and therefore is require to have a second path for setup.
- * It is futher constrained to have a character output routine that
- * is not dependent on the interrupt system.
- *
+ * 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.
*/
+/* 1 2 3 4 5 6 7 */
+/*3456789012345678901234567890123456789012345678901234567890123456789012345678*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: qv.c,v 1.30 2014/07/25 08:10:35 dholland Exp $");
-
-#include "qv.h"
-#if NQV > 0
-
-#include "../include/pte.h"
+__KERNEL_RCSID(0, "$Header: /cvsroot/src/sys/arch/vax/uba/qv.c,v 1.31 2015/07/05 03:07:21 matt Exp $");
-#include "sys/param.h"
-#include "sys/conf.h"
-#include "qvioctl.h"
-#include "sys/tty.h"
-#include "sys/buf.h"
-#include "sys/vm.h"
-#include "sys/file.h"
-#include "sys/uio.h"
-#include "sys/kernel.h"
-#include "sys/syslog.h"
-#include "../include/cpu.h"
-#include "../include/mtpr.h"
-#include "ubareg.h"
-#include "ubavar.h"
-
-#define CONS_HACK
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/callout.h>
+#include <sys/conf.h>
+#include <sys/cpu.h>
+#include <sys/device.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/extent.h> /***/
+#include <sys/time.h>
+#include <sys/bus.h>
+#include <vax/include/pte.h> /* temporary */
+#include <machine/sid.h>
+#include <dev/cons.h>
+#include <dev/qbus/ubavar.h>
+#include <dev/wscons/wsdisplayvar.h>
+#include <dev/wscons/wsconsio.h>
+#include <dev/wscons/wscons_callbacks.h>
+#include <dev/wsfont/wsfont.h>
+#include <dev/wsfb/genfbvar.h>
+#include <vax/include/sgmap.h> /***/
-struct uba_device *qvinfo[NQV];
+#include "uba_common.h" /***/
+#include "qv.h"
+#include "qv_ic.h"
+#include "qvaux.h"
+#include "opt_wsfont.h"
-struct tty qv_tty[NQV*4];
-
-#define nNQV NQV
-int nqv = NQV*4;
+#define QMEMBASE 0x30000000
+#define QVSIZE 0x40000
+#define QV_SCANMAP 0x3F800
+#define QV_CURSRAM 0x3FFE0
-/*
- * Definition of the driver for the auto-configuration program.
- */
-int qvprobe(), qvattach(), qvkint(), qvvint();
-u_short qvstd[] = { 0 };
-struct uba_driver qvdriver =
- { qvprobe, 0, qvattach, 0, qvstd, "qv", qvinfo };
-
-extern char qvmem[][512*VAX_NBPG];
-extern struct pte QVmap[][512];
+#define QV_CSR 0
+#define QV_CSR_1 (1 << 2)
+#define QV_CSR_2 (1 << 3)
+#define QV_CSR_BANK (15 << 11)
+#define QV_CUR_X 2
+#define QV_CRTC_AR 8
+#define QV_CRTC_DR 10
+#define QV_IC 12
+#define QV_ICDR QV_ICDR
+#define QV_ICSR (QV_ICDR + 2)
-/*
- * Local variables for the driver. Initialized for 15' screen
- * so that it can be used during the boot process.
- */
+/* Screen hardware defs */
+#define QV_COLS 128 /* char width of screen */
+#define QV_ROWS 57 /* rows of char on screen */
+#define QV_CHEIGHT 15 /* lines a char consists of */
+#define QV_NEXTROW (QV_COLS * QV_CHEIGHT)
+#define QV_YWIDTH 864
+#define QV_XWIDTH 1024
-#define QVWAITPRI (PZERO+1)
+/* hardware cursor */
+#define CUR_BLINKN 0x00
+#define CUR_BLANK 0x20
+#define CUR_BLINKS 0x40
+#define CUR_BLINKF 0x60
+#define CUR_BLINKM 0x60
+#define CUR_OFF CUR_BLANK
+#define CUR_ON CUR_BLINKS
+#define CUR_START 10
+#define CUR_END 11
+#define CUR_HI 14
+#define CUR_LO 15
+
+//static uint16_t curcmd, curx, cury, hotX, hotY;
+static int bgmask, fgmask;
-#define QVKEYBOARD 0 /* minor 0, keyboard/glass tty */
-#define QVPCONS 1 /* minor 1, console interceptor XXX */
-#define QVMOUSECHAN 2 /* minor 2, mouse */
-#define QVSPARE 3 /* unused */
-#define QVCHAN(unit) ((unit) & 03)
-/*
- * v_putc is the switch that is used to redirect the console cnputc to the
- * virtual console vputc. consops is used to redirect the console
- * device to the qvss console.
- */
-extern int (*v_putc)();
-extern const struct cdevsw *consops;
-/*
- * qv_def_scrn is used to select the appropriate tables. 0=15 inch 1=19 inch,
- * 2 = uVAXII.
- */
-int qv_def_scrn = 2;
+static int qv_match(device_t, cfdata_t, void *);
+static void qv_attach(device_t, device_t, void *);
+
+static void qv_cursor(void *, int, int, int);
+static int qv_mapchar(void *, int, unsigned int *);
+static void qv_putchar(void *, int, int, u_int, long);
+static void qv_copycols(void *, int, int, int,int);
+static void qv_erasecols(void *, int, int, int, long);
+static void qv_copyrows(void *, int, int, int);
+static void qv_eraserows(void *, int, int, long);
+static int qv_allocattr(void *, int, int, int, long *);
-#define QVMAXEVQ 64 /* must be power of 2 */
-#define EVROUND(x) ((x) & (QVMAXEVQ - 1))
+const struct wsdisplay_emulops qv_emulops = {
+ .cursor = qv_cursor,
+ .mapchar = qv_mapchar,
+ .putchar = qv_putchar,
+ .copycols = qv_copycols,
+ .erasecols = qv_erasecols,
Home |
Main Index |
Thread Index |
Old Index