source: rtems/c/src/lib/libbsp/i386/pc386/console/printk_support.c @ 441b90e

4.115
Last change on this file since 441b90e was 441b90e, checked in by Jennifer Averett <Jennifer.Averett@…>, on Feb 1, 2012 at 8:32:28 PM

Correct run-time selection of console port.

This was broken by conversion of console driver to libchip style.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  This file contains a stub for the required printk support.
3 *  It is NOT functional!!!
4 *
5 *  This driver uses the termios pseudo driver.
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2007.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 *
16 *  $Id$
17 */
18
19#include <rtems.h>
20#include <rtems/bspIo.h>
21#include <rtems/keyboard.h>
22#include <bsp.h>
23#include <libchip/serial.h>
24#include <libchip/ns16550.h>
25#include "../../../shared/console_private.h"
26
27rtems_device_minor_number         BSPPrintkPort = 0;
28
29int ns16550_inbyte_nonblocking_polled(
30  int minor
31);
32
33void BSP_outch(char ch);
34int BSP_inch(void);
35
36void BSP_outch(char ch)
37{
38  if ( BSPPrintkPort == BSP_CONSOLE_VGA ) {
39    _IBMPC_outch( ch );
40  } else {
41    console_tbl *cptr;
42
43    cptr = &Console_Configuration_Ports[BSPPrintkPort];
44    cptr->pDeviceFns->deviceWritePolled( BSPPrintkPort, ch );
45  }
46}
47
48int BSP_inch(void) 
49{
50  int           result;
51
52  if ( BSPPrintkPort == BSP_CONSOLE_VGA ) {
53    result = BSP_wait_polled_input();
54  } else {
55    do {
56      result = ns16550_inbyte_nonblocking_polled( BSPPrintkPort );
57    } while (result == -1);
58  }
59  return result;
60}
61
62BSP_output_char_function_type     BSP_output_char = BSP_outch;
63BSP_polling_getchar_function_type BSP_poll_char = BSP_inch;
64
Note: See TracBrowser for help on using the repository browser.