source: rtems/c/src/lib/libbsp/sh/shsim/console/console-io.c @ 8536b67

4.115
Last change on this file since 8536b67 was a531683, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 18, 2014 at 3:52:21 PM

shsim: Add printk() support and move all code to console subdirectory

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