source: rtems/c/src/lib/libbsp/moxie/moxiesim/console/console-io.c @ 6279149

4.115
Last change on this file since 6279149 was 6279149, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 8, 2014 at 9:04:56 PM

Add console-polled.h and update all BSPs that should use it.

The file console-polled.h provides the prototypes for the three
required methods when implementing a single port polled console
driver. This paradigm is common on simulators and simple hardware.

+ Updated the BSPs Makefile.am to make console-polled.h available.
+ Regenerated the BSPs preinstall.sm.
+ Updated console support files to include <bsp/console-polled.h>.
+ Updated console support files to make printk() support method static.

  • 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 Moxie GDB simulator.
4 */
5
6/*
7 *  COPYRIGHT (c) 2011.
8 *  Anthony Green.
9 *
10 *  COPYRIGHT (c) 1989-2008.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 *
17 */
18
19#include <bsp.h>
20#include <bsp/console-polled.h>
21#include <rtems/libio.h>
22#include <stdlib.h>
23#include <assert.h>
24
25/*
26 *  console_initialize_hardware
27 *
28 *  This routine initializes the console hardware.
29 *
30 */
31
32void console_initialize_hardware(void)
33{
34  return;
35}
36
37/*
38 *  console_outbyte_polled
39 *
40 *  This routine transmits a character using polling.
41 */
42ssize_t _sys_write(int fd, const void *buf, size_t count);
43void console_outbyte_polled(
44  int  port,
45  char ch
46)
47{
48  _sys_write( 1, &ch, 1 );
49}
50
51/*
52 *  console_inbyte_nonblocking
53 *
54 *  This routine polls for a character.
55 */
56
57int console_inbyte_nonblocking(
58  int port
59)
60{
61  return -1;
62}
63
64#include <rtems/bspIo.h>
65
66static void moxiesim_output_char(char c) { console_outbyte_polled( 0, c ); }
67
68BSP_output_char_function_type           BSP_output_char = moxiesim_output_char;
69BSP_polling_getchar_function_type       BSP_poll_char = NULL;
Note: See TracBrowser for help on using the repository browser.