diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-22 21:49:11 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-22 21:49:11 +0000 |
commit | d50ba03d7ae6b14699500477772b0a9c8b3f451b (patch) | |
tree | 398db465359a9e4e6d40d8fd3aa13adc141d0365 /c/src/lib/libbsp/arm/csb336 | |
parent | 2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-d50ba03d7ae6b14699500477772b0a9c8b3f451b.tar.bz2 |
2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, console/uart.c, startup/bspclean.c,
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.
Diffstat (limited to 'c/src/lib/libbsp/arm/csb336')
-rw-r--r-- | c/src/lib/libbsp/arm/csb336/ChangeLog | 10 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/csb336/Makefile.am | 6 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/csb336/configure.ac | 9 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/csb336/console/uart.c | 3 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/csb336/startup/bspclean.c | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/csb336/startup/bspreset.c | 25 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/csb336/startup/bspstart.c | 15 |
7 files changed, 50 insertions, 20 deletions
diff --git a/c/src/lib/libbsp/arm/csb336/ChangeLog b/c/src/lib/libbsp/arm/csb336/ChangeLog index 59aa6cead8..c68958396c 100644 --- a/c/src/lib/libbsp/arm/csb336/ChangeLog +++ b/c/src/lib/libbsp/arm/csb336/ChangeLog @@ -1,3 +1,13 @@ +2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com> + + * Makefile.am, configure.ac, console/uart.c, startup/bspclean.c, + 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. + 2008-09-19 Joel Sherrill <joel.sherrill@oarcorp.com> * Makefile.am, startup/linkcmds: Use top level shared diff --git a/c/src/lib/libbsp/arm/csb336/Makefile.am b/c/src/lib/libbsp/arm/csb336/Makefile.am index d8a0afb841..299c513d5c 100644 --- a/c/src/lib/libbsp/arm/csb336/Makefile.am +++ b/c/src/lib/libbsp/arm/csb336/Makefile.am @@ -27,9 +27,9 @@ dist_project_lib_DATA += startup/linkcmds startup_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \ ../../shared/bspgetworkarea.c ../../shared/bsppretaskinghook.c \ - ../../shared/bsppredriverhook.c startup/bspstart.c startup/bspclean.c \ - startup/memmap.c ../../shared/bootcard.c ../../shared/sbrk.c \ - ../../shared/gnatinstallhandler.c + ../../shared/bsppredriverhook.c startup/bspstart.c ../../shared/bspclean.c \ + startup/bspreset.c startup/memmap.c ../../shared/bootcard.c \ + ../../shared/sbrk.c ../../shared/gnatinstallhandler.c console_SOURCES = console/uart.c abort_SOURCES = ../shared/abort/abort.c diff --git a/c/src/lib/libbsp/arm/csb336/configure.ac b/c/src/lib/libbsp/arm/csb336/configure.ac index a31386341e..157d8719b3 100644 --- a/c/src/lib/libbsp/arm/csb336/configure.ac +++ b/c/src/lib/libbsp/arm/csb336/configure.ac @@ -18,6 +18,15 @@ RTEMS_PROG_CCAS RTEMS_CHECK_NETWORKING AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes") +RTEMS_BSPOPTS_SET([BSP_PRESS_KEY_FOR_RESET],[*],[1]) +RTEMS_BSPOPTS_HELP([BSP_PRESS_KEY_FOR_RESET], +[If defined, print a message and wait until pressed before resetting + board when application exits.]) + +RTEMS_BSPOPTS_SET([BSP_RESET_BOARD_AT_EXIT],[*],[1]) +RTEMS_BSPOPTS_HELP([BSP_RESET_BOARD_AT_EXIT], +[If defined, reset the board when the application exits.]) + RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION # Explicitly list all Makefiles here diff --git a/c/src/lib/libbsp/arm/csb336/console/uart.c b/c/src/lib/libbsp/arm/csb336/console/uart.c index 05afc3233d..febfd29fa4 100644 --- a/c/src/lib/libbsp/arm/csb336/console/uart.c +++ b/c/src/lib/libbsp/arm/csb336/console/uart.c @@ -442,13 +442,14 @@ void _BSP_output_char(char c) poll_write('\r'); } } -BSP_output_char_function_type BSP_output_char = _BSP_output_char; +BSP_output_char_function_type BSP_output_char = _BSP_output_char; char _BSP_poll_char() { return poll_read(); } + BSP_polling_getchar_function_type BSP_poll_char = _BSP_poll_char; diff --git a/c/src/lib/libbsp/arm/csb336/startup/bspclean.c b/c/src/lib/libbsp/arm/csb336/startup/bspclean.c index 869d15dbc1..c316950aa4 100644 --- a/c/src/lib/libbsp/arm/csb336/startup/bspclean.c +++ b/c/src/lib/libbsp/arm/csb336/startup/bspclean.c @@ -6,11 +6,11 @@ * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at - * * http://www.rtems.com/license/LICENSE. * * $Id$ */ + #include <stdio.h> #include <bsp.h> #include <rtems/bspIo.h> diff --git a/c/src/lib/libbsp/arm/csb336/startup/bspreset.c b/c/src/lib/libbsp/arm/csb336/startup/bspreset.c new file mode 100644 index 0000000000..53b6c6af6f --- /dev/null +++ b/c/src/lib/libbsp/arm/csb336/startup/bspreset.c @@ -0,0 +1,25 @@ +/* + * Cogent CSB336 Shutdown code + * + * Copyright (c) 2004 by Cogent Computer Systems + * Written by Jay Monkman <jtm@lopingdog.com> + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#include <bsp.h> +#include <rtems/bspIo.h> + +void bsp_reset(void) +{ + rtems_interrupt_level level; + + rtems_interrupt_disable(level); + + printk("\n\rI should reset here.\n\r"); + while(1); +} diff --git a/c/src/lib/libbsp/arm/csb336/startup/bspstart.c b/c/src/lib/libbsp/arm/csb336/startup/bspstart.c index 41debe0b28..bb22eca0a0 100644 --- a/c/src/lib/libbsp/arm/csb336/startup/bspstart.c +++ b/c/src/lib/libbsp/arm/csb336/startup/bspstart.c @@ -126,18 +126,3 @@ int get_perclk1_freq(void) */ void bsp_start (void) __attribute__ ((weak, alias("bsp_start_default"))); -/** - * Reset the system. - * - * This functions enables the watchdog and waits for it to - * fire, thus resetting the system. - */ -void bsp_reset(void) -{ - rtems_interrupt_level level; - - _CPU_ISR_Disable(level); - - printk("\n\rI should reset here.\n\r"); - while(1); -} |