etisserant@0: /* etisserant@0: This file is part of CanFestival, a library implementing CanOpen Stack. etisserant@0: etisserant@0: Copyright (C): Edouard TISSERANT and Francis DUPIN etisserant@0: etisserant@0: See COPYING file for copyrights details. etisserant@0: etisserant@0: This library is free software; you can redistribute it and/or etisserant@0: modify it under the terms of the GNU Lesser General Public etisserant@0: License as published by the Free Software Foundation; either etisserant@0: version 2.1 of the License, or (at your option) any later version. etisserant@0: etisserant@0: This library is distributed in the hope that it will be useful, etisserant@0: but WITHOUT ANY WARRANTY; without even the implied warranty of etisserant@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU etisserant@0: Lesser General Public License for more details. etisserant@0: etisserant@0: You should have received a copy of the GNU Lesser General Public etisserant@0: License along with this library; if not, write to the Free Software etisserant@0: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA etisserant@0: */ etisserant@0: etisserant@0: /* exit.h - 32K Board specific parameters etisserant@0: Copyright (C) 2002 Free Software Foundation, Inc. etisserant@0: Written by Stephane Carrez (stcarrez@nerim.fr) etisserant@0: etisserant@0: This file is free software; you can redistribute it and/or modify it etisserant@0: under the terms of the GNU General Public License as published by the etisserant@0: Free Software Foundation; either version 2, or (at your option) any etisserant@0: later version. etisserant@0: etisserant@0: In addition to the permissions in the GNU General Public License, the etisserant@0: Free Software Foundation gives you unlimited permission to link the etisserant@0: compiled version of this file with other programs, and to distribute etisserant@0: those programs without any restriction coming from the use of this etisserant@0: file. (The General Public License restrictions do apply in other etisserant@0: respects; for example, they cover modification of the file, and etisserant@0: distribution when not linked into another program.) etisserant@0: etisserant@0: This file is distributed in the hope that it will be useful, but etisserant@0: WITHOUT ANY WARRANTY; without even the implied warranty of etisserant@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU etisserant@0: General Public License for more details. etisserant@0: etisserant@0: You should have received a copy of the GNU General Public License etisserant@0: along with this program; see the file COPYING. If not, write to etisserant@0: the Free Software Foundation, 59 Temple Place - Suite 330, etisserant@0: Boston, MA 02111-1307, USA. */ etisserant@0: etisserant@0: #ifndef _M68HC11_ARCH_32K_EXIT_H etisserant@0: #define _M68HC11_ARCH_32K_EXIT_H etisserant@0: etisserant@0: extern void _exit (short status) __attribute__((noreturn)); etisserant@0: etisserant@0: /* For the simulator, the wai stops everything and exits with the etisserant@0: error code stored in register d. etisserant@0: etisserant@0: For a real 68HC11, enable interrupts and wait forever. */ etisserant@0: extern inline void etisserant@0: _exit (short status) etisserant@0: { etisserant@0: /* Use 'd' constraint to force the status to be in the D etisserant@0: register before execution of the asm. */ etisserant@0: while (1) etisserant@0: { etisserant@0: __asm__ __volatile__ ("cli\n" etisserant@0: "wai" : : "d"(status)); etisserant@0: } etisserant@0: } etisserant@0: etisserant@0: #endif