Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/vax/vax KA88 console support.
details: https://anonhg.NetBSD.org/src/rev/2ca514b2d51b
branches: trunk
changeset: 495331:2ca514b2d51b
user: ragge <ragge%NetBSD.org@localhost>
date: Wed Jul 26 11:50:16 2000 +0000
description:
KA88 console support.
diffstat:
sys/arch/vax/vax/conf.c | 4 +-
sys/arch/vax/vax/gencons.c | 207 +++++++++++++++++++++-----------------------
2 files changed, 101 insertions(+), 110 deletions(-)
diffs (truncated from 371 to 300 lines):
diff -r ebce3aa2a4a4 -r 2ca514b2d51b sys/arch/vax/vax/conf.c
--- a/sys/arch/vax/vax/conf.c Wed Jul 26 11:48:50 2000 +0000
+++ b/sys/arch/vax/vax/conf.c Wed Jul 26 11:50:16 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: conf.c,v 1.47 2000/06/12 11:13:15 ragge Exp $ */
+/* $NetBSD: conf.c,v 1.48 2000/07/26 11:50:16 ragge Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -175,7 +175,7 @@
struct consdev constab[]={
#if VAX8600 || VAX8200 || VAX780 || VAX750 || VAX650 || VAX630 || VAX660 || \
- VAX670 || VAX680
+ VAX670 || VAX680 || VAX8800
#define NGEN 1
cons_init(gen), /* Generic console type; mtpr/mfpr */
#else
diff -r ebce3aa2a4a4 -r 2ca514b2d51b sys/arch/vax/vax/gencons.c
--- a/sys/arch/vax/vax/gencons.c Wed Jul 26 11:48:50 2000 +0000
+++ b/sys/arch/vax/vax/gencons.c Wed Jul 26 11:50:16 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gencons.c,v 1.25 2000/07/06 17:36:22 ragge Exp $ */
+/* $NetBSD: gencons.c,v 1.26 2000/07/26 11:50:16 ragge Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@@ -36,6 +36,7 @@
/* All bugs are subject to removal without further notice */
#include "opt_ddb.h"
+#include "opt_cputype.h"
#include <sys/param.h>
#include <sys/proc.h>
@@ -66,28 +67,19 @@
static int pr_rxdb[4] = {PR_RXDB, PR_RXDB1, PR_RXDB2, PR_RXDB3};
cons_decl(gen);
-#ifdef DYNAMIC_DEVSW
-bcdev_decl(gencn);
-#else
cdev_decl(gencn);
-#endif
static int gencnparam __P((struct tty *, struct termios *));
static void gencnstart __P((struct tty *));
-void gencnrint __P((void *));
-void gencntint __P((void *));
int
-gencnopen(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
+gencnopen(dev_t dev, int flag, int mode, struct proc *p)
{
- int unit;
- struct tty *tp;
+ int unit;
+ struct tty *tp;
- unit = minor(dev);
- if (unit >= maxttys)
+ unit = minor(dev);
+ if (unit >= maxttys)
return ENXIO;
if (gencn_tty[unit] == NULL)
@@ -95,108 +87,92 @@
tp = gencn_tty[unit];
- tp->t_oproc = gencnstart;
- tp->t_param = gencnparam;
- tp->t_dev = dev;
- if ((tp->t_state & TS_ISOPEN) == 0) {
- ttychars(tp);
- tp->t_iflag = TTYDEF_IFLAG;
- tp->t_oflag = TTYDEF_OFLAG;
- tp->t_cflag = TTYDEF_CFLAG;
- tp->t_lflag = TTYDEF_LFLAG;
- tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
- gencnparam(tp, &tp->t_termios);
- ttsetwater(tp);
- } else if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0)
- return EBUSY;
- tp->t_state |= TS_CARR_ON;
+ tp->t_oproc = gencnstart;
+ tp->t_param = gencnparam;
+ tp->t_dev = dev;
+ if ((tp->t_state & TS_ISOPEN) == 0) {
+ ttychars(tp);
+ tp->t_iflag = TTYDEF_IFLAG;
+ tp->t_oflag = TTYDEF_OFLAG;
+ tp->t_cflag = TTYDEF_CFLAG;
+ tp->t_lflag = TTYDEF_LFLAG;
+ tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
+ gencnparam(tp, &tp->t_termios);
+ ttsetwater(tp);
+ } else if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0)
+ return EBUSY;
+ tp->t_state |= TS_CARR_ON;
if (unit == 0)
consopened = 1;
mtpr(GC_RIE, pr_rxcs[unit]); /* Turn on interrupts */
mtpr(GC_TIE, pr_txcs[unit]);
- return ((*linesw[tp->t_line].l_open)(dev, tp));
+ return ((*linesw[tp->t_line].l_open)(dev, tp));
}
int
-gencnclose(dev, flag, mode, p)
- dev_t dev;
- int flag, mode;
- struct proc *p;
+gencnclose(dev_t dev, int flag, int mode, struct proc *p)
{
- struct tty *tp = gencn_tty[minor(dev)];
+ struct tty *tp = gencn_tty[minor(dev)];
if (minor(dev) == 0)
consopened = 0;
- (*linesw[tp->t_line].l_close)(tp, flag);
- ttyclose(tp);
- return (0);
+ (*linesw[tp->t_line].l_close)(tp, flag);
+ ttyclose(tp);
+ return (0);
}
struct tty *
-gencntty(dev)
- dev_t dev;
+gencntty(dev_t dev)
{
return gencn_tty[minor(dev)];
}
int
-gencnread(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
+gencnread(dev_t dev, struct uio *uio, int flag)
{
- struct tty *tp = gencn_tty[minor(dev)];
+ struct tty *tp = gencn_tty[minor(dev)];
- return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
+ return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
}
int
-gencnwrite(dev, uio, flag)
- dev_t dev;
- struct uio *uio;
- int flag;
+gencnwrite(dev_t dev, struct uio *uio, int flag)
{
- struct tty *tp = gencn_tty[minor(dev)];
+ struct tty *tp = gencn_tty[minor(dev)];
- return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
+ return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
}
int
-gencnioctl(dev, cmd, data, flag, p)
- dev_t dev;
- u_long cmd;
- caddr_t data;
- int flag;
- struct proc *p;
+gencnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
{
- struct tty *tp = gencn_tty[minor(dev)];
- int error;
+ struct tty *tp = gencn_tty[minor(dev)];
+ int error;
- error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
- if (error >= 0)
- return error;
- error = ttioctl(tp, cmd, data, flag, p);
- if (error >= 0)
+ error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
+ if (error >= 0)
+ return error;
+ error = ttioctl(tp, cmd, data, flag, p);
+ if (error >= 0)
return error;
return ENOTTY;
}
void
-gencnstart(tp)
- struct tty *tp;
+gencnstart(struct tty *tp)
{
- struct clist *cl;
- int s, ch;
+ struct clist *cl;
+ int s, ch;
- s = spltty();
- if (tp->t_state & (TS_BUSY|TS_TTSTOP|TS_TIMEOUT))
- goto out;
- cl = &tp->t_outq;
+ s = spltty();
+ if (tp->t_state & (TS_BUSY|TS_TTSTOP|TS_TIMEOUT))
+ goto out;
+ cl = &tp->t_outq;
if(cl->c_cc){
- tp->t_state |= TS_BUSY;
+ tp->t_state |= TS_BUSY;
ch = getc(cl);
mtpr(ch, pr_txdb[minor(tp->t_dev)]);
} else {
@@ -210,14 +186,15 @@
out: splx(s);
}
-void
-gencnrint(arg)
- void *arg;
+static void
+gencnrint(void *arg)
{
struct tty *tp = *(struct tty **) arg;
int unit = (struct tty **) arg - gencn_tty;
int i;
+printf("gencnrint: %x\n", mfpr(PR_RXDB));
+return;
i = mfpr(pr_rxdb[unit]) & 0377; /* Mask status flags etc... */
#ifdef DDB
@@ -237,15 +214,12 @@
}
void
-gencnstop(tp, flag)
- struct tty *tp;
- int flag;
+gencnstop(struct tty *tp, int flag)
{
}
-void
-gencntint(arg)
- void *arg;
+static void
+gencntint(void *arg)
{
struct tty *tp = *(struct tty **) arg;
@@ -255,20 +229,17 @@
}
int
-gencnparam(tp, t)
- struct tty *tp;
- struct termios *t;
+gencnparam(struct tty *tp, struct termios *t)
{
- /* XXX - These are ignored... */
- tp->t_ispeed = t->c_ispeed;
- tp->t_ospeed = t->c_ospeed;
- tp->t_cflag = t->c_cflag;
+ /* XXX - These are ignored... */
+ tp->t_ispeed = t->c_ispeed;
+ tp->t_ospeed = t->c_ospeed;
+ tp->t_cflag = t->c_cflag;
return 0;
}
void
-gencnprobe(cndev)
- struct consdev *cndev;
+gencnprobe(struct consdev *cndev)
{
if ((vax_cputype < VAX_TYP_UV1) || /* All older has MTPR console */
(vax_boardtype == VAX_BTYP_9RR) ||
@@ -283,8 +254,7 @@
}
void
-gencninit(cndev)
- struct consdev *cndev;
+gencninit(struct consdev *cndev)
{
/* Allocate interrupt vectors */
@@ -302,14 +272,38 @@
scb_vecalloc(SCB_G3R, gencnrint, &gencn_tty[3], SCB_ISTACK, NULL);
scb_vecalloc(SCB_G3T, gencntint, &gencn_tty[3], SCB_ISTACK, NULL);
Home |
Main Index |
Thread Index |
Old Index