chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / ports / sysdeps / standalone / i960 / nindy960 / console.c
1 /* Copyright (C) 1994, 1997 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
3    Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
4      On-Line Applications Research Corporation.
5
6    The GNU C Library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10
11    The GNU C Library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public
17    License along with the GNU C Library; if not, write to the Free
18    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19    02111-1307 USA.  */
20
21 #include <standalone.h>
22 #include "i960ca.h"
23
24 /* Console IO routines for a NINDY960 board. */
25
26 /*
27  *  NINDY_IO( ... )
28  *
29  *  Interface to NINDY.
30  */
31
32 #define NINDY_INPUT   0
33 #define NINDY_OUTPUT  1
34
35 void ___NINDY_IO_WRAPPER( void )  /* never called */
36 {
37    asm volatile ( "       .text" );
38    asm volatile ( "       .align 4" );
39    asm volatile ( "       .globl _NINDY_IO" );
40    asm volatile ( "_NINDY_IO:" );
41    asm volatile ( "        calls   0       /* call console routines */" );
42    asm volatile ( "        ret" );
43 }
44
45 /***** !!!! HOW DO I EXFUN NINDY_IO? !!!! *****/
46
47 /* _Console_Putc
48
49 This routine transmits a character using NINDY.  */
50
51 int
52 _Console_Putc (ch)
53      char ch;
54 {
55   NINDY_IO( NINDY_OUTPUT, ch );
56   return( 0 );
57 }
58
59 /* _Console_Getc
60
61 This routine reads a character from NINDY and returns it. */
62
63 int
64 _Console_Getc (poll)
65      int poll;
66 {
67   char ch;
68
69   if ( poll ) {
70     /* I don't know how to poll with NINDY */
71     return -1;
72   } else {
73     NINDY_IO( NINDY_INPUT, &ch );
74     return ch;
75   }
76 }