summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/watchdogadjust.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/src/watchdogadjust.c')
-rw-r--r--cpukit/score/src/watchdogadjust.c41
1 files changed, 26 insertions, 15 deletions
diff --git a/cpukit/score/src/watchdogadjust.c b/cpukit/score/src/watchdogadjust.c
index 687f063482..32b5f7990e 100644
--- a/cpukit/score/src/watchdogadjust.c
+++ b/cpukit/score/src/watchdogadjust.c
@@ -19,34 +19,35 @@
#endif
#include <rtems/score/watchdogimpl.h>
-#include <rtems/score/chainimpl.h>
-#include <rtems/score/isrlevel.h>
-void _Watchdog_Adjust_backward(
+void _Watchdog_Adjust_backward_locked(
Watchdog_Header *header,
Watchdog_Interval units
)
{
- ISR_Level level;
-
- _ISR_Disable( level );
-
if ( !_Watchdog_Is_empty( header ) ) {
_Watchdog_First( header )->delta_interval += units;
}
-
- _ISR_Enable( level );
}
-void _Watchdog_Adjust_forward(
+void _Watchdog_Adjust_backward(
Watchdog_Header *header,
Watchdog_Interval units
)
{
- ISR_Level level;
+ ISR_lock_Context lock_context;
- _ISR_Disable( level );
+ _Watchdog_Acquire( header, &lock_context );
+ _Watchdog_Adjust_backward_locked( header, units );
+ _Watchdog_Release( header, &lock_context );
+}
+void _Watchdog_Adjust_forward_locked(
+ Watchdog_Header *header,
+ Watchdog_Interval units,
+ ISR_lock_Context *lock_context
+)
+{
while ( !_Watchdog_Is_empty( header ) && units > 0 ) {
Watchdog_Control *first = _Watchdog_First( header );
@@ -57,13 +58,23 @@ void _Watchdog_Adjust_forward(
units -= first->delta_interval;
first->delta_interval = 1;
- _ISR_Enable( level );
+ _Watchdog_Release( header, lock_context );
_Watchdog_Tickle( header );
- _ISR_Disable( level );
+ _Watchdog_Acquire( header, lock_context );
}
}
+}
+
+void _Watchdog_Adjust_forward(
+ Watchdog_Header *header,
+ Watchdog_Interval units
+)
+{
+ ISR_lock_Context lock_context;
- _ISR_Enable( level );
+ _Watchdog_Acquire( header, &lock_context );
+ _Watchdog_Adjust_forward_locked( header, units, &lock_context );
+ _Watchdog_Release( header, &lock_context );
}