From a382010c62455df73552eb5f0baa1faebe9702c7 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 10 Apr 2015 15:31:31 +0200 Subject: 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. --- cpukit/score/src/watchdoginsert.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'cpukit/score/src/watchdoginsert.c') 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 ); } -- cgit v1.2.3