source: rtems/c/src/lib/libbsp/powerpc/qemuppc/console/console-io.c @ ac7af4a

4.104.115
Last change on this file since ac7af4a was ac7af4a, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/30/09 at 04:37:44

Whitespace removal.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  This file contains the hardware specific portions of the TTY driver
3 *  for the serial ports on the erc32.
4 *
5 *  COPYRIGHT (c) 1989-2008.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#include <bsp.h>
16#include <rtems/libio.h>
17#include <stdlib.h>
18#include <assert.h>
19
20static void
21__outb(int port, unsigned char v)
22{
23  *((volatile unsigned char *)(0x80000000 + port)) = v;
24}
25
26static unsigned char
27__inb(int port)
28{
29  return *((volatile unsigned char *)(0x80000000 + port));
30}
31
32/*
33 *  console_initialize_hardware
34 *
35 *  This routine initializes the console hardware.
36 *
37 */
38void console_initialize_hardware(void)
39{
40  return;
41}
42
43/*
44 *  console_outbyte_polled
45 *
46 *  This routine transmits a character using polling.
47 */
48void console_outbyte_polled(
49  int  port,
50  char ch
51)
52{
53  __outb(0x3f8 + 0x00, ch);
54}
55
56/*
57 *  console_inbyte_nonblocking
58 *
59 *  This routine polls for a character.
60 */
61int console_inbyte_nonblocking(
62  int port
63)
64{
65
66  if ( __inb(0x3f8 + 0x05) & 0x01 )
67    return __inb(0x3f8 + 0x00);
68  return -1;
69}
70
71#include <rtems/bspIo.h>
72
73void simBSP_output_char(char c) { console_outbyte_polled( 0, c ); }
74
75BSP_output_char_function_type           BSP_output_char = simBSP_output_char;
76BSP_polling_getchar_function_type       BSP_poll_char = NULL;
Note: See TracBrowser for help on using the repository browser.