diff options
Diffstat (limited to 'cpukit/score/src/watchdogadjust.c')
-rw-r--r-- | cpukit/score/src/watchdogadjust.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cpukit/score/src/watchdogadjust.c b/cpukit/score/src/watchdogadjust.c index 6926743f32..73b85a7eb4 100644 --- a/cpukit/score/src/watchdogadjust.c +++ b/cpukit/score/src/watchdogadjust.c @@ -37,6 +37,19 @@ void _Watchdog_Adjust( Watchdog_Interval units ) { + ISR_Level level; + + _ISR_Disable( level ); + + /* + * NOTE: It is safe NOT to make 'header' a pointer + * to volatile data (contrast this with watchdoginsert.c) + * because we call _Watchdog_Tickle() below and + * hence the compiler must not assume *header to remain + * unmodified across that call. + * + * Till Straumann, 7/2003 + */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { case WATCHDOG_BACKWARD: @@ -50,7 +63,13 @@ void _Watchdog_Adjust( } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; + + _ISR_Enable( level ); + _Watchdog_Tickle( header ); + + _ISR_Disable( level ); + if ( _Chain_Is_empty( header ) ) break; } @@ -58,5 +77,8 @@ void _Watchdog_Adjust( break; } } + + _ISR_Enable( level ); + } |