diff options
Diffstat (limited to 'cpukit/score/include/rtems/score/watchdogimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/watchdogimpl.h | 58 |
1 files changed, 42 insertions, 16 deletions
diff --git a/cpukit/score/include/rtems/score/watchdogimpl.h b/cpukit/score/include/rtems/score/watchdogimpl.h index f52b55d83c..304392b46c 100644 --- a/cpukit/score/include/rtems/score/watchdogimpl.h +++ b/cpukit/score/include/rtems/score/watchdogimpl.h @@ -46,6 +46,28 @@ extern "C" { } /** + * @brief Iterator item to synchronize concurrent insert, remove and tickle + * operations. + */ +typedef struct { + /** + * @brief A node for a Watchdog_Header::Iterators chain. + */ + Chain_Node Node; + + /** + * @brief The current delta interval of the new watchdog to insert. + */ + Watchdog_Interval delta_interval; + + /** + * @brief The current watchdog of the chain on the way to insert the new + * watchdog. + */ + Chain_Node *current; +} Watchdog_Iterator; + +/** * @brief Watchdog header. */ typedef struct { @@ -58,23 +80,15 @@ typedef struct { * @brief The chain of active or transient watchdogs. */ Chain_Control Watchdogs; -} Watchdog_Header; - -/** - * @brief Watchdog synchronization level. - * - * This used for synchronization purposes - * during an insert on a watchdog delta chain. - */ -SCORE_EXTERN volatile uint32_t _Watchdog_Sync_level; -/** - * @brief Watchdog synchronization count. - * - * This used for synchronization purposes - * during an insert on a watchdog delta chain. - */ -SCORE_EXTERN volatile uint32_t _Watchdog_Sync_count; + /** + * @brief Currently active iterators. + * + * The iterators are registered in _Watchdog_Insert() and updated in case the + * watchdog chain changes. + */ + Chain_Control Iterators; +} Watchdog_Header; /** * @brief Watchdog chain which is managed at ticks. @@ -139,6 +153,16 @@ Watchdog_States _Watchdog_Remove ( ); /** + * @brief Actually removes an WATCHDOG_ACTIVE or WATCHDOG_REMOVE_IT watchdog. + * + * @see _Watchdog_Remove() and _Watchdog_Tickle(). + */ +void _Watchdog_Remove_it( + Watchdog_Header *header, + Watchdog_Control *the_watchdog +); + +/** * @brief Adjusts the header watchdog chain in the backward direction for * units ticks. * @@ -437,7 +461,9 @@ RTEMS_INLINE_ROUTINE void _Watchdog_Header_initialize( Watchdog_Header *header ) { + _ISR_lock_Initialize( &header->Lock, "Watchdog" ); _Chain_Initialize_empty( &header->Watchdogs ); + _Chain_Initialize_empty( &header->Iterators ); } /** @} */ |