diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-22 21:50:15 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-22 21:50:15 +0000 |
commit | 87b9739e9881148ee2fc1a9a852f09b18aaef11d (patch) | |
tree | 61f8b1fbfb9ae81c635a19d19fdfe86835d69f78 /c/src/lib/libbsp/powerpc/gen5200/console/console.c | |
parent | 2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-87b9739e9881148ee2fc1a9a852f09b18aaef11d.tar.bz2 |
2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, console/console.c, include/bsp.h,
startup/bspstart.c: Use standardized bsp_cleanup() which can
optionally print a message, poll for user to press key, and call
bsp_reset(). Using this eliminates the various bsp_cleanup()
implementations which had their own implementation and variety of
string constants.
* startup/bspreset.c: New file.
* startup/bspclean.c: Removed.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/powerpc/gen5200/console/console.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/powerpc/gen5200/console/console.c b/c/src/lib/libbsp/powerpc/gen5200/console/console.c index 0a33b2fdff..34e38886e4 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/console/console.c +++ b/c/src/lib/libbsp/powerpc/gen5200/console/console.c @@ -142,8 +142,11 @@ uint32_t mpc5200_uart_avail_mask = GEN5200_UART_AVAIL_MASK; #endif static void A_BSP_output_char(char c); +static int A_BSP_get_char(void); BSP_output_char_function_type BSP_output_char = A_BSP_output_char; +BSP_polling_getchar_function_type BSP_poll_char = A_BSP_get_char; + /* Used to handle premature outputs of printk */ uint32_t console_initialized = FALSE; @@ -625,7 +628,7 @@ static void A_BSP_output_char( * and we can just poll bytes out at any time. */ #if !defined(HAS_UBOOT) - if (console_initialized == FALSE ) + if (console_initialized == FALSE) return; #endif @@ -637,6 +640,20 @@ static void A_BSP_output_char( PRINTK_WRITE( PRINTK_MINOR, &cr, 1 ); } +static int A_BSP_get_char(void) +{ + /* + * If we are using U-Boot, then the console is already initialized + * and we can just poll bytes in at any time. + */ + #if !defined(HAS_UBOOT) + if (console_initialized == FALSE) + return; + #endif + + return mpc5200_uart_pollRead(0); +} + /* *************** * BOILERPLATE * |