source: rtems/bsps/powerpc/qemuppc/console/console-io.c @ d7d66d7

5
Last change on this file since d7d66d7 was d7d66d7, checked in by Sebastian Huber <sebastian.huber@…>, on 04/19/18 at 04:28:01

bsps: Move console drivers to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • 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 qemuppc.
4 */
5
6/*
7 *  COPYRIGHT (c) 1989-2008.
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 <bsp/console-polled.h>
17#include <rtems/libio.h>
18#include <stdlib.h>
19#include <assert.h>
20
21static void
22__outb(int port, unsigned char v)
23{
24  *((volatile unsigned char *)(0x80000000 + port)) = v;
25}
26
27static unsigned char
28__inb(int port)
29{
30  return *((volatile unsigned char *)(0x80000000 + port));
31}
32
33/*
34 *  console_initialize_hardware
35 *
36 *  This routine initializes the console hardware.
37 *
38 */
39void console_initialize_hardware(void)
40{
41  return;
42}
43
44/*
45 *  console_outbyte_polled
46 *
47 *  This routine transmits a character using polling.
48 */
49void console_outbyte_polled(
50  int  port,
51  char ch
52)
53{
54  __outb(0x3f8 + 0x00, ch);
55}
56
57/*
58 *  console_inbyte_nonblocking
59 *
60 *  This routine polls for a character.
61 */
62int console_inbyte_nonblocking(
63  int port
64)
65{
66
67  if ( __inb(0x3f8 + 0x05) & 0x01 )
68    return __inb(0x3f8 + 0x00);
69  return -1;
70}
71
72#include <rtems/bspIo.h>
73
74static void simBSP_output_char(char c) { console_outbyte_polled( 0, c ); }
75
76BSP_output_char_function_type           BSP_output_char = simBSP_output_char;
77BSP_polling_getchar_function_type       BSP_poll_char = NULL;
Note: See TracBrowser for help on using the repository browser.