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

4.11
Last change on this file since 931ed32b was 931ed32b, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 1, 2011 at 10:46:44 PM

2011-02-01 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, preinstall.am, trap34/console-io.c: Install syscall.h as bsp/syscall.h to avoid confusing autoconf.
  • Property mode set to 100644
File size: 1.2 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-2011.
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.rtems.com/license/LICENSE.
13 *
14 *  $Id$
15 */
16
17#include <bsp.h>
18#include <rtems/libio.h>
19#include <stdlib.h>
20#include <assert.h>
21
22#include <bsp/syscall.h>
23
24int errno;
25
26extern int __trap34(int, int, void*, int );
27
28/*
29 *  console_initialize_hardware
30 *
31 *  This routine initializes the console hardware.
32 *
33 */
34
35void console_initialize_hardware(void)
36{
37  return;
38}
39
40/*
41 *  console_outbyte_polled
42 *
43 *  This routine transmits a character using polling.
44 */
45
46void console_outbyte_polled(
47  int  port,
48  char ch
49)
50{
51  __trap34 (SYS_write, 1, &ch, 1);
52  return;
53}
54
55/*
56 *  console_inbyte_nonblocking
57 *
58 *  This routine polls for a character.
59 */
60
61int console_inbyte_nonblocking(
62  int port
63)
64{
65  unsigned char c;
66
67  return __trap34 (SYS_read, 0, &c, 1);
68}
69
70/* XXX wrong place for this */
71int _sys_exit (int n)
72{
73  return __trap34 (SYS_exit, n, 0, 0);
74}
Note: See TracBrowser for help on using the repository browser.