5
Last change
on this file since a2dad96 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.3 KB
|
Rev | Line | |
---|
[e177810d] | 1 | /* |
---|
| 2 | * This file contains the hardware specific portions of the TTY driver |
---|
[904e185] | 3 | * for the simulated serial port on the PowerPC simulator. |
---|
[6c0b7b8] | 4 | */ |
---|
| 5 | |
---|
| 6 | /* |
---|
[9b949dd] | 7 | * COPYRIGHT (c) 1989-2004. |
---|
[e177810d] | 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 |
---|
[c499856] | 12 | * http://www.rtems.org/license/LICENSE. |
---|
[e177810d] | 13 | */ |
---|
| 14 | |
---|
| 15 | #include <bsp.h> |
---|
[6279149] | 16 | #include <bsp/console-polled.h> |
---|
[e177810d] | 17 | #include <rtems/libio.h> |
---|
| 18 | #include <stdlib.h> |
---|
| 19 | #include <assert.h> |
---|
| 20 | |
---|
| 21 | /* |
---|
| 22 | * console_initialize_hardware |
---|
| 23 | * |
---|
| 24 | * This routine initializes the console hardware. |
---|
| 25 | * |
---|
| 26 | */ |
---|
| 27 | |
---|
| 28 | void console_initialize_hardware(void) |
---|
| 29 | { |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | /* external prototypes for monitor interface routines */ |
---|
| 33 | |
---|
| 34 | void outbyte( char ); |
---|
| 35 | char inbyte( void ); |
---|
| 36 | |
---|
| 37 | /* |
---|
| 38 | * console_outbyte_polled |
---|
| 39 | * |
---|
| 40 | * This routine transmits a character using polling. |
---|
| 41 | */ |
---|
| 42 | |
---|
| 43 | void console_outbyte_polled( |
---|
| 44 | int port, |
---|
| 45 | char ch |
---|
| 46 | ) |
---|
| 47 | { |
---|
| 48 | outbyte( ch ); |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | /* |
---|
[6128a4a] | 52 | * console_inbyte_nonblocking |
---|
[e177810d] | 53 | * |
---|
| 54 | * This routine polls for a character. |
---|
| 55 | */ |
---|
| 56 | |
---|
| 57 | int console_inbyte_nonblocking( |
---|
| 58 | int port |
---|
| 59 | ) |
---|
| 60 | { |
---|
| 61 | char c; |
---|
| 62 | |
---|
| 63 | c = inbyte(); |
---|
| 64 | if (!c) |
---|
| 65 | return -1; |
---|
| 66 | return c; |
---|
| 67 | } |
---|
| 68 | |
---|
| 69 | /* |
---|
| 70 | * To support printk |
---|
| 71 | */ |
---|
| 72 | |
---|
[4ee84fc] | 73 | #include <rtems/bspIo.h> |
---|
[e177810d] | 74 | |
---|
[6279149] | 75 | static void PSIM_output_char(char c) { console_outbyte_polled( 0, c ); } |
---|
[e177810d] | 76 | |
---|
| 77 | BSP_output_char_function_type BSP_output_char = PSIM_output_char; |
---|
| 78 | BSP_polling_getchar_function_type BSP_poll_char = NULL; |
---|
Note: See
TracBrowser
for help on using the repository browser.