summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/watchdoginsert.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-10 15:31:31 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-19 12:00:43 +0200
commita382010c62455df73552eb5f0baa1faebe9702c7 (patch)
tree32764a1f1ce7aec8cd5dce3bf4a363ec4c2de179 /cpukit/score/src/watchdoginsert.c
parentscore: Move _Watchdog_Tickle() (diff)
downloadrtems-a382010c62455df73552eb5f0baa1faebe9702c7.tar.bz2
score: New timer server implementation
Use mostly the standard watchdog operations. Use a system event for synchronization. This implementation is simpler and offers better SMP performance. Close #2131.
Diffstat (limited to 'cpukit/score/src/watchdoginsert.c')
-rw-r--r--cpukit/score/src/watchdoginsert.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/cpukit/score/src/watchdoginsert.c b/cpukit/score/src/watchdoginsert.c
index 6d2df8222f..6b81c7b872 100644
--- a/cpukit/score/src/watchdoginsert.c
+++ b/cpukit/score/src/watchdoginsert.c
@@ -47,15 +47,12 @@ static void _Watchdog_Insert_fixup(
}
}
-void _Watchdog_Insert(
+void _Watchdog_Insert_locked(
Watchdog_Header *header,
- Watchdog_Control *the_watchdog
+ Watchdog_Control *the_watchdog,
+ ISR_lock_Context *lock_context
)
{
- ISR_lock_Context lock_context;
-
- _Watchdog_Acquire( header, &lock_context );
-
if ( the_watchdog->state == WATCHDOG_INACTIVE ) {
Watchdog_Iterator iterator;
Chain_Node *current;
@@ -86,7 +83,7 @@ void _Watchdog_Insert(
iterator.delta_interval = delta - delta_next;
iterator.current = next;
- _Watchdog_Flash( header, &lock_context );
+ _Watchdog_Flash( header, lock_context );
if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) {
goto abort_insert;
@@ -105,6 +102,16 @@ abort_insert:
_Chain_Extract_unprotected( &iterator.Node );
}
+}
+void _Watchdog_Insert(
+ Watchdog_Header *header,
+ Watchdog_Control *the_watchdog
+)
+{
+ ISR_lock_Context lock_context;
+
+ _Watchdog_Acquire( header, &lock_context );
+ _Watchdog_Insert_locked( header, the_watchdog, &lock_context );
_Watchdog_Release( header, &lock_context );
}