Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/alpha/stand/common implement NO_GETCHAR, to remove ...
details: https://anonhg.NetBSD.org/src/rev/a737ef614230
branches: trunk
changeset: 467924:a737ef614230
user: cgd <cgd%NetBSD.org@localhost>
date: Wed Mar 31 03:34:21 1999 +0000
description:
implement NO_GETCHAR, to remove getchar(), and NO_PUTCHAR_HALT to remove
the check in putchar() for character input (specifically control-c, which
causes a halt).
diffstat:
sys/arch/alpha/stand/common/prom.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diffs (66 lines):
diff -r ad2d6f1089b5 -r a737ef614230 sys/arch/alpha/stand/common/prom.c
--- a/sys/arch/alpha/stand/common/prom.c Wed Mar 31 03:22:57 1999 +0000
+++ b/sys/arch/alpha/stand/common/prom.c Wed Mar 31 03:34:21 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prom.c,v 1.7 1999/03/31 03:22:57 cgd Exp $ */
+/* $NetBSD: prom.c,v 1.8 1999/03/31 03:34:21 cgd Exp $ */
/*
* Mach Operating System
@@ -35,7 +35,9 @@
int console;
+#if !defined(NO_GETCHAR) || !defined(NO_PUTCHAR_HALT)
static int test_getchar(int *);
+#endif
static void putonechar(int c);
void
@@ -57,6 +59,7 @@
console = buf[0] - '0';
}
+#if !defined(NO_GETCHAR) || !defined(NO_PUTCHAR_HALT)
static int
test_getchar(xc)
int *xc;
@@ -67,7 +70,9 @@
*xc = ret.u.retval;
return ret.u.status == 0 || ret.u.status == 1;
}
+#endif
+#if !defined(NO_GETCHAR)
int
getchar()
{
@@ -81,6 +86,7 @@
}
}
}
+#endif
static void
putonechar(c)
@@ -98,16 +104,20 @@
putchar(c)
int c;
{
+#if !defined(NO_PUTCHAR_HALT)
int typed_c;
+#endif
if (c == '\r' || c == '\n') {
putonechar('\r');
c = '\n';
}
putonechar(c);
+#if !defined(NO_PUTCHAR_HALT)
if (test_getchar(&typed_c))
if (typed_c == 3)
halt();
+#endif
}
int
Home |
Main Index |
Thread Index |
Old Index