4.115
Last change
on this file since 6279149 was
6279149,
checked in by Joel Sherrill <joel.sherrill@…>, on 10/08/14 at 21:04:56
|
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.2 KB
|
Rev | Line | |
---|
[e0ddaa7e] | 1 | /* |
---|
| 2 | * This file contains the hardware specific portions of the TTY driver |
---|
| 3 | * for the simulators stdin/out. |
---|
[6279149] | 4 | */ |
---|
| 5 | |
---|
| 6 | /* |
---|
[931ed32b] | 7 | * COPYRIGHT (c) 1989-2011. |
---|
[e0ddaa7e] | 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. |
---|
[e0ddaa7e] | 13 | */ |
---|
| 14 | |
---|
| 15 | #include <bsp.h> |
---|
[6279149] | 16 | #include <bsp/console-polled.h> |
---|
[e0ddaa7e] | 17 | #include <rtems/libio.h> |
---|
| 18 | #include <stdlib.h> |
---|
| 19 | #include <assert.h> |
---|
| 20 | |
---|
[931ed32b] | 21 | #include <bsp/syscall.h> |
---|
[e0ddaa7e] | 22 | |
---|
[542e7b3] | 23 | int errno; |
---|
[e0ddaa7e] | 24 | |
---|
| 25 | extern int __trap34(int, int, void*, int ); |
---|
| 26 | |
---|
| 27 | /* |
---|
| 28 | * console_initialize_hardware |
---|
| 29 | * |
---|
| 30 | * This routine initializes the console hardware. |
---|
| 31 | * |
---|
| 32 | */ |
---|
| 33 | |
---|
| 34 | void console_initialize_hardware(void) |
---|
| 35 | { |
---|
| 36 | return; |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | /* |
---|
| 40 | * console_outbyte_polled |
---|
| 41 | * |
---|
| 42 | * This routine transmits a character using polling. |
---|
| 43 | */ |
---|
| 44 | |
---|
| 45 | void console_outbyte_polled( |
---|
| 46 | int port, |
---|
| 47 | char ch |
---|
| 48 | ) |
---|
| 49 | { |
---|
| 50 | __trap34 (SYS_write, 1, &ch, 1); |
---|
| 51 | return; |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | /* |
---|
[0fdc099] | 55 | * console_inbyte_nonblocking |
---|
[e0ddaa7e] | 56 | * |
---|
| 57 | * This routine polls for a character. |
---|
| 58 | */ |
---|
| 59 | |
---|
| 60 | int console_inbyte_nonblocking( |
---|
| 61 | int port |
---|
| 62 | ) |
---|
| 63 | { |
---|
| 64 | unsigned char c; |
---|
| 65 | |
---|
| 66 | return __trap34 (SYS_read, 0, &c, 1); |
---|
| 67 | } |
---|
| 68 | |
---|
| 69 | /* XXX wrong place for this */ |
---|
[1925dad2] | 70 | int _sys_exit (int n) |
---|
[e0ddaa7e] | 71 | { |
---|
| 72 | return __trap34 (SYS_exit, n, 0, 0); |
---|
| 73 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.