00001 /* --------------------------------------------------------------------------- 00002 00003 This file is part of the ``utils'' package of NuSMV version 2. 00004 Copyright (C) 1998-2001 by CMU and FBK-irst. 00005 00006 NuSMV version 2 is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Lesser General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 NuSMV version 2 is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public 00017 License along with this library; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 00019 00020 For more information on NuSMV see <http://nusmv.fbk.eu> 00021 or email to <nusmv-users@fbk.eu>. 00022 Please report bugs to <nusmv-users@fbk.eu>. 00023 00024 To contact the NuSMV development board, email to <nusmv@fbk.eu>. 00025 00026 -----------------------------------------------------------------------------*/ 00027 00037 #ifndef __NUSMV_CORE_UTILS_WATCHDOG_UTIL_H__ 00038 #define __NUSMV_CORE_UTILS_WATCHDOG_UTIL_H__ 00039 00040 #if HAVE_CONFIG_H 00041 # include "nusmv-config.h" 00042 #endif 00043 00044 #include "nusmv/core/cinit/NuSMVEnv.h" 00045 #include "nusmv/core/utils/error.h" 00046 00047 #if NUSMV_HAVE_WATCHDOG_LIBRARY 00048 #include "watchdog.h" 00049 #endif 00050 00051 /*---------------------------------------------------------------------------*/ 00052 /* Constant declarations */ 00053 /*---------------------------------------------------------------------------*/ 00054 00055 00056 /*---------------------------------------------------------------------------*/ 00057 /* Type declarations */ 00058 /*---------------------------------------------------------------------------*/ 00059 00060 00061 /*---------------------------------------------------------------------------*/ 00062 /* Structure declarations */ 00063 /*---------------------------------------------------------------------------*/ 00064 00065 /*---------------------------------------------------------------------------*/ 00066 /* Variable declarations */ 00067 /*---------------------------------------------------------------------------*/ 00068 static NuSMVEnv_ptr watchdog_env; 00069 00070 00071 /*---------------------------------------------------------------------------*/ 00072 /* Macro declarations */ 00073 /*---------------------------------------------------------------------------*/ 00074 00086 #if NUSMV_HAVE_WATCHDOG_LIBRARY 00087 #define WATCHDOG_INIT(env, name, period, action, options) \ 00088 watchdog_mod(name, period, action, options, env) 00089 #else 00090 #define WATCHDOG_INIT(env, name, period, action, options) 00091 #endif 00092 00104 #if NUSMV_HAVE_WATCHDOG_LIBRARY 00105 #define WATCHDOG_START(env, name) \ 00106 watchdog_start(name) 00107 #else 00108 #define WATCHDOG_START(env, name) 00109 #endif 00110 00122 #if NUSMV_HAVE_WATCHDOG_LIBRARY 00123 #define WATCHDOG_PAUSE(env, name) \ 00124 watchdog_pause(name) 00125 #else 00126 #define WATCHDOG_PAUSE(env, name) 00127 #endif 00128 00147 #if NUSMV_HAVE_WATCHDOG_LIBRARY 00148 #define WATCHDOG_GET_STATUS(env, name, status) \ 00149 -1 00150 #else 00151 #define WATCHDOG_GET_STATUS(env, name, status) -1 00152 #endif 00153 00156 /*---------------------------------------------------------------------------*/ 00157 /* Function prototypes */ 00158 /*---------------------------------------------------------------------------*/ 00159 00165 void watchdog_action(void* env); 00166 00167 00168 00169 00172 #endif /* __NUSMV_CORE_UTILS_WATCHDOG_UTIL_H__ */