source: rtems/c/src/lib/libbsp/sh/shsim/trap34/console-io.c @ e0ddaa7e

4.104.114.84.95
Last change on this file since e0ddaa7e was e0ddaa7e, checked in by Joel Sherrill <joel.sherrill@…>, on 01/29/01 at 15:33:34

2001-01-26 Ralf Corsepius <corsepiu@…>

  • gdbsci/, scitab/, trap34/: Add directories.
  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  This file contains the hardware specific portions of the TTY driver
3 *  for the simulators stdin/out.
4 *
5 *  Logic based on newlib-1.8.2/newlib/libc/sys/sh/syscalls.c
6 *
7 *  COPYRIGHT (c) 1989-2000.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17#include <bsp.h>
18#include <rtems/libio.h>
19#include <stdlib.h>
20#include <assert.h>
21
22
23#define SYS_exit        1
24#define SYS_read        3
25#define SYS_write       4
26
27int errno ;
28
29extern int __trap34(int, int, void*, int );
30
31/*
32 *  console_initialize_hardware
33 *
34 *  This routine initializes the console hardware.
35 *
36 */
37
38void console_initialize_hardware(void)
39{
40  return;
41}
42
43/*
44 *  console_outbyte_polled
45 *
46 *  This routine transmits a character using polling.
47 */
48
49void console_outbyte_polled(
50  int  port,
51  char ch
52)
53{
54  __trap34 (SYS_write, 1, &ch, 1);
55  return;
56}
57
58/*
59 *  console_inbyte_nonblocking
60 *
61 *  This routine polls for a character.
62 */
63
64int console_inbyte_nonblocking(
65  int port
66)
67{
68  unsigned char c;
69
70  return __trap34 (SYS_read, 0, &c, 1);
71}
72
73/* XXX wrong place for this */
74_sys_exit (n)
75{
76  return __trap34 (SYS_exit, n, 0, 0);
77}
78
Note: See TracBrowser for help on using the repository browser.