summaryrefslogtreecommitdiffstats
path: root/cpukit/score
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/score
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/score')
-rw-r--r--cpukit/score/include/rtems/score/mrspimpl.h2
-rw-r--r--cpukit/score/include/rtems/score/watchdogimpl.h18
-rw-r--r--cpukit/score/src/threadqenqueue.c2
-rw-r--r--cpukit/score/src/threadrestart.c4
-rw-r--r--cpukit/score/src/watchdogremove.c1
-rw-r--r--cpukit/score/src/watchdogtickle.c2
6 files changed, 23 insertions, 6 deletions
diff --git a/cpukit/score/include/rtems/score/mrspimpl.h b/cpukit/score/include/rtems/score/mrspimpl.h
index c40f41f716..07f78ce7e9 100644
--- a/cpukit/score/include/rtems/score/mrspimpl.h
+++ b/cpukit/score/include/rtems/score/mrspimpl.h
@@ -216,7 +216,7 @@ RTEMS_INLINE_ROUTINE MRSP_Status _MRSP_Wait_for_ownership(
_Thread_Set_life_protection( initial_life_protection );
if ( timeout > 0 ) {
- _Watchdog_Remove( &executing->Timer );
+ _Watchdog_Remove_ticks( &executing->Timer );
}
return status;
diff --git a/cpukit/score/include/rtems/score/watchdogimpl.h b/cpukit/score/include/rtems/score/watchdogimpl.h
index e548e7025c..ddd1ca4d1b 100644
--- a/cpukit/score/include/rtems/score/watchdogimpl.h
+++ b/cpukit/score/include/rtems/score/watchdogimpl.h
@@ -99,10 +99,12 @@ void _Watchdog_Handler_initialization( void );
* This routine removes @a the_watchdog from the watchdog chain on which
* it resides and returns the state @a the_watchdog timer was in.
*
+ * @param[in] header The watchdog chain.
* @param[in] the_watchdog will be removed
* @retval the state in which @a the_watchdog was in when removed
*/
Watchdog_States _Watchdog_Remove (
+ Watchdog_Header *header,
Watchdog_Control *the_watchdog
);
@@ -306,6 +308,20 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Insert_seconds(
}
+RTEMS_INLINE_ROUTINE Watchdog_States _Watchdog_Remove_ticks(
+ Watchdog_Control *the_watchdog
+)
+{
+ return _Watchdog_Remove( &_Watchdog_Ticks_header, the_watchdog );
+}
+
+RTEMS_INLINE_ROUTINE Watchdog_States _Watchdog_Remove_seconds(
+ Watchdog_Control *the_watchdog
+)
+{
+ return _Watchdog_Remove( &_Watchdog_Seconds_header, the_watchdog );
+}
+
/**
* This routine resets THE_WATCHDOG timer to its state at INSERT
* time. This routine is valid only on interval watchdog timers
@@ -318,7 +334,7 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Reset_ticks(
)
{
- (void) _Watchdog_Remove( the_watchdog );
+ _Watchdog_Remove_ticks( the_watchdog );
_Watchdog_Insert( &_Watchdog_Ticks_header, the_watchdog );
diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c
index 5f94ec99c9..590865d8dd 100644
--- a/cpukit/score/src/threadqenqueue.c
+++ b/cpukit/score/src/threadqenqueue.c
@@ -66,7 +66,7 @@ static void _Thread_blocking_operation_Finalize(
if ( _Watchdog_Is_active( &the_thread->Timer ) ) {
_Watchdog_Deactivate( &the_thread->Timer );
_Thread_queue_Release( lock_context );
- (void) _Watchdog_Remove( &the_thread->Timer );
+ _Watchdog_Remove_ticks( &the_thread->Timer );
} else
_Thread_queue_Release( lock_context );
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c
index e759b5b42b..8dea518e10 100644
--- a/cpukit/score/src/threadrestart.c
+++ b/cpukit/score/src/threadrestart.c
@@ -62,7 +62,7 @@ static void _Thread_Make_zombie( Thread_Control *the_thread )
_Thread_Set_state( the_thread, STATES_ZOMBIE );
_Thread_queue_Extract_with_proxy( the_thread );
- _Watchdog_Remove( &the_thread->Timer );
+ _Watchdog_Remove_ticks( &the_thread->Timer );
_ISR_lock_ISR_disable_and_acquire( &zombies->Lock, &lock_context );
_Chain_Append_unprotected( &zombies->Chain, &the_thread->Object.Node );
@@ -235,7 +235,7 @@ static void _Thread_Start_life_change(
_Thread_Set_state( the_thread, STATES_RESTARTING );
_Thread_queue_Extract_with_proxy( the_thread );
- _Watchdog_Remove( &the_thread->Timer );
+ _Watchdog_Remove_ticks( &the_thread->Timer );
_Scheduler_Set_priority_if_higher( scheduler, the_thread, priority );
_Thread_Add_post_switch_action( the_thread, &the_thread->Life.Action );
_Thread_Ready( the_thread );
diff --git a/cpukit/score/src/watchdogremove.c b/cpukit/score/src/watchdogremove.c
index 34d97b0eae..d689e3cfc9 100644
--- a/cpukit/score/src/watchdogremove.c
+++ b/cpukit/score/src/watchdogremove.c
@@ -23,6 +23,7 @@
#include <rtems/score/watchdogimpl.h>
Watchdog_States _Watchdog_Remove(
+ Watchdog_Header *header,
Watchdog_Control *the_watchdog
)
{
diff --git a/cpukit/score/src/watchdogtickle.c b/cpukit/score/src/watchdogtickle.c
index 8c1a3a74b9..5b2f2582fc 100644
--- a/cpukit/score/src/watchdogtickle.c
+++ b/cpukit/score/src/watchdogtickle.c
@@ -74,7 +74,7 @@ void _Watchdog_Tickle(
}
do {
- watchdog_state = _Watchdog_Remove( the_watchdog );
+ watchdog_state = _Watchdog_Remove( header, the_watchdog );
_ISR_Enable( level );