diff options
Diffstat (limited to 'c/src/lib/libbsp/arm/arm_bare_bsp/startup/exit.c')
-rw-r--r-- | c/src/lib/libbsp/arm/arm_bare_bsp/startup/exit.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/arm_bare_bsp/startup/exit.c b/c/src/lib/libbsp/arm/arm_bare_bsp/startup/exit.c new file mode 100644 index 0000000000..7eb3056585 --- /dev/null +++ b/c/src/lib/libbsp/arm/arm_bare_bsp/startup/exit.c @@ -0,0 +1,48 @@ +/*-------------------------------------------------------------------------+ +| 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.OARcorp.com/rtems/license.html. +| ++--------------------------------------------------------------------------*/ + + +#include <stdio.h> +#include <bsp.h> +#include <bspio.h> +#include <rtems/libio.h> + +void rtemsReboot (void) +{ + asm volatile ("b _start"); +} + +void bsp_cleanup(void) +{ + unsigned char ch; + static char line[]="\nEXECUTIVE SHUTDOWN! Any key to reboot..."; + /* + * AT this point, the console driver is disconnected => we must + * use polled output/input. This is exactly what printk + * does. + */ + printk("\n"); + printk(line); + ch = BSP_poll_char(); + rtemsReboot(); +} + + + + + + + + |