nico@215: nico@215: nico@215: CanFestival: include/hcs12/board/arch/exit.h Source File nico@215: nico@215: nico@215: nico@215: nico@215:
nico@215:
nico@215:
nico@215:
nico@215: nico@215:

exit.h

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

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