summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/timerserver.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-15 11:26:46 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-19 12:00:42 +0200
commit290309014c15b4eceee9f77c90eb3c81cc223f4b (patch)
tree4b9ae28399c95783e9ac5847d6a7709f980d62ad /cpukit/rtems/src/timerserver.c
parentscore: Optimize _Thread_queue_Compare_priority() (diff)
downloadrtems-290309014c15b4eceee9f77c90eb3c81cc223f4b.tar.bz2
score: Add header to _Watchdog_Remove()
Add watchdog header parameter to _Watchdog_Remove() to be in line with the other operations. Add _Watchdog_Remove_ticks() and _Watchdog_Remove_seconds() for convenience. Update #2307.
Diffstat (limited to 'cpukit/rtems/src/timerserver.c')
-rw-r--r--cpukit/rtems/src/timerserver.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/cpukit/rtems/src/timerserver.c b/cpukit/rtems/src/timerserver.c
index 25191e43d7..15cbdfd59f 100644
--- a/cpukit/rtems/src/timerserver.c
+++ b/cpukit/rtems/src/timerserver.c
@@ -38,7 +38,7 @@ static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
- _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
+ _Watchdog_Remove_ticks( &ts->Interval_watchdogs.System_watchdog );
}
static void _Timer_server_Reset_interval_system_watchdog(
@@ -71,7 +71,7 @@ static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
- _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
+ _Watchdog_Remove_seconds( &ts->TOD_watchdogs.System_watchdog );
}
static void _Timer_server_Reset_tod_system_watchdog(
@@ -210,6 +210,18 @@ static void _Timer_server_Insert_timer_and_make_snapshot(
_Thread_Enable_dispatch();
}
+static void _Timer_server_Cancel_method(
+ Timer_server_Control *ts,
+ Timer_Control *timer
+)
+{
+ if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
+ _Watchdog_Remove( &ts->Interval_watchdogs.Header, &timer->Ticker );
+ } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
+ _Watchdog_Remove( &ts->TOD_watchdogs.Header, &timer->Ticker );
+ }
+}
+
static void _Timer_server_Schedule_operation_method(
Timer_server_Control *ts,
Timer_Control *timer
@@ -563,9 +575,10 @@ rtems_status_code rtems_timer_initiate_server(
);
/*
- * Initialize the pointer to the timer schedule method so applications that
+ * Initialize the pointer to the timer server methods so applications that
* do not use the Timer Server do not have to pull it in.
*/
+ ts->cancel = _Timer_server_Cancel_method;
ts->schedule_operation = _Timer_server_Schedule_operation_method;
ts->Interval_watchdogs.last_snapshot = _Watchdog_Ticks_since_boot;