Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/newsmips/stand/boot Add getchar().



details:   https://anonhg.NetBSD.org/src/rev/3619e1101948
branches:  trunk
changeset: 525574:3619e1101948
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Apr 13 07:53:53 2002 +0000

description:
Add getchar().

diffstat:

 sys/arch/newsmips/stand/boot/boot.c |  18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diffs (32 lines):

diff -r 2db714058712 -r 3619e1101948 sys/arch/newsmips/stand/boot/boot.c
--- a/sys/arch/newsmips/stand/boot/boot.c       Sat Apr 13 07:34:41 2002 +0000
+++ b/sys/arch/newsmips/stand/boot/boot.c       Sat Apr 13 07:53:53 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.8 2002/04/13 07:34:17 tsutsui Exp $ */
+/*     $NetBSD: boot.c,v 1.9 2002/04/13 07:53:53 tsutsui Exp $ */
 
 /*-
  * Copyright (C) 1999 Tsubai Masanari.  All rights reserved.
@@ -207,6 +207,22 @@
                rom_write(1, &c, 1);
 }
 
+int
+getchar()
+{
+       unsigned char c = '\0';
+       int i;
+
+       for (;;) {
+               i = apbus ? apcall_read(1, &c, 1) : rom_read(1, &c, 1);
+               if (i == 1)
+                       break;
+               if (i != -2 && i != 0)
+                       return -1;
+       }
+       return c;
+}
+
 void
 _rtt()
 {



Home | Main Index | Thread Index | Old Index