summaryrefslogtreecommitdiffstats
path: root/c/src/lib
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-22 21:49:19 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-22 21:49:19 +0000
commit61433e8eab6ac75130aaa8f8372ff530c245b9a0 (patch)
treedc42dcc7c499f7dd5adb839ab234041aeb6df412 /c/src/lib
parent2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-61433e8eab6ac75130aaa8f8372ff530c245b9a0.tar.bz2
2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, console/console.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/bspclean.c: Removed.
Diffstat (limited to 'c/src/lib')
-rw-r--r--c/src/lib/libbsp/arm/gba/ChangeLog9
-rw-r--r--c/src/lib/libbsp/arm/gba/Makefile.am4
-rw-r--r--c/src/lib/libbsp/arm/gba/configure.ac9
-rw-r--r--c/src/lib/libbsp/arm/gba/console/console.c3
-rw-r--r--c/src/lib/libbsp/arm/gba/startup/bspclean.c54
5 files changed, 20 insertions, 59 deletions
diff --git a/c/src/lib/libbsp/arm/gba/ChangeLog b/c/src/lib/libbsp/arm/gba/ChangeLog
index 5b33994338..a155171829 100644
--- a/c/src/lib/libbsp/arm/gba/ChangeLog
+++ b/c/src/lib/libbsp/arm/gba/ChangeLog
@@ -1,3 +1,12 @@
+2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * Makefile.am, configure.ac, console/console.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/bspclean.c: Removed.
+
2008-09-16 Joel Sherrill <joel.sherrill@oarcorp.com>
* startup/bspstart.c: Remove unnecessary includes of
diff --git a/c/src/lib/libbsp/arm/gba/Makefile.am b/c/src/lib/libbsp/arm/gba/Makefile.am
index e4d6bfa4ea..fb8b821bb5 100644
--- a/c/src/lib/libbsp/arm/gba/Makefile.am
+++ b/c/src/lib/libbsp/arm/gba/Makefile.am
@@ -39,8 +39,8 @@ gbaoverrides_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
startup_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \
startup/bspgetworkarea.c ../../shared/bsppretaskinghook.c \
- ../../shared/bsppredriverhook.c startup/bspclean.c \
- ../../shared/bootcard.c ../../shared/sbrk.c \
+ ../../shared/bsppredriverhook.c ../../shared/bspclean.c \
+ startup/bspreset.c ../../shared/bootcard.c ../../shared/sbrk.c \
../../shared/gnatinstallhandler.c
clock_SOURCES = clock/clockdrv.c
console_SOURCES = console/conio.c console/console.c \
diff --git a/c/src/lib/libbsp/arm/gba/configure.ac b/c/src/lib/libbsp/arm/gba/configure.ac
index 755415e21e..dc91801d7a 100644
--- a/c/src/lib/libbsp/arm/gba/configure.ac
+++ b/c/src/lib/libbsp/arm/gba/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/gba/console/console.c b/c/src/lib/libbsp/arm/gba/console/console.c
index 7a07da9ec6..a907d2d40e 100644
--- a/c/src/lib/libbsp/arm/gba/console/console.c
+++ b/c/src/lib/libbsp/arm/gba/console/console.c
@@ -28,9 +28,6 @@
#include <gba.h>
#include <conio.h>
-extern void rtemsReboot(void);
-
-
/**
* @brief gba_pollRead function read char
*
diff --git a/c/src/lib/libbsp/arm/gba/startup/bspclean.c b/c/src/lib/libbsp/arm/gba/startup/bspclean.c
deleted file mode 100644
index d5fa3789ae..0000000000
--- a/c/src/lib/libbsp/arm/gba/startup/bspclean.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * @file exit.c
- *
- * Routines to shutdown and reboot the BSP.
- */
-/*
- * RTEMS GBA BSP
- *
- * Copyright (c) 2004 Markku Puro <markku.puro@kopteri.net>
- *
- * The license and distribution terms for this file may be
- * found in 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>
-#include <rtems/libio.h>
-#include <gba.h>
-
-
-/**
- * @brief rtemsReboot BSP routine reboot rtems
- *
- * Input parameters: None
- *
- * Output parameters: None
- */
-void rtemsReboot (void)
-{
- asm volatile ("ldr r0, =_gba_reset");
- asm volatile ("bx r0");
-}
-
-/**
- * @brief bsp_cleanup BSP routine wait input from user for rebooting
- *
- * Normally at this point, the console driver is disconnected => we must
- * use polled output/input. This is exactly what printk does.
- *
- * @param None
- * @return None
- */
-void bsp_cleanup(void)
-{
- static const char line[]="\nEXECUTIVE SHUTDOWN! Press button to reboot...";
- printk("\n");
- printk("%s",line);
- while ( !GBA_ANY_KEY(GBA_KEY_ALL) );
- rtemsReboot();
-}