OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [lib/] [libbsp/] [sh/] [shsim/] [trap34/] [console-io.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
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
 *  console-io.c,v 1.1 2001/01/29 15:33:34 joel Exp
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
 
27
int errno ;
28
 
29
extern int __trap34(int, int, void*, int );
30
 
31
/*
32
 *  console_initialize_hardware
33
 *
34
 *  This routine initializes the console hardware.
35
 *
36
 */
37
 
38
void 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
 
49
void 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
 
64
int 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
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.