diff options
Diffstat (limited to 'cpukit/score/include/rtems/score/watchdogimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/watchdogimpl.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/watchdogimpl.h b/cpukit/score/include/rtems/score/watchdogimpl.h index ddd1ca4d1b..f52b55d83c 100644 --- a/cpukit/score/include/rtems/score/watchdogimpl.h +++ b/cpukit/score/include/rtems/score/watchdogimpl.h @@ -21,6 +21,7 @@ #include <rtems/score/watchdog.h> #include <rtems/score/chainimpl.h> +#include <rtems/score/isrlock.h> #ifdef __cplusplus extern "C" { @@ -49,6 +50,11 @@ extern "C" { */ typedef struct { /** + * @brief ISR lock to protect this watchdog chain. + */ + ISR_LOCK_MEMBER( Lock ) + + /** * @brief The chain of active or transient watchdogs. */ Chain_Control Watchdogs; @@ -84,6 +90,30 @@ SCORE_EXTERN Watchdog_Header _Watchdog_Ticks_header; */ SCORE_EXTERN Watchdog_Header _Watchdog_Seconds_header; +RTEMS_INLINE_ROUTINE void _Watchdog_Acquire( + Watchdog_Header *header, + ISR_lock_Context *lock_context +) +{ + _ISR_lock_ISR_disable_and_acquire( &header->Lock, lock_context ); +} + +RTEMS_INLINE_ROUTINE void _Watchdog_Release( + Watchdog_Header *header, + ISR_lock_Context *lock_context +) +{ + _ISR_lock_Release_and_ISR_enable( &header->Lock, lock_context ); +} + +RTEMS_INLINE_ROUTINE void _Watchdog_Flash( + Watchdog_Header *header, + ISR_lock_Context *lock_context +) +{ + _ISR_lock_Flash( &header->Lock, lock_context ); +} + /** * @brief Initialize the watchdog handler. * |