2.3.3-74
[glibc.git] / sysdeps / standalone / i960 / nindy960 / console.c
blobb062d9215bcea263c9a98c6e7d714afb56a7d6a5
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.
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.
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.
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. */
21 #include <standalone.h>
22 #include "i960ca.h"
24 /* Console IO routines for a NINDY960 board. */
27 * NINDY_IO( ... )
29 * Interface to NINDY.
32 #define NINDY_INPUT 0
33 #define NINDY_OUTPUT 1
35 void ___NINDY_IO_WRAPPER( void ) /* never called */
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" );
45 /***** !!!! HOW DO I EXFUN NINDY_IO? !!!! *****/
47 /* _Console_Putc
49 This routine transmits a character using NINDY. */
51 int
52 _Console_Putc (ch)
53 char ch;
55 NINDY_IO( NINDY_OUTPUT, ch );
56 return( 0 );
59 /* _Console_Getc
61 This routine reads a character from NINDY and returns it. */
63 int
64 _Console_Getc (poll)
65 int poll;
67 char ch;
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;