diff options
Diffstat (limited to 'c/src/lib/libbsp/sparc/leon3/console/debugputs.c')
-rw-r--r-- | c/src/lib/libbsp/sparc/leon3/console/debugputs.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/console/debugputs.c b/c/src/lib/libbsp/sparc/leon3/console/debugputs.c index b9cfeaef78..255867bc95 100644 --- a/c/src/lib/libbsp/sparc/leon3/console/debugputs.c +++ b/c/src/lib/libbsp/sparc/leon3/console/debugputs.c @@ -69,3 +69,22 @@ int console_inbyte_nonblocking( int port ) return -1; } + +/* putchar/getchar for printk */ + +static void bsp_out_char(char c) +{ + console_outbyte_polled(0, c); +} + +BSP_output_char_function_type BSP_output_char = bsp_out_char; + +static char bsp_in_char(void) +{ + int tmp; + + while ((tmp = console_inbyte_nonblocking(0)) < 0); + return (char) tmp; +} + +BSP_polling_getchar_function_type BSP_poll_char = bsp_in_char; |