From 03b900d3ed120ea919ea3eded7edbece3488cff3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 18 Feb 2016 08:36:26 +0100 Subject: score: Replace watchdog handler implementation Use a red-black tree instead of delta chains. Close #2344. Update #2554. Update #2555. Close #2606. --- cpukit/rtems/src/timerfireafter.c | 64 +++++---------------------------------- 1 file changed, 8 insertions(+), 56 deletions(-) (limited to 'cpukit/rtems/src/timerfireafter.c') diff --git a/cpukit/rtems/src/timerfireafter.c b/cpukit/rtems/src/timerfireafter.c index 84cf46bc37..82bd878cec 100644 --- a/cpukit/rtems/src/timerfireafter.c +++ b/cpukit/rtems/src/timerfireafter.c @@ -18,12 +18,7 @@ #include "config.h" #endif -#include -#include -#include -#include #include -#include rtems_status_code rtems_timer_fire_after( rtems_id id, @@ -32,55 +27,12 @@ rtems_status_code rtems_timer_fire_after( void *user_data ) { - Timer_Control *the_timer; - Objects_Locations location; - ISR_Level level; - - if ( ticks == 0 ) - return RTEMS_INVALID_NUMBER; - - if ( !routine ) - return RTEMS_INVALID_ADDRESS; - - the_timer = _Timer_Get( id, &location ); - switch ( location ) { - - case OBJECTS_LOCAL: - _Timer_Cancel( the_timer ); - - _ISR_Disable( level ); - - /* - * Check to see if the watchdog has just been inserted by a - * higher priority interrupt. If so, abandon this insert. - */ - - if ( the_timer->Ticker.state != WATCHDOG_INACTIVE ) { - _ISR_Enable( level ); - _Objects_Put( &the_timer->Object ); - return RTEMS_SUCCESSFUL; - } - - /* - * OK. Now we now the timer was not rescheduled by an interrupt - * so we can atomically initialize it as in use. - */ - - the_timer->the_class = TIMER_INTERVAL; - _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); - _ISR_Enable( level ); - - - _Watchdog_Insert_ticks( &the_timer->Ticker, ticks ); - _Objects_Put( &the_timer->Object ); - return RTEMS_SUCCESSFUL; - -#if defined(RTEMS_MULTIPROCESSING) - case OBJECTS_REMOTE: /* should never return this */ -#endif - case OBJECTS_ERROR: - break; - } - - return RTEMS_INVALID_ID; + return _Timer_Fire_after( + id, + ticks, + routine, + user_data, + TIMER_INTERVAL, + _Timer_Routine_adaptor + ); } -- cgit v1.2.3