diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2005-07-06 18:46:04 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2005-07-06 18:46:04 +0000 |
commit | 3c7ed6b8cd505f696c9c2b6d90723094f334b348 (patch) | |
tree | 30da596d32865c2d042ece5735d16baeade7d17d /c/src/lib/libbsp/arm/gba/startup/exit.c | |
parent | Add PR. (diff) | |
download | rtems-3c7ed6b8cd505f696c9c2b6d90723094f334b348.tar.bz2 |
2005-07-06 Markku Puro <markku.puro@kopteri.net>
* .cvsignore, ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
clock/clockdrv.c, console/conio.c, console/console.c,
console/defaultfont.c, include/arm_mode_bits.h, include/asm_macros.h,
include/bsp.h, include/bspopts.h.in, include/conio.h, include/gba.h,
include/gba_registers.h, include/tm27.h, irq/bsp_irq_asm.S,
irq/bsp_irq_init.c, irq/irq.c, irq/irq.h, irq/irq_asm.S,
irq/irq_init.c, start/logo.S, start/start.S, startup/bspstart.c,
startup/cpu.c, startup/cpu_asm.S, startup/exit.c, startup/linkcmds,
timer/timer.c: New files.
Diffstat (limited to 'c/src/lib/libbsp/arm/gba/startup/exit.c')
-rw-r--r-- | c/src/lib/libbsp/arm/gba/startup/exit.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/gba/startup/exit.c b/c/src/lib/libbsp/arm/gba/startup/exit.c new file mode 100644 index 0000000000..d5fa3789ae --- /dev/null +++ b/c/src/lib/libbsp/arm/gba/startup/exit.c @@ -0,0 +1,54 @@ +/** + * @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(); +} |