Workaround for port-pmax/4438 (pmax kernel glass-tty console code is broken)
until a proper fix is available: Perpetuate the 4.4bsd design even further. Change keyboard-driver open routines to check for an active raster console. If active, set the keyboard struct tty's t_winsize from the rcons t_winsize on first open. See pr 4438 for remaining problems and discussion of a complete fix.
This commit is contained in:
parent
4261733b62
commit
0f41aef4b9
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dc.c,v 1.33 1997/07/07 03:54:42 jonathan Exp $ */
|
||||
/* $NetBSD: dc.c,v 1.34 1997/11/08 21:55:05 jonathan Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -38,6 +38,9 @@
|
||||
* @(#)dc.c 8.5 (Berkeley) 6/2/95
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
__KERNEL_RCSID(0, "$NetBSD: dc.c,v 1.34 1997/11/08 21:55:05 jonathan Exp $");
|
||||
|
||||
/*
|
||||
* devDC7085.c --
|
||||
*
|
||||
@ -95,8 +98,8 @@
|
||||
* #include <pmax/dev/pdma.h>
|
||||
*/
|
||||
#include "dcvar.h"
|
||||
|
||||
#include "tc.h"
|
||||
#include "rasterconsole.h"
|
||||
|
||||
#include <pmax/dev/lk201var.h> /* XXX KbdReset band friends */
|
||||
|
||||
@ -382,6 +385,7 @@ dcopen(dev, flag, mode, p)
|
||||
register struct dc_softc *sc;
|
||||
register int unit, line;
|
||||
int s, error = 0;
|
||||
int firstopen = 0;
|
||||
|
||||
unit = DCUNIT(dev);
|
||||
line = DCLINE(dev);
|
||||
@ -403,6 +407,7 @@ dcopen(dev, flag, mode, p)
|
||||
if ((tp->t_state & TS_ISOPEN) == 0) {
|
||||
tp->t_state |= TS_WOPEN;
|
||||
ttychars(tp);
|
||||
firstopen = 1;
|
||||
#ifndef PORTSELECTOR
|
||||
if (tp->t_ispeed == 0) {
|
||||
#endif
|
||||
@ -439,7 +444,19 @@ dcopen(dev, flag, mode, p)
|
||||
splx(s);
|
||||
if (error)
|
||||
return (error);
|
||||
return ((*linesw[tp->t_line].l_open)(dev, tp));
|
||||
error = (*linesw[tp->t_line].l_open)(dev, tp);
|
||||
|
||||
#if NRASTERCONSOLE > 0
|
||||
/*
|
||||
* Handle console cases specially.
|
||||
*/
|
||||
if (firstopen && raster_console() &&
|
||||
unit == 0 && tp == sc->dc_tty[DCKBD_PORT]) {
|
||||
extern struct tty *fbconstty;
|
||||
tp->t_winsize = fbconstty->t_winsize;
|
||||
}
|
||||
#endif /* NRASTERCONSOLE */
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dtop.c,v 1.26 1997/07/21 05:39:15 jonathan Exp $ */
|
||||
/* $NetBSD: dtop.c,v 1.27 1997/11/08 21:55:06 jonathan Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -93,6 +93,11 @@ SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
__KERNEL_RCSID(0, "$NetBSD: dtop.c,v 1.27 1997/11/08 21:55:06 jonathan Exp $");
|
||||
|
||||
#include "rasterconsole.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/ioctl.h>
|
||||
@ -280,6 +285,7 @@ dtopopen(dev, flag, mode, p)
|
||||
register struct tty *tp;
|
||||
register int unit;
|
||||
int s, error = 0;
|
||||
int firstopen = 0;
|
||||
|
||||
unit = minor(dev);
|
||||
if (unit >= dtop_cd.cd_ndevs)
|
||||
@ -294,6 +300,7 @@ dtopopen(dev, flag, mode, p)
|
||||
tp->t_dev = dev;
|
||||
if ((tp->t_state & TS_ISOPEN) == 0) {
|
||||
tp->t_state |= TS_WOPEN;
|
||||
firstopen = 1;
|
||||
ttychars(tp);
|
||||
if (tp->t_ispeed == 0) {
|
||||
tp->t_iflag = TTYDEF_IFLAG;
|
||||
@ -318,6 +325,15 @@ dtopopen(dev, flag, mode, p)
|
||||
if (error)
|
||||
return (error);
|
||||
error = (*linesw[tp->t_line].l_open)(dev, tp);
|
||||
|
||||
#if NRASTERRCONSOLE > 0
|
||||
/* handle raster console specially */
|
||||
if (tp == DTOP_TTY(0) && firstopen) {
|
||||
extern struct tty *fbconstty;
|
||||
tp->t_winsize = fbconstty->t_winsize;
|
||||
}
|
||||
#endif /* HAVE_RCONS */
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: scc.c,v 1.28 1997/07/21 05:39:41 jonathan Exp $ */
|
||||
/* $NetBSD: scc.c,v 1.29 1997/11/08 21:55:08 jonathan Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991,1990,1989,1994,1995,1996 Carnegie Mellon University
|
||||
@ -65,6 +65,8 @@
|
||||
* @(#)scc.c 8.2 (Berkeley) 11/30/93
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
__KERNEL_RCSID(0, "$NetBSD: scc.c,v 1.29 1997/11/08 21:55:08 jonathan Exp $");
|
||||
|
||||
/*
|
||||
* Intel 82530 dual usart chip driver. Supports the serial port(s) on the
|
||||
@ -754,6 +756,7 @@ sccopen(dev, flag, mode, p)
|
||||
register struct tty *tp;
|
||||
register int unit, line;
|
||||
int s, error = 0;
|
||||
int firstopen = 0;
|
||||
|
||||
unit = SCCUNIT(dev);
|
||||
if (unit >= scc_cd.cd_ndevs)
|
||||
@ -775,6 +778,7 @@ sccopen(dev, flag, mode, p)
|
||||
tp->t_dev = dev;
|
||||
if ((tp->t_state & TS_ISOPEN) == 0) {
|
||||
tp->t_state |= TS_WOPEN;
|
||||
firstopen = 1;
|
||||
ttychars(tp);
|
||||
#ifndef PORTSELECTOR
|
||||
if (tp->t_ispeed == 0) {
|
||||
@ -791,6 +795,7 @@ sccopen(dev, flag, mode, p)
|
||||
#endif
|
||||
(void) sccparam(tp, &tp->t_termios);
|
||||
ttsetwater(tp);
|
||||
|
||||
} else if ((tp->t_state & TS_XCLUDE) && curproc->p_ucred->cr_uid != 0)
|
||||
return (EBUSY);
|
||||
(void) sccmctl(dev, DML_DTR, DMSET);
|
||||
@ -805,7 +810,17 @@ sccopen(dev, flag, mode, p)
|
||||
splx(s);
|
||||
if (error)
|
||||
return (error);
|
||||
return ((*linesw[tp->t_line].l_open)(dev, tp));
|
||||
error = (*linesw[tp->t_line].l_open)(dev, tp);
|
||||
|
||||
#ifdef HAVE_RCONS
|
||||
/* handle raster console specially */
|
||||
if (tp == scctty(makedev(SCCDEV,SCCKBD_PORT)) &&
|
||||
raster_console() && firstopen) {
|
||||
extern struct tty *fbconstty;
|
||||
tp->t_winsize = fbconstty->t_winsize;
|
||||
}
|
||||
#endif /* HAVE_RCONS */
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
@ -1522,6 +1537,9 @@ sccGetc(dev)
|
||||
if (value & ZSRR0_RX_READY) {
|
||||
SCC_READ_REG(regs, line, SCC_RR1, value);
|
||||
SCC_READ_DATA(regs, line, c);
|
||||
#ifdef pmax /* Alpha handles the 1.6 msec settle time in h/w */
|
||||
DELAY(2);
|
||||
#endif
|
||||
if (value & (ZSRR1_PE | ZSRR1_DO | ZSRR1_FE)) {
|
||||
SCC_WRITE_REG(regs, line, SCC_WR0,
|
||||
ZSWR0_RESET_ERRORS);
|
||||
|
Loading…
Reference in New Issue
Block a user