diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-03-22 14:01:49 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-03-22 14:01:49 +0000 |
commit | 3f432fbd018ee684a4f6e760eff901ea463ccb0b (patch) | |
tree | 5a18ac85ab25e0b6bd3add3f7f974151c2012564 /c/src/lib/libbsp/i386/pc386/startup/exit.c | |
parent | Fix package name. (diff) | |
download | rtems-3f432fbd018ee684a4f6e760eff901ea463ccb0b.tar.bz2 |
2008-03-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* configure.ac, startup/exit.c: Add BSP_PRESS_KEY_FOR_RESET
configuration option. When this is set to one, a clean exit of an
application will result in the BSP resetting the hardware without
waiting for a human to press a key.
* start/start.S, startup/linkcmds: Replace the linkcmds with a
version very closely based upon the default in binutils 2.18 for
this target. This eliminated weird failures with C++ dtors even
in C applications. We had an extra _ on a symbol used in start.S.
Diffstat (limited to 'c/src/lib/libbsp/i386/pc386/startup/exit.c')
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/startup/exit.c | 80 |
1 files changed, 43 insertions, 37 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/startup/exit.c b/c/src/lib/libbsp/i386/pc386/startup/exit.c index 052eeff68f..e322b2fc6f 100644 --- a/c/src/lib/libbsp/i386/pc386/startup/exit.c +++ b/c/src/lib/libbsp/i386/pc386/startup/exit.c @@ -1,34 +1,33 @@ -/*-------------------------------------------------------------------------+ -| exit.c v1.1 - PC386 BSP - 1997/08/07 -+--------------------------------------------------------------------------+ -| Routines to shutdown and reboot the PC. -+--------------------------------------------------------------------------+ -| (C) Copyright 1997 - -| - NavIST Group - Real-Time Distributed Systems and Industrial Automation -| -| http://pandora.ist.utl.pt -| -| Instituto Superior Tecnico * Lisboa * PORTUGAL -+--------------------------------------------------------------------------+ -| Disclaimer: -| -| This file is provided "AS IS" without warranty of any kind, either -| expressed or implied. -+--------------------------------------------------------------------------+ -| This code is based on: -| exit.c,v 1.2 1995/12/19 20:07:36 joel Exp - go32 BSP -| With the following copyright notice: -| ************************************************************************** -| * COPYRIGHT (c) 1989-1999. -| * On-Line Applications Research Corporation (OAR). -| * -| * 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$ -+--------------------------------------------------------------------------*/ +/* + * Routines to shutdown and reboot the PC. + * + * (C) Copyright 1997 - + * - NavIST Group - Real-Time Distributed Systems and Industrial Automation + * http://pandora.ist.utl.pt + * Instituto Superior Tecnico * Lisboa * PORTUGAL + * + * Disclaimer: + * + * This file is provided "AS IS" without warranty of any kind, either + * expressed or implied. + * + * + * This code is based on: + * exit.c,v 1.2 1995/12/19 20:07:36 joel Exp - go32 BSP + * With the following copyright notice: + * ************************************************************************** + * * COPYRIGHT (c) 1989-1999. + * * On-Line Applications Research Corporation (OAR). + * * + * * 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. + * ************************************************************************** + * + * Joel: It has been modified many times since submission. + * + * $Id$ + */ #include <stdio.h> #include <bsp.h> @@ -37,15 +36,22 @@ void bsp_cleanup(void) { - unsigned char ch; - static char line[]="EXECUTIVE SHUTDOWN! Any key to reboot..."; /* - * AT this point, the console driver is disconnected => we must + * 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(); + printk( "\nEXECUTIVE SHUTDOWN! " ); + + #if (BSP_PRESS_KEY_FOR_RESET) + { + unsigned char ch; + + printk( "Any key to reboot..." ); + ch = BSP_poll_char(); + } + #else + printk( "resetting system\n" ); + #endif rtemsReboot(); } |