summaryrefslogtreecommitdiffstats
path: root/c/src/exec/score/macros/rtems/score/watchdog.inl
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/exec/score/macros/rtems/score/watchdog.inl')
-rw-r--r--c/src/exec/score/macros/rtems/score/watchdog.inl202
1 files changed, 202 insertions, 0 deletions
diff --git a/c/src/exec/score/macros/rtems/score/watchdog.inl b/c/src/exec/score/macros/rtems/score/watchdog.inl
new file mode 100644
index 0000000000..1b150d8dab
--- /dev/null
+++ b/c/src/exec/score/macros/rtems/score/watchdog.inl
@@ -0,0 +1,202 @@
+/* watchdog.inl
+ *
+ * This file contains the macro implementation of all inlined routines
+ * in the Watchdog Handler.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#ifndef __WATCHDOG_inl
+#define __WATCHDOG_inl
+
+#include <rtems/object.h>
+
+/*PAGE
+ *
+ * _Watchdog_Initialize
+ *
+ */
+
+#define _Watchdog_Initialize( _the_watchdog, _routine, _id, _user_data ) \
+ { \
+ (_the_watchdog)->state = WATCHDOG_INACTIVE; \
+ (_the_watchdog)->routine = (_routine); \
+ (_the_watchdog)->id = (_id); \
+ (_the_watchdog)->user_data = (_user_data); \
+ }
+
+/*PAGE
+ *
+ * _Watchdog_Is_active
+ *
+ */
+
+#define _Watchdog_Is_active( _the_watchdog ) \
+ ( (_the_watchdog)->state == WATCHDOG_ACTIVE )
+
+/*PAGE
+ *
+ * _Watchdog_Activate
+ *
+ */
+
+#define _Watchdog_Activate( _the_watchdog ) \
+ (_the_watchdog)->state = WATCHDOG_ACTIVE
+
+/*PAGE
+ *
+ * _Watchdog_Deactivate
+ *
+ */
+
+#define _Watchdog_Deactivate( _the_watchdog ) \
+ (_the_watchdog)->state = WATCHDOG_REMOVE_IT
+
+/*PAGE
+ *
+ * _Watchdog_Tickle_ticks
+ *
+ */
+
+#define _Watchdog_Tickle_ticks() \
+ _Watchdog_Tickle( &_Watchdog_Ticks_chain )
+
+/*PAGE
+ *
+ * _Watchdog_Tickle_seconds
+ *
+ */
+
+#define _Watchdog_Tickle_seconds() \
+ _Watchdog_Tickle( &_Watchdog_Seconds_chain )
+
+/*PAGE
+ *
+ * _Watchdog_Insert_ticks
+ *
+ */
+
+#define _Watchdog_Insert_ticks( _the_watchdog, _units, _insert_mode ) \
+ { \
+ (_the_watchdog)->initial = (_units); \
+ _Watchdog_Insert( &_Watchdog_Ticks_chain, \
+ (_the_watchdog), (_insert_mode) ); \
+ }
+
+/*PAGE
+ *
+ * _Watchdog_Insert_seconds
+ *
+ */
+
+#define _Watchdog_Insert_seconds( _the_watchdog, _units, _insert_mode ) \
+ { \
+ (_the_watchdog)->initial = (_units); \
+ _Watchdog_Insert( &_Watchdog_Seconds_chain, \
+ (_the_watchdog), (_insert_mode) ); \
+ }
+
+/*PAGE
+ *
+ * _Watchdog_Adjust_seconds
+ *
+ */
+
+#define _Watchdog_Adjust_seconds( _direction, _units ) \
+ _Watchdog_Adjust( &_Watchdog_Seconds_chain, (_direction), (_units) )
+
+/*PAGE
+ *
+ * _Watchdog_Adjust_ticks
+ *
+ */
+
+#define _Watchdog_Adjust_ticks( _direction, _units ) \
+ _Watchdog_Adjust( &_Watchdog_Ticks_chain, (_direction), (_units) )
+
+/*PAGE
+ *
+ * _Watchdog_Reset
+ *
+ */
+
+#define _Watchdog_Reset( _the_watchdog ) \
+ { \
+ (void) _Watchdog_Remove( (_the_watchdog) ); \
+ _Watchdog_Insert( &_Watchdog_Ticks_chain, \
+ (_the_watchdog), WATCHDOG_ACTIVATE_NOW ); \
+ }
+
+/*PAGE
+ *
+ * _Watchdog_Next
+ *
+ */
+
+#define _Watchdog_Next( _watchdog ) \
+ ((Watchdog_Control *) (_watchdog)->Node.next)
+
+/*PAGE
+ *
+ * _Watchdog_Previous
+ *
+ */
+
+#define _Watchdog_Previous( _watchdog ) \
+ ((Watchdog_Control *) (_watchdog)->Node.previous)
+
+/*PAGE
+ *
+ * _Watchdog_First
+ *
+ */
+
+#define _Watchdog_First( _header ) \
+ ((Watchdog_Control *) (_header)->first)
+
+/*PAGE
+ *
+ * _Watchdog_Last
+ *
+ */
+
+#define _Watchdog_Last( _header ) \
+ ((Watchdog_Control *) (_header)->last)
+
+/*PAGE
+ *
+ * _Watchdog_Get_sync
+ *
+ */
+
+#define _Watchdog_Get_sync() \
+ ((Watchdog_Control *) _Watchdog_Sync)
+
+/*PAGE
+ *
+ * _Watchdog_Set_sync
+ *
+ */
+
+#define _Watchdog_Set_sync( _the_watchdog ) \
+ _Watchdog_Sync = (Watchdog_Synchronization_pointer) (_the_watchdog)
+
+/*PAGE
+ *
+ * _Watchdog_Clear_sync
+ *
+ */
+
+#define _Watchdog_Clear_sync() \
+ _Watchdog_Sync = NULL;
+
+#endif
+/* end of include file */