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

4.104.114.84.95
Last change on this file since f05b2ac was f05b2ac, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/21/04 at 16:01:48

Remove duplicate white lines.

  • 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.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#define SYS_exit        1
23#define SYS_read        3
24#define SYS_write       4
25
26int errno ;
27
28extern int __trap34(int, int, void*, int );
29
30/*
31 *  console_initialize_hardware
32 *
33 *  This routine initializes the console hardware.
34 *
35 */
36
37void console_initialize_hardware(void)
38{
39  return;
40}
41
42/*
43 *  console_outbyte_polled
44 *
45 *  This routine transmits a character using polling.
46 */
47
48void console_outbyte_polled(
49  int  port,
50  char ch
51)
52{
53  __trap34 (SYS_write, 1, &ch, 1);
54  return;
55}
56
57/*
58 *  console_inbyte_nonblocking
59 *
60 *  This routine polls for a character.
61 */
62
63int console_inbyte_nonblocking(
64  int port
65)
66{
67  unsigned char c;
68
69  return __trap34 (SYS_read, 0, &c, 1);
70}
71
72/* XXX wrong place for this */
73_sys_exit (n)
74{
75  return __trap34 (SYS_exit, n, 0, 0);
76}
Note: See TracBrowser for help on using the repository browser.