summaryrefslogtreecommitdiffstats
path: root/c/src/exec/rtems/include/rtems/rtems/timer.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-03-29 15:32:18 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-03-29 15:32:18 +0000
commit894d01c2d401bbd472ddec9f025ca14b25ec4e5d (patch)
tree123e7ad38a5a22183c6e701452ed01833afa62e0 /c/src/exec/rtems/include/rtems/rtems/timer.h
parent2001-03-29 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-894d01c2d401bbd472ddec9f025ca14b25ec4e5d.tar.bz2
2001-03-29 Joel Sherrill <joel@OARcorp.com>
* Per PR147 addressed problems when reseting and inserting a timer into a timer chain that did not honor time passage since the last time the timer server was scheduled and the new insertion. * include/rtems/rtems/timer.h, src/timerreset.c, src/timerserver.c, src/timerserverfireafter.c, src/timerserverfirewhen.c: Broke up the "reset server" routine into a set of very specific routines that allowed the server to be unscheduled, timer chains to be "synchronized" with the current time before inserting a new timer.
Diffstat (limited to 'c/src/exec/rtems/include/rtems/rtems/timer.h')
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/timer.h51
1 files changed, 33 insertions, 18 deletions
diff --git a/c/src/exec/rtems/include/rtems/rtems/timer.h b/c/src/exec/rtems/include/rtems/rtems/timer.h
index a1f2434c34..6f5ea3a512 100644
--- a/c/src/exec/rtems/include/rtems/rtems/timer.h
+++ b/c/src/exec/rtems/include/rtems/rtems/timer.h
@@ -135,24 +135,6 @@ Thread _Timer_Server_body(
);
/*
- * _Timer_Server_reset
- *
- * DESCRIPTION:
- *
- * This routine resets the timers which determine when the Timer Server
- * will wake up next to service task-based timers.
- */
-
-typedef enum {
- TIMER_SERVER_RESET_TICKS,
- TIMER_SERVER_RESET_SECONDS
-} Timer_Server_reset_mode;
-
-void _Timer_Server_reset(
- Timer_Server_reset_mode reset_mode
-);
-
-/*
* rtems_timer_create
*
* DESCRIPTION:
@@ -339,6 +321,39 @@ rtems_status_code rtems_timer_get_information(
rtems_timer_information *the_info
);
+/*
+ * Macros and routines that expose the mechanisms required to service
+ * the Timer Server timer. These stop the timer, synchronize it with
+ * the current time, and restart it.
+ */
+
+extern Watchdog_Control _Timer_Seconds_timer;
+
+#define _Timer_Server_stop_ticks_timer() \
+ _Watchdog_Remove( &_Timer_Server->Timer )
+
+#define _Timer_Server_stop_seconds_timer() \
+ _Watchdog_Remove( &_Timer_Seconds_timer );
+
+void _Timer_Server_process_ticks_chain(void);
+void _Timer_Server_process_seconds_chain(void);
+
+#define _Timer_Server_reset_ticks_timer() \
+ do { \
+ if ( !_Chain_Is_empty( &_Timer_Ticks_chain ) ) { \
+ _Watchdog_Insert_ticks( &_Timer_Server->Timer, \
+ ((Watchdog_Control *)_Timer_Ticks_chain.first)->delta_interval ); \
+ } \
+ } while (0)
+
+#define _Timer_Server_reset_seconds_timer() \
+ do { \
+ if ( !_Chain_Is_empty( &_Timer_Seconds_chain ) ) { \
+ _Watchdog_Insert_seconds( &_Timer_Seconds_timer, \
+ ((Watchdog_Control *)_Timer_Seconds_chain.first)->delta_interval ); \
+ } \
+ } while (0)
+
#ifndef __RTEMS_APPLICATION__
#include <rtems/rtems/timer.inl>
#endif