From 05daa72b3cf5ff62b724b2071a51b64a2cad9860 Mon Sep 17 00:00:00 2001 From: pk Date: Thu, 13 Jul 1995 12:02:19 +0000 Subject: [PATCH] Move SUN4 console echo hack cnget() (from Chuck Cranor). --- sys/arch/sparc/dev/cons.c | 21 ++++++++++++++++++++- sys/arch/sparc/sparc/autoconf.c | 11 +---------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/sys/arch/sparc/dev/cons.c b/sys/arch/sparc/dev/cons.c index 45b65b31c4b8..d4022acb670d 100644 --- a/sys/arch/sparc/dev/cons.c +++ b/sys/arch/sparc/dev/cons.c @@ -1,4 +1,4 @@ -/* $NetBSD: cons.c,v 1.14 1995/06/01 14:36:17 pk Exp $ */ +/* $NetBSD: cons.c,v 1.15 1995/07/13 12:02:19 pk Exp $ */ /* * Copyright (c) 1992, 1993 @@ -58,6 +58,9 @@ #include #include +#ifdef SUN4 +#include +#endif #include "zs.h" @@ -474,8 +477,24 @@ cngetc() } c = c0; } else { +#ifdef SUN4 + /* SUN4 PROM: must turn off echo to avoid double char echo */ + extern struct om_vector *oldpvec; + int saveecho; +#endif + s = splhigh(); +#ifdef SUN4 + if (cputyp == CPU_SUN4) { + saveecho = *(oldpvec->echo); + *(oldpvec->echo) = 0; + } +#endif c = (*promvec->pv_getchar)(); +#ifdef SUN4 + if (cputyp == CPU_SUN4) + *(oldpvec->echo) = saveecho; +#endif splx(s); } if (c == '\r') diff --git a/sys/arch/sparc/sparc/autoconf.c b/sys/arch/sparc/sparc/autoconf.c index 425f894ee723..b8ffed579ff8 100644 --- a/sys/arch/sparc/sparc/autoconf.c +++ b/sys/arch/sparc/sparc/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.29 1995/06/26 22:59:54 pk Exp $ */ +/* $NetBSD: autoconf.c,v 1.30 1995/07/13 12:03:08 pk Exp $ */ /* * Copyright (c) 1992, 1993 @@ -1359,12 +1359,6 @@ getstr(cp, size) register char *lp; register int c; register int len; - int saveecho; - -#if defined(SUN4) - saveecho = *(oldpvec->echo); - *(oldpvec->echo) = 0; -#endif lp = cp; len = 0; @@ -1375,9 +1369,6 @@ getstr(cp, size) case '\r': printf("\n"); *lp++ = '\0'; -#if defined(SUN4) - *(oldpvec->echo) = saveecho; -#endif return (len); case '\b': case '\177':