source: rtems/c/src/lib/libbsp/i386/pc386/startup/exit.c @ 2efdd08

4.104.114.84.95
Last change on this file since 2efdd08 was 2efdd08, checked in by Joel Sherrill <joel.sherrill@…>, on May 20, 1998 at 5:06:57 PM

Patch from Ralf Corseipus to fix latent configure problems suddenly triggered:

The breakdown:

  • CC_FOR_TARGET and CXX_FOR_TARGET were not correctly re-read from autoconf's configuration cache (config.cache)
  • If <target>-[gcc|g++] was not found while running configure, the config macros tried to use other (wrong) compilers (e.g. cc).

Changes:

  • New RTEMS_PROG_CC macro (aclocal/prog-cc.m4).
  • New RTEMS_PROG_CXX macro (aclocal/prog-cxx.m4)
  • Moved a shell script fragment from configure.in to a new m4-autoconf macro (New file: aclocal/tool-prefix.m4)
  • Minor changes to configure.in

I tested it with linux/posix (native gcc/primary libc) and
sh-rtems/gensh1 on a linux host and didn't notice any bugs
related to the problems mentioned above. There seem to be
more bugs with the posix bsp, but I consider them minor as
the build run completed successfully. It is just too late
for me to attempt to fix them now.

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*-------------------------------------------------------------------------+
2| exit.c v1.1 - PC386 BSP - 1997/08/07
3+--------------------------------------------------------------------------+
4| Routines to shutdown and reboot the PC.
5+--------------------------------------------------------------------------+
6| (C) Copyright 1997 -
7| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
8|
9| http://pandora.ist.utl.pt
10|
11| Instituto Superior Tecnico * Lisboa * PORTUGAL
12+--------------------------------------------------------------------------+
13| Disclaimer:
14|
15| This file is provided "AS IS" without warranty of any kind, either
16| expressed or implied.
17+--------------------------------------------------------------------------+
18| This code is based on:
19|   exit.c,v 1.2 1995/12/19 20:07:36 joel Exp -  go32 BSP
20| With the following copyright notice:
21| **************************************************************************
22| *  COPYRIGHT (c) 1989-1998.
23| *  On-Line Applications Research Corporation (OAR).
24| *  Copyright assigned to U.S. Government, 1994.
25| *
26| *  The license and distribution terms for this file may be
27| *  found in found in the file LICENSE in this distribution or at
28| *  http://www.OARcorp.com/rtems/license.html.
29| **************************************************************************
30|
31|  $Id$
32+--------------------------------------------------------------------------*/
33
34
35#include <stdio.h>
36
37#include <bsp.h>
38
39/*-------------------------------------------------------------------------+
40| External Prototypes
41+--------------------------------------------------------------------------*/
42extern rtems_boolean _IBMPC_scankey(char *);  /* defined in 'inch.c' */
43
44/*-------------------------------------------------------------------------+
45|         Function: rtemsReboot
46|      Description: Reboot the PC.
47| Global Variables: None.
48|        Arguments: None.
49|          Returns: Nothing.
50+--------------------------------------------------------------------------*/
51inline void rtemsReboot(void)
52{
53  /* shutdown and reboot */
54  outport_byte(0x64, 0xFE);        /* use keyboard controler to do the job... */
55} /* rtemsReboot */
56
57
58/*-------------------------------------------------------------------------+
59|         Function: _exit
60|      Description: Shutdown the PC. Called from libc's 'exit'.
61| Global Variables: None.
62|        Arguments: status - exit status (ignored).
63|          Returns: Nothing.
64+--------------------------------------------------------------------------*/
65void _exit(int status)
66{
67  unsigned char ch;
68  puts("\nEXECUTIVE SHUTDOWN! Any key to reboot...");
69
70  while(!_IBMPC_scankey(&ch))
71    ;
72
73  rtemsReboot();
74} /* _exit */
Note: See TracBrowser for help on using the repository browser.