exit.h

Go to the documentation of this file.
00001 /*
00002 This file is part of CanFestival, a library implementing CanOpen Stack. 
00003 
00004 Copyright (C): Edouard TISSERANT and Francis DUPIN
00005 
00006 See COPYING file for copyrights details.
00007 
00008 This library is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU Lesser General Public
00010 License as published by the Free Software Foundation; either
00011 version 2.1 of the License, or (at your option) any later version.
00012 
00013 This library is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 Lesser General Public License for more details.
00017 
00018 You should have received a copy of the GNU Lesser General Public
00019 License along with this library; if not, write to the Free Software
00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 */
00022 
00023 /* exit.h - 32K Board specific parameters
00024    Copyright (C) 2002 Free Software Foundation, Inc.
00025    Written by Stephane Carrez (stcarrez@nerim.fr)       
00026 
00027 This file is free software; you can redistribute it and/or modify it
00028 under the terms of the GNU General Public License as published by the
00029 Free Software Foundation; either version 2, or (at your option) any
00030 later version.
00031 
00032 In addition to the permissions in the GNU General Public License, the
00033 Free Software Foundation gives you unlimited permission to link the
00034 compiled version of this file with other programs, and to distribute
00035 those programs without any restriction coming from the use of this
00036 file.  (The General Public License restrictions do apply in other
00037 respects; for example, they cover modification of the file, and
00038 distribution when not linked into another program.)
00039 
00040 This file is distributed in the hope that it will be useful, but
00041 WITHOUT ANY WARRANTY; without even the implied warranty of
00042 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00043 General Public License for more details.
00044 
00045 You should have received a copy of the GNU General Public License
00046 along with this program; see the file COPYING.  If not, write to
00047 the Free Software Foundation, 59 Temple Place - Suite 330,
00048 Boston, MA 02111-1307, USA.  */
00049 
00050 #ifndef _M68HC11_ARCH_32K_EXIT_H
00051 #define _M68HC11_ARCH_32K_EXIT_H
00052 
00053 extern void _exit (short status) __attribute__((noreturn));
00054 
00055 /* For the simulator, the wai stops everything and exits with the
00056    error code stored in register d.
00057 
00058    For a real 68HC11, enable interrupts and wait forever.  */
00059 extern inline void
00060 _exit (short status)
00061 {
00062   /* Use 'd' constraint to force the status to be in the D
00063      register before execution of the asm.  */
00064   while (1)
00065     {
00066       __asm__ __volatile__ ("cli\n"
00067                             "wai" : : "d"(status));
00068     }
00069 }
00070 
00071 #endif

Generated on Mon Jul 2 19:10:16 2007 for CanFestival by  doxygen 1.5.1