From 8d0b7d96439c8dcce6e3c1ab7ca732402f92a2c4 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 1 Dec 1995 22:03:55 +0000 Subject: Insert mode argument to _Watchdog_Insert removed. Now are watchdog timers are automatically activated upon insertion. --- cpukit/posix/src/psignal.c | 6 +----- cpukit/rtems/src/event.c | 6 +----- cpukit/rtems/src/ratemon.c | 6 ++---- cpukit/rtems/src/rtemstimer.c | 9 +++++---- cpukit/rtems/src/tasks.c | 9 +++++---- cpukit/score/include/rtems/score/watchdog.h | 21 +++------------------ cpukit/score/inline/rtems/score/tod.inl | 6 +----- cpukit/score/inline/rtems/score/watchdog.inl | 16 +++++----------- cpukit/score/src/coretod.c | 3 +-- cpukit/score/src/threadq.c | 6 +----- cpukit/score/src/watchdog.c | 12 +++++------- 11 files changed, 30 insertions(+), 70 deletions(-) (limited to 'cpukit') diff --git a/cpukit/posix/src/psignal.c b/cpukit/posix/src/psignal.c index fb6b410618..4682db131b 100644 --- a/cpukit/posix/src/psignal.c +++ b/cpukit/posix/src/psignal.c @@ -252,11 +252,7 @@ unsigned int sleep( _Thread_Executing->Object.id, NULL ); - _Watchdog_Insert_seconds( - &_Thread_Executing->Timer, - seconds, - WATCHDOG_ACTIVATE_NOW - ); + _Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds ); _Thread_Enable_dispatch(); return 0; /* XXX should account for signal */ } diff --git a/cpukit/rtems/src/event.c b/cpukit/rtems/src/event.c index d388de0b81..9bea949647 100644 --- a/cpukit/rtems/src/event.c +++ b/cpukit/rtems/src/event.c @@ -186,11 +186,7 @@ void _Event_Seize( executing->Object.id, NULL ); - _Watchdog_Insert_ticks( - &executing->Timer, - ticks, - WATCHDOG_ACTIVATE_NOW - ); + _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); diff --git a/cpukit/rtems/src/ratemon.c b/cpukit/rtems/src/ratemon.c index e12a590af4..9733620e06 100644 --- a/cpukit/rtems/src/ratemon.c +++ b/cpukit/rtems/src/ratemon.c @@ -277,8 +277,7 @@ rtems_status_code rtems_rate_monotonic_period( id, NULL ); - _Watchdog_Insert_ticks( - &the_period->Timer, length, WATCHDOG_ACTIVATE_NOW ); + _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; @@ -292,8 +291,7 @@ rtems_status_code rtems_rate_monotonic_period( /* has expired -- fall into next case */ case RATE_MONOTONIC_EXPIRED: the_period->state = RATE_MONOTONIC_ACTIVE; - _Watchdog_Insert_ticks( - &the_period->Timer, length, WATCHDOG_ACTIVATE_NOW ); + _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; } diff --git a/cpukit/rtems/src/rtemstimer.c b/cpukit/rtems/src/rtemstimer.c index db37473500..6c3005ffbe 100644 --- a/cpukit/rtems/src/rtemstimer.c +++ b/cpukit/rtems/src/rtemstimer.c @@ -242,8 +242,7 @@ rtems_status_code rtems_timer_fire_after( (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_INTERVAL; _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); - _Watchdog_Insert_ticks( &the_timer->Ticker, - ticks, WATCHDOG_ACTIVATE_NOW ); + _Watchdog_Insert_ticks( &the_timer->Ticker, ticks ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } @@ -298,8 +297,10 @@ rtems_status_code rtems_timer_fire_when( (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY; _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); - _Watchdog_Insert_seconds( &the_timer->Ticker, - seconds - _TOD_Seconds_since_epoch, WATCHDOG_ACTIVATE_NOW ); + _Watchdog_Insert_seconds( + &the_timer->Ticker, + seconds - _TOD_Seconds_since_epoch + ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c index 1e893b770b..99ec426dd6 100644 --- a/cpukit/rtems/src/tasks.c +++ b/cpukit/rtems/src/tasks.c @@ -987,8 +987,7 @@ rtems_status_code rtems_task_wake_after( _Thread_Executing->Object.id, NULL ); - _Watchdog_Insert_ticks( &_Thread_Executing->Timer, - ticks, WATCHDOG_ACTIVATE_NOW ); + _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks ); _Thread_Enable_dispatch(); } return RTEMS_SUCCESSFUL; @@ -1036,8 +1035,10 @@ rtems_time_of_day *time_buffer _Thread_Executing->Object.id, NULL ); - _Watchdog_Insert_seconds( &_Thread_Executing->Timer, - seconds - _TOD_Seconds_since_epoch, WATCHDOG_ACTIVATE_NOW ); + _Watchdog_Insert_seconds( + &_Thread_Executing->Timer, + seconds - _TOD_Seconds_since_epoch + ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } diff --git a/cpukit/score/include/rtems/score/watchdog.h b/cpukit/score/include/rtems/score/watchdog.h index de2f332e22..5ac7eee641 100644 --- a/cpukit/score/include/rtems/score/watchdog.h +++ b/cpukit/score/include/rtems/score/watchdog.h @@ -48,18 +48,6 @@ typedef Watchdog_Service_routine ( *Watchdog_Service_routine_entry )( #define WATCHDOG_NO_TIMEOUT 0 -/* - * The following enumerated type details the modes in which the - * Watchdog_Insert routine may operate. The watchdog may be - * activated automatically at insert time or later, explicitly - * by the caller. - */ - -typedef enum { - WATCHDOG_ACTIVATE_NOW, /* activate watchdog as part of insertion */ - WATCHDOG_NO_ACTIVATE /* watchdog will be explicitly activated */ -} Watchdog_Insert_modes; - /* * The following enumerated type lists the states in which a * watchdog timer may be at any given time. @@ -238,8 +226,7 @@ STATIC INLINE void _Watchdog_Tickle_seconds( void ); STATIC INLINE void _Watchdog_Insert_ticks( Watchdog_Control *the_watchdog, - Watchdog_Interval units, - Watchdog_Insert_modes insert_mode + Watchdog_Interval units ); /* @@ -256,8 +243,7 @@ STATIC INLINE void _Watchdog_Insert_ticks( STATIC INLINE void _Watchdog_Insert_seconds( Watchdog_Control *the_watchdog, - Watchdog_Interval units, - Watchdog_Insert_modes insert_mode + Watchdog_Interval units ); /* @@ -391,8 +377,7 @@ void _Watchdog_Adjust ( void _Watchdog_Insert ( Chain_Control *header, - Watchdog_Control *the_watchdog, - Watchdog_Insert_modes insert_mode + Watchdog_Control *the_watchdog ); /* diff --git a/cpukit/score/inline/rtems/score/tod.inl b/cpukit/score/inline/rtems/score/tod.inl index d2e26e2f2a..dce8aca426 100644 --- a/cpukit/score/inline/rtems/score/tod.inl +++ b/cpukit/score/inline/rtems/score/tod.inl @@ -61,11 +61,7 @@ STATIC INLINE void _TOD_Activate( Watchdog_Interval ticks ) { - _Watchdog_Insert_ticks( - &_TOD_Seconds_watchdog, - ticks, - WATCHDOG_ACTIVATE_NOW - ); + _Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, ticks ); } #endif diff --git a/cpukit/score/inline/rtems/score/watchdog.inl b/cpukit/score/inline/rtems/score/watchdog.inl index bb7edb82ed..ae3717e102 100644 --- a/cpukit/score/inline/rtems/score/watchdog.inl +++ b/cpukit/score/inline/rtems/score/watchdog.inl @@ -115,14 +115,13 @@ STATIC INLINE void _Watchdog_Tickle_seconds( void ) STATIC INLINE void _Watchdog_Insert_ticks( Watchdog_Control *the_watchdog, - Watchdog_Interval units, - Watchdog_Insert_modes insert_mode + Watchdog_Interval units ) { the_watchdog->initial = units; - _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog, insert_mode ); + _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); } @@ -134,14 +133,13 @@ STATIC INLINE void _Watchdog_Insert_ticks( STATIC INLINE void _Watchdog_Insert_seconds( Watchdog_Control *the_watchdog, - Watchdog_Interval units, - Watchdog_Insert_modes insert_mode + Watchdog_Interval units ) { the_watchdog->initial = units; - _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog, insert_mode ); + _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); } @@ -190,11 +188,7 @@ STATIC INLINE void _Watchdog_Reset( (void) _Watchdog_Remove( the_watchdog ); - _Watchdog_Insert( - &_Watchdog_Ticks_chain, - the_watchdog, - WATCHDOG_ACTIVATE_NOW - ); + _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); } diff --git a/cpukit/score/src/coretod.c b/cpukit/score/src/coretod.c index 06f30654cc..1a11034ceb 100644 --- a/cpukit/score/src/coretod.c +++ b/cpukit/score/src/coretod.c @@ -231,6 +231,5 @@ void _TOD_Tickle( } _Watchdog_Tickle_seconds(); - _Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, _TOD_Ticks_per_second, - WATCHDOG_ACTIVATE_NOW ); + _Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, _TOD_Ticks_per_second ); } diff --git a/cpukit/score/src/threadq.c b/cpukit/score/src/threadq.c index 87e7903df4..f388959268 100644 --- a/cpukit/score/src/threadq.c +++ b/cpukit/score/src/threadq.c @@ -109,11 +109,7 @@ void _Thread_queue_Enqueue( NULL ); - _Watchdog_Insert_ticks( - &the_thread->Timer, - timeout, - WATCHDOG_ACTIVATE_NOW - ); + _Watchdog_Insert_ticks( &the_thread->Timer, timeout ); } switch( the_thread_queue->discipline ) { diff --git a/cpukit/score/src/watchdog.c b/cpukit/score/src/watchdog.c index b7963f5408..0f72bd3d5c 100644 --- a/cpukit/score/src/watchdog.c +++ b/cpukit/score/src/watchdog.c @@ -140,8 +140,7 @@ void _Watchdog_Adjust( void _Watchdog_Insert( Chain_Control *header, - Watchdog_Control *the_watchdog, - Watchdog_Insert_modes insert_mode + Watchdog_Control *the_watchdog ) { ISR_Level level; @@ -174,10 +173,10 @@ restart: delta_interval -= after->delta_interval; /* - * If you experience problems comment out the _ISR_Flash line. This - * (3.2.0) is the first release with this critical section redesigned. + * If you experience problems comment out the _ISR_Flash line. + * 3.2.0 was the first release with this critical section redesigned. * Under certain circumstances, the PREVIOUS critical section algorithm - * used around this flash point allows interrupts to execute + * used around this flash point allowed interrupts to execute * which violated the design assumptions. The critical section * mechanism used here WAS redesigned to address this. */ @@ -195,8 +194,7 @@ restart: } } - if ( insert_mode == WATCHDOG_ACTIVATE_NOW ) - _Watchdog_Activate( the_watchdog ); + _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; -- cgit v1.2.3