forked from Imagelibrary/rtems
2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, console/uart.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. * startup/bspclean.c: Removed.
This commit is contained in:
@@ -1,3 +1,13 @@
|
|||||||
|
2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
|
* Makefile.am, configure.ac, console/uart.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.
|
||||||
|
* startup/bspclean.c: Removed.
|
||||||
|
|
||||||
2008-09-19 Joel Sherrill <joel.sherrill@oarcorp.com>
|
2008-09-19 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
* Makefile.am, startup/linkcmds: Use top level shared
|
* Makefile.am, startup/linkcmds: Use top level shared
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ dist_project_lib_DATA += startup/linkcmds
|
|||||||
|
|
||||||
startup_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \
|
startup_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \
|
||||||
../../shared/bsppredriverhook.c ../../shared/bspgetworkarea.c \
|
../../shared/bsppredriverhook.c ../../shared/bspgetworkarea.c \
|
||||||
../../shared/bsppretaskinghook.c startup/bspstart.c startup/bspclean.c \
|
../../shared/bsppretaskinghook.c startup/bspstart.c \
|
||||||
|
../../shared/bspclean.c startup/bspreset.c \
|
||||||
startup/memmap.c ../../shared/bootcard.c ../../shared/sbrk.c \
|
startup/memmap.c ../../shared/bootcard.c ../../shared/sbrk.c \
|
||||||
../../shared/gnatinstallhandler.c
|
../../shared/gnatinstallhandler.c
|
||||||
console_SOURCES = console/uart.c ../../shared/console.c
|
console_SOURCES = console/uart.c ../../shared/console.c
|
||||||
|
|||||||
@@ -18,6 +18,15 @@ RTEMS_PROG_CCAS
|
|||||||
RTEMS_CHECK_NETWORKING
|
RTEMS_CHECK_NETWORKING
|
||||||
AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
|
AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
|
||||||
|
|
||||||
|
RTEMS_BSPOPTS_SET([BSP_PRESS_KEY_FOR_RESET],[*],[0])
|
||||||
|
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
|
RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
|
||||||
|
|
||||||
# Explicitly list all Makefiles here
|
# Explicitly list all Makefiles here
|
||||||
|
|||||||
@@ -245,5 +245,9 @@ static void _BSP_put_char( char c ) {
|
|||||||
|
|
||||||
BSP_output_char_function_type BSP_output_char = _BSP_put_char;
|
BSP_output_char_function_type BSP_output_char = _BSP_put_char;
|
||||||
|
|
||||||
|
static int _BSP_get_char(void)
|
||||||
|
{
|
||||||
|
return uart_poll_read(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
BSP_polling_getchar_function_type BSP_poll_char = _BSP_get_char;
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
/*-------------------------------------------------------------------------+
|
|
||||||
| exit.c - ARM BSP
|
|
||||||
+--------------------------------------------------------------------------+
|
|
||||||
| Routines to shutdown and reboot the BSP.
|
|
||||||
+--------------------------------------------------------------------------+
|
|
||||||
|
|
|
||||||
| Copyright (c) 2000 Canon Research Centre France SA.
|
|
||||||
| Emmanuel Raguet, mailto:raguet@crf.canon.fr
|
|
||||||
|
|
|
||||||
| 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.
|
|
||||||
|
|
|
||||||
+--------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <bsp.h>
|
|
||||||
#include <rtems/bspIo.h>
|
|
||||||
#include <rtems/libio.h>
|
|
||||||
|
|
||||||
void bsp_reset(void);
|
|
||||||
|
|
||||||
void bsp_cleanup(void)
|
|
||||||
{
|
|
||||||
bsp_reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
38
c/src/lib/libbsp/arm/gp32/startup/bspreset.c
Normal file
38
c/src/lib/libbsp/arm/gp32/startup/bspreset.c
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* 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 <bsp.h>
|
||||||
|
|
||||||
|
void bsp_reset(void)
|
||||||
|
{
|
||||||
|
rtems_interrupt_level level;
|
||||||
|
rtems_interrupt_disable(level);
|
||||||
|
/* disable mmu, invalide i-cache and call swi #4 */
|
||||||
|
asm volatile(""
|
||||||
|
"mrc p15,0,r0,c1,c0,0 \n"
|
||||||
|
"bic r0,r0,#1 \n"
|
||||||
|
"mcr p15,0,r0,c1,c0,0 \n"
|
||||||
|
"nop \n"
|
||||||
|
"nop \n"
|
||||||
|
"nop \n"
|
||||||
|
"nop \n"
|
||||||
|
"nop \n"
|
||||||
|
"mov r0,#0 \n"
|
||||||
|
"MCR p15,0,r0,c7,c5,0 \n"
|
||||||
|
"nop \n"
|
||||||
|
"nop \n"
|
||||||
|
"nop \n"
|
||||||
|
"nop \n"
|
||||||
|
"nop \n"
|
||||||
|
"swi #4 "
|
||||||
|
:
|
||||||
|
:
|
||||||
|
: "r0"
|
||||||
|
);
|
||||||
|
/* we should be back in bios now */
|
||||||
|
}
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
* found in found in the file LICENSE in this distribution or at
|
* found in found in the file LICENSE in this distribution or at
|
||||||
* http://www.rtems.com/license/LICENSE.
|
* http://www.rtems.com/license/LICENSE.
|
||||||
*
|
*
|
||||||
|
* $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
@@ -101,33 +102,3 @@ void bsp_start_default( void )
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void bsp_start (void) __attribute__ ((weak, alias("bsp_start_default")));
|
void bsp_start (void) __attribute__ ((weak, alias("bsp_start_default")));
|
||||||
|
|
||||||
void bsp_reset(void)
|
|
||||||
{
|
|
||||||
rtems_interrupt_level level;
|
|
||||||
rtems_interrupt_disable(level);
|
|
||||||
printk("bsp_reset.....\n");
|
|
||||||
/* disable mmu, invalide i-cache and call swi #4 */
|
|
||||||
asm volatile(""
|
|
||||||
"mrc p15,0,r0,c1,c0,0 \n"
|
|
||||||
"bic r0,r0,#1 \n"
|
|
||||||
"mcr p15,0,r0,c1,c0,0 \n"
|
|
||||||
"nop \n"
|
|
||||||
"nop \n"
|
|
||||||
"nop \n"
|
|
||||||
"nop \n"
|
|
||||||
"nop \n"
|
|
||||||
"mov r0,#0 \n"
|
|
||||||
"MCR p15,0,r0,c7,c5,0 \n"
|
|
||||||
"nop \n"
|
|
||||||
"nop \n"
|
|
||||||
"nop \n"
|
|
||||||
"nop \n"
|
|
||||||
"nop \n"
|
|
||||||
"swi #4 "
|
|
||||||
:
|
|
||||||
:
|
|
||||||
: "r0"
|
|
||||||
);
|
|
||||||
/* we should be back in bios now */
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user