summaryrefslogtreecommitdiff
path: root/sys/arch/vax/vsa
diff options
context:
space:
mode:
authorHugh Graham <hugh@cvs.openbsd.org>2001-05-16 22:15:20 +0000
committerHugh Graham <hugh@cvs.openbsd.org>2001-05-16 22:15:20 +0000
commite8dd1b88bd968b7449a1c61238b069d768c2931c (patch)
treeb32bd4a1892e3d1eaa590edab70abb6fabbd7c42 /sys/arch/vax/vsa
parentcef3dbb0f27f1eb7a93933a18167f22264dc3383 (diff)
Blind merge of wscons support from NetBSD/vax. Perhaps someone with a
supported framebuffer (simple monochrome) can finish this off. If anyone has run across docs for LCG or SPGFX, please get in touch.
Diffstat (limited to 'sys/arch/vax/vsa')
-rw-r--r--sys/arch/vax/vsa/dz_ibus.c141
-rw-r--r--sys/arch/vax/vsa/smg.c324
2 files changed, 297 insertions, 168 deletions
diff --git a/sys/arch/vax/vsa/dz_ibus.c b/sys/arch/vax/vsa/dz_ibus.c
index 242d8921311..510ce2c3a03 100644
--- a/sys/arch/vax/vsa/dz_ibus.c
+++ b/sys/arch/vax/vsa/dz_ibus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dz_ibus.c,v 1.4 2001/02/11 06:34:38 hugh Exp $ */
+/* $OpenBSD: dz_ibus.c,v 1.5 2001/05/16 22:15:19 hugh Exp $ */
/* $NetBSD: dz_ibus.c,v 1.15 1999/08/27 17:50:42 ragge Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
@@ -57,11 +57,13 @@
#include "../qbus/dzreg.h"
#include "../qbus/dzvar.h"
-#include "lkc.h"
+#include "../dec/dzkbdvar.h"
+
+#include "dzkbd.h"
+#include "dzms.h"
static int dz_vsbus_match __P((struct device *, struct cfdata *, void *));
static void dz_vsbus_attach __P((struct device *, struct device *, void *));
-static int dz_print __P((void *, const char *));
static vaddr_t dz_regs; /* Used for console */
@@ -83,16 +85,30 @@ static volatile struct ss_dz {/* base address of DZ-controller: 0x200A0000 */
#undef REG
cons_decl(dz);
+cdev_decl(dz);
-int
-dz_print(aux, name)
- void *aux;
- const char *name;
+#if NDZKBD > 0 || NDZMS > 0
+static int
+dz_print(void *aux, const char *name)
{
+#if 0
+#if NDZKBD > 0 || NDZMS > 0
+ struct dz_attach_args *dz_args = aux;
+ if (name == NULL) {
+ printf (" line %d", dz_args->line);
+ if (dz_args->hwflags & DZ_HWFLAG_CONSOLE)
+ printf (" (console)");
+ }
+ return (QUIET);
+#else
if (name)
printf ("lkc at %s", name);
return (UNCONF);
+#endif
+#endif
+ return (UNCONF);
}
+#endif
static int
dz_vsbus_match(parent, cf, aux)
@@ -129,8 +145,11 @@ dz_vsbus_attach(parent, self, aux)
struct device *parent, *self;
void *aux;
{
- struct dz_softc *sc = (void *)self;
+ struct dz_softc *sc = (void *)self;
struct vsbus_attach_args *va = aux;
+#if NDZKBD > 0 || NDZMS > 0
+ struct dzkm_attach_args daa;
+#endif
/*
* XXX - This is evil and ugly, but...
@@ -160,10 +179,28 @@ dz_vsbus_attach(parent, self, aux)
dzattach(sc);
- if (((vax_confdata & 0x80) == 0) ||/* workstation, have lkc */
- (vax_boardtype == VAX_BTYP_48))
- if (cn_tab->cn_pri > CN_NORMAL) /* Passed cnsl detect */
- config_found(self, 0, dz_print);
+#if NDZKBD > 0
+ /* Don't change speed if this is the console */
+ if (cn_tab->cn_dev != makedev(getmajor(dzopen), 0))
+ dz->rbuf = DZ_LPR_RX_ENABLE | (DZ_LPR_B4800 << 8)
+ | DZ_LPR_8_BIT_CHAR;
+ daa.daa_line = 0;
+ daa.daa_flags = (cn_tab->cn_pri == CN_INTERNAL ? DZKBD_CONSOLE : 0);
+ config_found(self, &daa, dz_print);
+#endif
+#if NDZMS > 0
+ dz->rbuf = DZ_LPR_RX_ENABLE | (DZ_LPR_B4800 << 8) | DZ_LPR_7_BIT_CHAR \
+ | DZ_LPR_PARENB | DZ_LPR_OPAR | 1 /* line */;
+ daa.daa_line = 1;
+ daa.daa_flags = 0;
+ config_found(self, &daa, dz_print);
+#endif
+#if 0
+ s = spltty();
+ dzrint(sc);
+ dzxint(sc);
+ splx(s);
+#endif
}
int
@@ -189,8 +226,6 @@ dzcngetc(dev)
return (c);
}
-#define DZMAJOR 1
-
void
dzcnprobe(cndev)
struct consdev *cndev;
@@ -225,8 +260,12 @@ dzcnprobe(cndev)
cndev->cn_pri = CN_REMOTE;
else
cndev->cn_pri = CN_NORMAL;
+#if 0
cndev->cn_dev = makedev(DZMAJOR, diagcons);
dz_regs = iospace;
+#endif
+ cndev->cn_dev = makedev(getmajor(dzopen), diagcons);
+ (vaddr_t)dz = dz_regs = iospace;
ioaccess(iospace, ioaddr, 1);
}
@@ -288,47 +327,45 @@ dzcnpollc(dev, pollflag)
vsbus_setmask(mask);
}
-#if NLKC
-cons_decl(lkc);
-
-void
-lkccninit(cndev)
- struct consdev *cndev;
+#if NDZKBD > 0 || NDZMS > 0
+int
+dzgetc(ls)
+ struct dz_linestate *ls;
{
- dz = (void*)dz_regs;
+ int line = ls->dz_line;
+ u_short rbuf;
- dz->csr = 0; /* Disable scanning until initting is done */
- dz->tcr = 1; /* Turn off all but line 0's xmitter */
- dz->rbuf = 0x1c18; /* XXX */
- dz->csr = 0x20; /* Turn scanning back on */
+ for (;;) {
+ for(; (dz->csr & DZ_CSR_RX_DONE) == 0;)
+ ;
+ rbuf = dz->rbuf;
+ if (((rbuf >> 8) & 3) == line)
+ return (rbuf & 0xff);
+ }
}
-int
-lkccngetc(dev)
- dev_t dev;
+void
+dzputc(ls,ch)
+ struct dz_linestate *ls;
+ int ch;
{
- int lkc_decode(int);
- int c;
-#if 0
- u_char mask;
-
-
- mask = vsbus_setmask(0); /* save old state */
-#endif
-
-loop:
- while ((dz->csr & 0x80) == 0)
- ; /* Wait for char */
-
- c = lkc_decode(dz->rbuf & 255);
- if (c < 1)
- goto loop;
-
-#if 0
- vsbus_clrintr(0x80); /* XXX */
- vsbus_setmask(mask);
-#endif
-
- return (c);
+ int line = 0; /* = ls->dz_line; */
+ u_short tcr;
+ int s;
+
+ /* if the dz has already been attached, the MI
+ driver will do the transmitting: */
+ if (ls && ls->dz_sc) {
+ s = spltty();
+ putc(ch, &ls->dz_sc->sc_dz[line].dz_tty->t_outq);
+ tcr = dz->tcr;
+ if (!(tcr & (1 << line)))
+ dz->tcr = tcr | (1 << line);
+ dzxint(ls->dz_sc);
+ splx(s);
+ return;
+ }
+ /* use dzcnputc to do the transmitting: */
+ dzcnputc(makedev(getmajor(dzopen), line), ch);
}
-#endif
+#endif /* NDZKBD > 0 || NDZMS > 0 */
diff --git a/sys/arch/vax/vsa/smg.c b/sys/arch/vax/vsa/smg.c
index 00bf8b3378c..2b1ea710842 100644
--- a/sys/arch/vax/vsa/smg.c
+++ b/sys/arch/vax/vsa/smg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smg.c,v 1.2 2001/02/11 06:34:38 hugh Exp $ */
+/* $OpenBSD: smg.c,v 1.3 2001/05/16 22:15:19 hugh Exp $ */
/* $NetBSD: smg.c,v 1.21 2000/03/23 06:46:44 thorpej Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
@@ -34,49 +34,103 @@
#include <sys/param.h>
#include <sys/device.h>
#include <sys/systm.h>
-#include <sys/callout.h>
#include <sys/time.h>
#include <sys/malloc.h>
#include <sys/conf.h>
#include <sys/kernel.h>
+#include <machine/vsbus.h>
+#include <machine/sid.h>
+#include <machine/cpu.h>
+#include <machine/ka420.h>
+
#include <dev/cons.h>
+#include "../qbus/dzreg.h"
+#include "../qbus/dzvar.h"
+#include "../dec/dzkbdvar.h"
+
#include <dev/wscons/wsdisplayvar.h>
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wscons_callbacks.h>
-#include <machine/vsbus.h>
-#include <machine/sid.h>
-#include <machine/cpu.h>
-#include <machine/ka420.h>
+#include "dzkbd.h"
-#include "lkc.h"
+/* Safety guard */
+#ifndef FONT_QVSS8x15
+#include <dev/wsfont/qvss8x15.h>
+#endif
+/* Screen hardware defs */
#define SM_COLS 128 /* char width of screen */
#define SM_ROWS 57 /* rows of char on screen */
#define SM_CHEIGHT 15 /* lines a char consists of */
#define SM_NEXTROW (SM_COLS * SM_CHEIGHT)
-
-static int smg_match __P((struct device *, struct cfdata *, void *));
-static void smg_attach __P((struct device *, struct device *, void *));
+#define SM_YWIDTH 864
+#define SM_XWIDTH 1024
+
+/* Cursor register definitions */
+#define CUR_CMD 0
+#define CUR_XPOS 4
+#define CUR_YPOS 8
+#define CUR_XMIN_1 12
+#define CUR_XMAX_1 16
+#define CUR_YMIN_1 20
+#define CUR_YMAX_1 24
+#define CUR_XMIN_2 28
+#define CUR_XMAX_2 32
+#define CUR_YMIN_2 36
+#define CUR_YMAX_2 40
+#define CUR_LOAD 44
+
+#define CUR_CMD_TEST 0x8000
+#define CUR_CMD_HSHI 0x4000
+#define CUR_CMD_VBHI 0x2000
+#define CUR_CMD_LODSA 0x1000
+#define CUR_CMD_FORG2 0x0800
+#define CUR_CMD_ENRG2 0x0400
+#define CUR_CMD_FORG1 0x0200
+#define CUR_CMD_ENRG1 0x0100
+#define CUR_CMD_XHWID 0x0080
+#define CUR_CMD_XHCL1 0x0040
+#define CUR_CMD_XHCLP 0x0020
+#define CUR_CMD_XHAIR 0x0010
+#define CUR_CMD_FOPB 0x0008
+#define CUR_CMD_ENPB 0x0004
+#define CUR_CMD_FOPA 0x0002
+#define CUR_CMD_ENPA 0x0001
+
+#define CUR_XBIAS 216 /* Add to cursor position */
+#define CUR_YBIAS 33
+
+#define WRITECUR(addr, val) *(volatile short *)(curaddr + (addr)) = (val)
+static caddr_t curaddr;
+static short curcmd, curx, cury, hotX, hotY;
+static int bgmask, fgmask;
+
+static int smg_match(struct device *, struct cfdata *, void *);
+static void smg_attach(struct device *, struct device *, void *);
struct smg_softc {
struct device ss_dev;
};
struct cfattach smg_ca = {
- sizeof(struct smg_softc), smg_match, smg_attach,
+ sizeof(struct smg_softc), (cfmatch_t)smg_match, smg_attach,
};
-static void smg_cursor __P((void *, int, int, int));
-static int smg_mapchar __P((void *, int, unsigned int *));
-static void smg_putchar __P((void *, int, int, u_int, long));
-static void smg_copycols __P((void *, int, int, int,int));
-static void smg_erasecols __P((void *, int, int, int, long));
-static void smg_copyrows __P((void *, int, int, int));
-static void smg_eraserows __P((void *, int, int, long));
-static int smg_alloc_attr __P((void *, int, int, int, long *));
+struct cfdriver smg_cd = {
+ NULL, "smg", DV_DULL
+};
+
+static void smg_cursor(void *, int, int, int);
+static int smg_mapchar(void *, int, unsigned int *);
+static void smg_putchar(void *, int, int, u_int, long);
+static void smg_copycols(void *, int, int, int,int);
+static void smg_erasecols(void *, int, int, int, long);
+static void smg_copyrows(void *, int, int, int);
+static void smg_eraserows(void *, int, int, long);
+static int smg_alloc_attr(void *, int, int, int, long *);
const struct wsdisplay_emulops smg_emulops = {
smg_cursor,
@@ -107,21 +161,23 @@ const struct wsscreen_list smg_screenlist = {
static caddr_t sm_addr;
-extern char q_font[];
+extern struct wsdisplay_font qvss8x15;
+static u_char *qf;
+
#define QCHAR(c) (c < 32 ? 32 : (c > 127 ? c - 66 : c - 32))
-#define QFONT(c,line) q_font[QCHAR(c) * 15 + line]
+#define QFONT(c,line) qf[QCHAR(c) * 15 + line]
#define SM_ADDR(row, col, line) \
sm_addr[col + (row * SM_CHEIGHT * SM_COLS) + line * SM_COLS]
-static int smg_ioctl __P((void *, u_long, caddr_t, int, struct proc *));
-static int smg_mmap __P((void *, off_t, int));
-static int smg_alloc_screen __P((void *, const struct wsscreen_descr *,
- void **, int *, int *, long *));
-static void smg_free_screen __P((void *, void *));
-static int smg_show_screen __P((void *, void *, int,
- void (*) (void *, int, int), void *));
-static void smg_crsr_blink __P((void *));
+static int smg_ioctl(void *, u_long, caddr_t, int, struct proc *);
+static paddr_t smg_mmap(void *, off_t, int);
+static int smg_alloc_screen(void *, const struct wsscreen_descr *,
+ void **, int *, int *, long *);
+static void smg_free_screen(void *, void *);
+static int smg_show_screen(void *, void *, int,
+ void (*) (void *, int, int), void *);
+static void smg_crsr_blink(void *);
const struct wsdisplay_accessops smg_accessops = {
smg_ioctl,
@@ -142,13 +198,8 @@ struct smg_screen {
static struct smg_screen smg_conscreen;
static struct smg_screen *curscr;
-static struct callout smg_cursor_ch = CALLOUT_INITIALIZER;
-
int
-smg_match(parent, match, aux)
- struct device *parent;
- struct cfdata *match;
- void *aux;
+smg_match(struct device *parent, struct cfdata *match, void *aux)
{
struct vsbus_attach_args *va = aux;
volatile short *curcmd;
@@ -164,10 +215,10 @@ smg_match(parent, match, aux)
* Try to find the cursor chip by testing the flip-flop.
* If nonexistent, no glass tty.
*/
- curcmd[0] = 0x7fff;
+ curcmd[0] = CUR_CMD_HSHI|CUR_CMD_FOPB;
DELAY(300000);
tmp = cfgtst[0];
- curcmd[0] = 0x8000;
+ curcmd[0] = CUR_CMD_TEST|CUR_CMD_HSHI;
DELAY(300000);
tmp2 = cfgtst[0];
vax_unmap_physmem((vaddr_t)cfgtst, 1);
@@ -179,14 +230,13 @@ smg_match(parent, match, aux)
}
void
-smg_attach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
+smg_attach(struct device *parent, struct device *self, void *aux)
{
struct wsemuldisplaydev_attach_args aa;
printf("\n");
sm_addr = (caddr_t)vax_map_physmem(SMADDR, (SMSIZE/VAX_NBPG));
+ curaddr = (caddr_t)vax_map_physmem(KA420_CUR_BASE, 1);
if (sm_addr == 0) {
printf("%s: Couldn't alloc graphics memory.\n", self->dv_xname);
return;
@@ -195,7 +245,10 @@ smg_attach(parent, self, aux)
aa.console = !(vax_confdata & 0x20);
aa.scrdata = &smg_screenlist;
aa.accessops = &smg_accessops;
- callout_reset(&smc_cursor_ch, hz / 2, smg_crsr_blink, NULL);
+ timeout(smg_crsr_blink, 0, hz/2);
+ curcmd = CUR_CMD_HSHI;
+ WRITECUR(CUR_CMD, curcmd);
+ qf = qvss8x15.data;
config_found(self, &aa, wsemuldisplaydevprint);
}
@@ -204,18 +257,15 @@ static u_char *cursor;
static int cur_on;
static void
-smg_crsr_blink(arg)
- void *arg;
+smg_crsr_blink(void *arg)
{
if (cur_on)
*cursor ^= 255;
- callout_reset(&smg_cursor_ch, hz / 2, smg_crsr_blink, NULL);
+ timeout(smg_crsr_blink, 0, hz/2);
}
void
-smg_cursor(id, on, row, col)
- void *id;
- int on, row, col;
+smg_cursor(void *id, int on, int row, int col)
{
struct smg_screen *ss = id;
@@ -231,10 +281,7 @@ smg_cursor(id, on, row, col)
}
int
-smg_mapchar(id, uni, index)
- void *id;
- int uni;
- unsigned int *index;
+smg_mapchar(void *id, int uni, unsigned int *index)
{
if (uni < 256) {
*index = uni;
@@ -245,11 +292,7 @@ smg_mapchar(id, uni, index)
}
static void
-smg_putchar(id, row, col, c, attr)
- void *id;
- int row, col;
- u_int c;
- long attr;
+smg_putchar(void *id, int row, int col, u_int c, long attr)
{
struct smg_screen *ss = id;
int i;
@@ -274,9 +317,7 @@ smg_putchar(id, row, col, c, attr)
* copies columns inside a row.
*/
static void
-smg_copycols(id, row, srccol, dstcol, ncols)
- void *id;
- int row, srccol, dstcol, ncols;
+smg_copycols(void *id, int row, int srccol, int dstcol, int ncols)
{
struct smg_screen *ss = id;
int i;
@@ -293,10 +334,7 @@ smg_copycols(id, row, srccol, dstcol, ncols)
* Erases a bunch of chars inside one row.
*/
static void
-smg_erasecols(id, row, startcol, ncols, fillattr)
- void *id;
- int row, startcol, ncols;
- long fillattr;
+smg_erasecols(void *id, int row, int startcol, int ncols, long fillattr)
{
struct smg_screen *ss = id;
int i;
@@ -310,9 +348,7 @@ smg_erasecols(id, row, startcol, ncols, fillattr)
}
static void
-smg_copyrows(id, srcrow, dstrow, nrows)
- void *id;
- int srcrow, dstrow, nrows;
+smg_copyrows(void *id, int srcrow, int dstrow, int nrows)
{
struct smg_screen *ss = id;
int frows;
@@ -346,10 +382,7 @@ smg_copyrows(id, srcrow, dstrow, nrows)
}
static void
-smg_eraserows(id, startrow, nrows, fillattr)
- void *id;
- int startrow, nrows;
- long fillattr;
+smg_eraserows(void *id, int startrow, int nrows, long fillattr)
{
struct smg_screen *ss = id;
int frows;
@@ -368,48 +401,116 @@ smg_eraserows(id, startrow, nrows, fillattr)
}
static int
-smg_alloc_attr(id, fg, bg, flags, attrp)
- void *id;
- int fg, bg;
- int flags;
- long *attrp;
+smg_alloc_attr(void *id, int fg, int bg, int flags, long *attrp)
{
*attrp = flags;
return 0;
}
+static void
+setcursor(struct wsdisplay_cursor *v)
+{
+ u_short red, green, blue, curfg[16], curmask[16];
+ int i;
+
+ /* Enable cursor */
+ if (v->which & WSDISPLAY_CURSOR_DOCUR) {
+ if (v->enable)
+ curcmd |= CUR_CMD_ENPB|CUR_CMD_ENPA;
+ else
+ curcmd &= ~(CUR_CMD_ENPB|CUR_CMD_ENPA);
+ WRITECUR(CUR_CMD, curcmd);
+ }
+ if (v->which & WSDISPLAY_CURSOR_DOHOT) {
+ hotX = v->hot.x;
+ hotY = v->hot.y;
+ }
+ if (v->which & WSDISPLAY_CURSOR_DOCMAP) {
+ /* First background */
+ red = fusword(v->cmap.red);
+ green = fusword(v->cmap.green);
+ blue = fusword(v->cmap.blue);
+ bgmask = (((30L * red + 59L * green + 11L * blue) >> 8) >=
+ (((1<<8)-1)*50)) ? ~0 : 0;
+ red = fusword(v->cmap.red+2);
+ green = fusword(v->cmap.green+2);
+ blue = fusword(v->cmap.blue+2);
+ fgmask = (((30L * red + 59L * green + 11L * blue) >> 8) >=
+ (((1<<8)-1)*50)) ? ~0 : 0;
+ }
+ if (v->which & WSDISPLAY_CURSOR_DOSHAPE) {
+ WRITECUR(CUR_CMD, curcmd | CUR_CMD_LODSA);
+ copyin(v->image, curfg, sizeof(curfg));
+ copyin(v->mask, curmask, sizeof(curmask));
+ for (i = 0; i < sizeof(curfg)/2; i++) {
+ WRITECUR(CUR_LOAD, (curfg[i] & fgmask) |
+ ((curmask[i] & ~curfg[i]) & bgmask));
+ }
+ for (i = 0; i < sizeof(curmask)/2; i++) {
+ WRITECUR(CUR_LOAD, curmask[i]);
+ }
+ WRITECUR(CUR_CMD, curcmd);
+ }
+}
+
int
-smg_ioctl(v, cmd, data, flag, p)
- void *v;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
+smg_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p)
{
- struct wsdisplay_fbinfo fb;
+ struct wsdisplay_fbinfo *fb = (void *)data;
+ static short curc;
switch (cmd) {
case WSDISPLAYIO_GTYPE:
- *(u_int *)data = WSDISPLAY_TYPE_PM_MONO;
+ *(u_int *)data = WSDISPLAY_TYPE_VAX_MONO;
break;
case WSDISPLAYIO_GINFO:
- fb.height = 864;
- fb.width = 1024;
- return copyout(&fb, data, sizeof(struct wsdisplay_fbinfo));
+ fb->height = SM_YWIDTH;
+ fb->width = SM_XWIDTH;
+ fb->depth = 1;
+ fb->cmsize = 2;
+ break;
+
+ case WSDISPLAYIO_SVIDEO:
+ if (*(u_int *)data == WSDISPLAYIO_VIDEO_ON) {
+ curcmd = curc;
+ } else {
+ curc = curcmd;
+ curcmd &= ~(CUR_CMD_FOPA|CUR_CMD_ENPA);
+ curcmd |= CUR_CMD_FOPB;
+ }
+ WRITECUR(CUR_CMD, curcmd);
+ break;
+
+ case WSDISPLAYIO_GVIDEO:
+ *(u_int *)data = (curcmd & CUR_CMD_FOPB ?
+ WSDISPLAYIO_VIDEO_OFF : WSDISPLAYIO_VIDEO_ON);
+ break;
+
+ case WSDISPLAYIO_SCURSOR:
+ setcursor((struct wsdisplay_cursor *)data);
+ break;
+
+ case WSDISPLAYIO_SCURPOS:
+ curx = ((struct wsdisplay_curpos *)data)->x;
+ cury = ((struct wsdisplay_curpos *)data)->y;
+ WRITECUR(CUR_XPOS, curx + CUR_XBIAS);
+ WRITECUR(CUR_YPOS, cury + CUR_YBIAS);
+ break;
+
+ case WSDISPLAYIO_GCURPOS:
+ ((struct wsdisplay_curpos *)data)->x = curx;
+ ((struct wsdisplay_curpos *)data)->y = cury;
+ break;
-
default:
- return -1;
+ return ENOTTY;
}
return 0;
}
-static int
-smg_mmap(v, offset, prot)
- void *v;
- off_t offset;
- int prot;
+static paddr_t
+smg_mmap(void *v, off_t offset, int prot)
{
if (offset >= SMSIZE || offset < 0)
return -1;
@@ -417,12 +518,8 @@ smg_mmap(v, offset, prot)
}
int
-smg_alloc_screen(v, type, cookiep, curxp, curyp, defattrp)
- void *v;
- const struct wsscreen_descr *type;
- void **cookiep;
- int *curxp, *curyp;
- long *defattrp;
+smg_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep,
+ int *curxp, int *curyp, long *defattrp)
{
*cookiep = malloc(sizeof(struct smg_screen), M_DEVBUF, M_WAITOK);
bzero(*cookiep, sizeof(struct smg_screen));
@@ -431,19 +528,13 @@ smg_alloc_screen(v, type, cookiep, curxp, curyp, defattrp)
}
void
-smg_free_screen(v, cookie)
- void *v;
- void *cookie;
+smg_free_screen(void *v, void *cookie)
{
}
int
-smg_show_screen(v, cookie, waitok, cb, cbarg)
- void *v;
- void *cookie;
- int waitok;
- void (*cb) __P((void *, int, int));
- void *cbarg;
+smg_show_screen(void *v, void *cookie, int waitok,
+ void (*cb)(void *, int, int), void *cbarg)
{
struct smg_screen *ss = cookie;
int row, col, line;
@@ -473,24 +564,25 @@ smg_show_screen(v, cookie, waitok, cb, cbarg)
}
cons_decl(smg);
-
-#define WSCONSOLEMAJOR 68
+cdev_decl(wsdisplay);
void
smgcninit(cndev)
struct consdev *cndev;
{
- extern void lkccninit __P((struct consdev *));
- extern int lkccngetc __P((dev_t));
+ extern void lkccninit(struct consdev *);
+ extern int lkccngetc(dev_t);
+ extern int dz_vsbus_lk201_cnattach __P((int));
/* Clear screen */
memset(sm_addr, 0, 128*864);
curscr = &smg_conscreen;
wsdisplay_cnattach(&smg_stdscreen, &smg_conscreen, 0, 0, 0);
cn_tab->cn_pri = CN_INTERNAL;
-#if 0
- lkccninit(cndev);
- wsdisplay_set_cons_kbd(lkccngetc, nullcnpollc);
+ qf = qvss8x15.data;
+
+#if NDZKBD > 0
+ dzkbd_cnattach(0); /* Connect keyboard and screen together */
#endif
}
@@ -516,7 +608,7 @@ smgcnprobe(cndev)
virtual_avail += SMSIZE;
ioaccess((vaddr_t)sm_addr, SMADDR, (SMSIZE/VAX_NBPG));
cndev->cn_pri = CN_INTERNAL;
- cndev->cn_dev = makedev(WSCONSOLEMAJOR, 0);
+ cndev->cn_dev = makedev(getmajor(wsdisplayopen), 0);
break;
default: