From b28c99b245e8485a8c799041562469665cc86a61 Mon Sep 17 00:00:00 2001 From: ragge Date: Sat, 23 May 1998 12:49:30 +0000 Subject: [PATCH] Fixed bug with lost characters in DDB output. --- sys/arch/vax/uba/dz.c | 5 ++--- sys/arch/vax/vsa/dz_vsbus.c | 27 +++++++++++++++++++-------- sys/dev/dec/qbus/dz.c | 5 ++--- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/sys/arch/vax/uba/dz.c b/sys/arch/vax/uba/dz.c index e88dfe5fc9c2..a227f83d862f 100644 --- a/sys/arch/vax/uba/dz.c +++ b/sys/arch/vax/uba/dz.c @@ -1,4 +1,4 @@ -/* $NetBSD: dz.c,v 1.8 1998/05/21 13:02:21 ragge Exp $ */ +/* $NetBSD: dz.c,v 1.9 1998/05/23 12:49:30 ragge Exp $ */ /* * Copyright (c) 1996 Ken C. Wellsch. All rights reserved. * Copyright (c) 1992, 1993 @@ -182,8 +182,7 @@ dzrint(cntlr) cc |= TTY_PE; #if DDB && (VAX410 || VAX43) -#define DZMAJOR 1 /* XXX */ - if (makedev(DZMAJOR, line + NDZLINE*cntlr) == cn_tab->cn_dev) { + if (tp->t_dev == cn_tab->cn_dev) { int j = kdbrint(cc); if (j == 1) /* Escape received, just return */ diff --git a/sys/arch/vax/vsa/dz_vsbus.c b/sys/arch/vax/vsa/dz_vsbus.c index bffdff61f186..02d2adaf6284 100644 --- a/sys/arch/vax/vsa/dz_vsbus.c +++ b/sys/arch/vax/vsa/dz_vsbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: dz_vsbus.c,v 1.2 1998/05/21 13:02:21 ragge Exp $ */ +/* $NetBSD: dz_vsbus.c,v 1.3 1998/05/23 12:49:31 ragge Exp $ */ /* * Copyright (c) 1998 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -138,6 +138,10 @@ dzcngetc(dev) dev_t dev; { int c; + u_char mask; + + mask = vs_cpu->vc_intmsk; /* save old state */ + vs_cpu->vc_intmsk = 0; /* disable all interrupts */ do { while ((dz->csr & 0x80) == 0) @@ -147,6 +151,10 @@ dzcngetc(dev) if (c == 13) c = 10; + + vs_cpu->vc_intclr = 0x80; /* clear te interrupt request */ + vs_cpu->vc_intmsk = mask; /* restore interrupt mask */ + return (c); } @@ -195,14 +203,24 @@ dzcnputc(dev,ch) int ch; { int timeout = 1<<15; /* don't hang the machine! */ + u_short tcr; + u_char mask; if (mfpr(PR_MAPEN) == 0) return; + mask = vs_cpu->vc_intmsk; /* save old state */ + vs_cpu->vc_intmsk = 0; /* disable all interrupts */ + tcr = dz->tcr; /* remember which lines to scan */ + dz->tcr = 8; /* XXX */ + while ((dz->csr & 0x8000) == 0) /* Wait until ready */ if (--timeout < 0) break; dz->tdr = ch; /* Put the character */ + + dz->tcr = tcr; + vs_cpu->vc_intmsk = mask; /* restore interrupt mask */ } void @@ -210,11 +228,4 @@ dzcnpollc(dev, pollflag) dev_t dev; int pollflag; { - if (pollflag) { - vsbus_intr_disable(INR_SR); - vsbus_intr_disable(INR_ST); - } else { - vsbus_intr_enable(INR_SR); - vsbus_intr_enable(INR_ST); - } } diff --git a/sys/dev/dec/qbus/dz.c b/sys/dev/dec/qbus/dz.c index e88dfe5fc9c2..a227f83d862f 100644 --- a/sys/dev/dec/qbus/dz.c +++ b/sys/dev/dec/qbus/dz.c @@ -1,4 +1,4 @@ -/* $NetBSD: dz.c,v 1.8 1998/05/21 13:02:21 ragge Exp $ */ +/* $NetBSD: dz.c,v 1.9 1998/05/23 12:49:30 ragge Exp $ */ /* * Copyright (c) 1996 Ken C. Wellsch. All rights reserved. * Copyright (c) 1992, 1993 @@ -182,8 +182,7 @@ dzrint(cntlr) cc |= TTY_PE; #if DDB && (VAX410 || VAX43) -#define DZMAJOR 1 /* XXX */ - if (makedev(DZMAJOR, line + NDZLINE*cntlr) == cn_tab->cn_dev) { + if (tp->t_dev == cn_tab->cn_dev) { int j = kdbrint(cc); if (j == 1) /* Escape received, just return */