diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-22 21:49:21 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-22 21:49:21 +0000 |
commit | bf7e13f3a1e7cc2ef2526bb71e030026681a21da (patch) | |
tree | a1f7b0cacd86847016e716ccb520cf63dbe7cc56 /c/src/lib/libbsp/arm/gp32/startup/bspreset.c | |
parent | 2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-bf7e13f3a1e7cc2ef2526bb71e030026681a21da.tar.bz2 |
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.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/arm/gp32/startup/bspreset.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/gp32/startup/bspreset.c b/c/src/lib/libbsp/arm/gp32/startup/bspreset.c new file mode 100644 index 0000000000..9484a62bdc --- /dev/null +++ b/c/src/lib/libbsp/arm/gp32/startup/bspreset.c @@ -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 */ +} |