RTEMS CPU Kit with SuperCore
4.11.3
|
This handler encapsulates functionality related to the scheduling of watchdog functions to be called at specific times in the future. More...
![]() |
Files | |
file | watchdog.c |
Watchdog Handler Initialization. | |
file | watchdogadjust.c |
Watchdog Adjust. | |
file | watchdoginsert.c |
Watchdog Insert. | |
file | watchdogremove.c |
Remove Watchdog from List. | |
file | watchdogtickssinceboot.c |
Watchdog Ticks Since Boot. | |
Data Structures | |
struct | Watchdog_Control |
The control block used to manage each watchdog timer. More... | |
struct | Watchdog_Iterator |
Iterator item to synchronize concurrent insert, remove and tickle operations. More... | |
struct | Watchdog_Header |
Watchdog header. More... | |
Macros | |
#define | WATCHDOG_NO_TIMEOUT 0 |
The constant for indefinite wait. More... | |
#define | WATCHDOG_INITIALIZER(routine, id, user_data) |
Watchdog initializer for static initialization. More... | |
Typedefs | |
typedef uint32_t | Watchdog_Interval |
Type is used to specify the length of intervals. More... | |
typedef void | Watchdog_Service_routine |
Return type from a Watchdog Service Routine. More... | |
typedef Watchdog_Service_routine(* | Watchdog_Service_routine_entry) (Objects_Id, void *) |
Pointer to a watchdog service routine. More... | |
Enumerations | |
enum | Watchdog_States { WATCHDOG_INACTIVE, WATCHDOG_BEING_INSERTED, WATCHDOG_ACTIVE } |
Set of the states which a watchdog timer may be at any given time. More... | |
Functions | |
RTEMS_INLINE_ROUTINE void | _Watchdog_Acquire (Watchdog_Header *header, ISR_lock_Context *lock_context) |
RTEMS_INLINE_ROUTINE void | _Watchdog_Release (Watchdog_Header *header, ISR_lock_Context *lock_context) |
RTEMS_INLINE_ROUTINE void | _Watchdog_Flash (Watchdog_Header *header, ISR_lock_Context *lock_context) |
void | _Watchdog_Handler_initialization (void) |
Initialize the watchdog handler. More... | |
void | _Watchdog_Tick (void) |
Triggers a watchdog tick. More... | |
Watchdog_States | _Watchdog_Remove (Watchdog_Header *header, Watchdog_Control *the_watchdog) |
Removes the_watchdog from the watchdog chain. More... | |
void | _Watchdog_Adjust_backward (Watchdog_Header *header, Watchdog_Interval units) |
Adjusts the header watchdog chain in the backward direction for units ticks. More... | |
void | _Watchdog_Adjust_backward_locked (Watchdog_Header *header, Watchdog_Interval units) |
Adjusts the watchdogs in backward direction in a locked context. More... | |
void | _Watchdog_Adjust_forward (Watchdog_Header *header, Watchdog_Interval units) |
Adjusts the header watchdog chain in the forward direction for units ticks. More... | |
void | _Watchdog_Adjust_forward_locked (Watchdog_Header *header, Watchdog_Interval units, ISR_lock_Context *lock_context) |
Adjusts the watchdogs in forward direction in a locked context. More... | |
void | _Watchdog_Insert (Watchdog_Header *header, Watchdog_Control *the_watchdog) |
Inserts the_watchdog into the header watchdog chain for a time of units. More... | |
void | _Watchdog_Insert_locked (Watchdog_Header *header, Watchdog_Control *the_watchdog, ISR_lock_Context *lock_context) |
Inserts the watchdog in a locked context. More... | |
void | _Watchdog_Tickle (Watchdog_Header *header) |
This routine is invoked at appropriate intervals to update the header watchdog chain. More... | |
RTEMS_INLINE_ROUTINE void | _Watchdog_Preinitialize (Watchdog_Control *the_watchdog) |
Pre-initializes a watchdog. More... | |
RTEMS_INLINE_ROUTINE void | _Watchdog_Initialize (Watchdog_Control *the_watchdog, Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data) |
This routine initializes the specified watchdog. More... | |
RTEMS_INLINE_ROUTINE bool | _Watchdog_Is_active (Watchdog_Control *the_watchdog) |
This routine returns true if the watchdog timer is in the ACTIVE state, and false otherwise. | |
RTEMS_INLINE_ROUTINE void | _Watchdog_Activate (Watchdog_Control *the_watchdog) |
This routine activates THE_WATCHDOG timer which is already on a watchdog chain. | |
RTEMS_INLINE_ROUTINE void | _Watchdog_Tickle_ticks (void) |
This routine is invoked at each clock tick to update the ticks watchdog chain. | |
RTEMS_INLINE_ROUTINE void | _Watchdog_Tickle_seconds (void) |
This routine is invoked at each clock tick to update the seconds watchdog chain. | |
RTEMS_INLINE_ROUTINE void | _Watchdog_Insert_ticks (Watchdog_Control *the_watchdog, Watchdog_Interval units) |
This routine inserts THE_WATCHDOG into the ticks watchdog chain for a time of UNITS ticks. More... | |
RTEMS_INLINE_ROUTINE void | _Watchdog_Insert_seconds (Watchdog_Control *the_watchdog, Watchdog_Interval units) |
This routine inserts THE_WATCHDOG into the seconds watchdog chain for a time of UNITS seconds. More... | |
RTEMS_INLINE_ROUTINE Watchdog_States | _Watchdog_Remove_ticks (Watchdog_Control *the_watchdog) |
RTEMS_INLINE_ROUTINE Watchdog_States | _Watchdog_Remove_seconds (Watchdog_Control *the_watchdog) |
RTEMS_INLINE_ROUTINE void | _Watchdog_Reset_ticks (Watchdog_Control *the_watchdog) |
This routine resets THE_WATCHDOG timer to its state at INSERT time. More... | |
RTEMS_INLINE_ROUTINE Watchdog_Control * | _Watchdog_Next (Watchdog_Control *the_watchdog) |
This routine returns a pointer to the watchdog timer following THE_WATCHDOG on the watchdog chain. | |
RTEMS_INLINE_ROUTINE Watchdog_Control * | _Watchdog_Previous (Watchdog_Control *the_watchdog) |
This routine returns a pointer to the watchdog timer preceding THE_WATCHDOG on the watchdog chain. | |
RTEMS_INLINE_ROUTINE Watchdog_Control * | _Watchdog_First (Watchdog_Header *header) |
This routine returns a pointer to the first watchdog timer on the watchdog chain HEADER. | |
RTEMS_INLINE_ROUTINE Watchdog_Control * | _Watchdog_Last (Watchdog_Header *header) |
This routine returns a pointer to the last watchdog timer on the watchdog chain HEADER. | |
RTEMS_INLINE_ROUTINE bool | _Watchdog_Is_empty (const Watchdog_Header *header) |
RTEMS_INLINE_ROUTINE void | _Watchdog_Header_initialize (Watchdog_Header *header) |
Variables | |
volatile Watchdog_Interval | _Watchdog_Ticks_since_boot |
The watchdog ticks counter. More... | |
SCORE_EXTERN Watchdog_Header | _Watchdog_Ticks_header |
Watchdog chain which is managed at ticks. More... | |
SCORE_EXTERN Watchdog_Header | _Watchdog_Seconds_header |
Watchdog chain which is managed at second boundaries. More... | |
This handler encapsulates functionality related to the scheduling of watchdog functions to be called at specific times in the future.
#define WATCHDOG_INITIALIZER | ( | routine, | |
id, | |||
user_data | |||
) |
Watchdog initializer for static initialization.
#define WATCHDOG_NO_TIMEOUT 0 |
The constant for indefinite wait.
This is the constant for indefinite wait. It is actually an illegal interval.
Referenced by _MPCI_Receive_server(), and pthread_mutex_trylock().
typedef uint32_t Watchdog_Interval |
Type is used to specify the length of intervals.
This type is used to specify the length of intervals.
typedef void Watchdog_Service_routine |
Return type from a Watchdog Service Routine.
This type defines the return type from a Watchdog Service Routine.
typedef Watchdog_Service_routine( * Watchdog_Service_routine_entry) (Objects_Id, void *) |
Pointer to a watchdog service routine.
This type define a pointer to a watchdog service routine.
enum Watchdog_States |
Set of the states which a watchdog timer may be at any given time.
This enumerated type is the set of the states in which a watchdog timer may be at any given time.
void _Watchdog_Adjust_backward | ( | Watchdog_Header * | header, |
Watchdog_Interval | units | ||
) |
Adjusts the header watchdog chain in the backward direction for units ticks.
[in] | header | The watchdog chain. |
[in] | units | The units of ticks to adjust. |
void _Watchdog_Adjust_backward_locked | ( | Watchdog_Header * | header, |
Watchdog_Interval | units | ||
) |
Adjusts the watchdogs in backward direction in a locked context.
The caller must be the owner of the watchdog lock and will be the owner after the call.
[in] | header | The watchdog header. |
[in] | units | The units of ticks to adjust. |
void _Watchdog_Adjust_forward | ( | Watchdog_Header * | header, |
Watchdog_Interval | units | ||
) |
Adjusts the header watchdog chain in the forward direction for units ticks.
This may lead to several _Watchdog_Tickle() invocations.
[in] | header | The watchdog chain. |
[in] | units | The units of ticks to adjust. |
void _Watchdog_Adjust_forward_locked | ( | Watchdog_Header * | header, |
Watchdog_Interval | units, | ||
ISR_lock_Context * | lock_context | ||
) |
Adjusts the watchdogs in forward direction in a locked context.
The caller must be the owner of the watchdog lock and will be the owner after the call. This function may release and acquire the watchdog lock internally.
[in] | header | The watchdog header. |
[in] | units | The units of ticks to adjust. |
[in] | lock_context | The lock context. |
void _Watchdog_Handler_initialization | ( | void | ) |
Initialize the watchdog handler.
This routine initializes the watchdog handler. The watchdog synchronization flag is initialized and the watchdog chains are initialized and emptied.
References _Watchdog_Ticks_since_boot.
RTEMS_INLINE_ROUTINE void _Watchdog_Initialize | ( | Watchdog_Control * | the_watchdog, |
Watchdog_Service_routine_entry | routine, | ||
Objects_Id | id, | ||
void * | user_data | ||
) |
This routine initializes the specified watchdog.
The watchdog is made inactive, the watchdog id and handler routine are set to the specified values.
References _Assert, Watchdog_Control::id, Watchdog_Control::routine, Watchdog_Control::state, Watchdog_Control::user_data, and WATCHDOG_INACTIVE.
void _Watchdog_Insert | ( | Watchdog_Header * | header, |
Watchdog_Control * | the_watchdog | ||
) |
Inserts the_watchdog into the header watchdog chain for a time of units.
This routine inserts the_watchdog into the header watchdog chain for a time of units. Update the delta interval counters.
[in] | header | is the_watchdog list to insert the_watchdog on |
[in] | the_watchdog | is the watchdog to insert |
Referenced by _Watchdog_Insert_seconds(), and _Watchdog_Insert_ticks().
void _Watchdog_Insert_locked | ( | Watchdog_Header * | header, |
Watchdog_Control * | the_watchdog, | ||
ISR_lock_Context * | lock_context | ||
) |
Inserts the watchdog in a locked context.
The caller must be the owner of the watchdog lock and will be the owner after the call. This function may release and acquire the watchdog lock internally.
[in] | header | The watchdog header. |
[in] | the_watchdog | The watchdog. |
[in] | lock_context | The lock context. |
References Watchdog_Control::state, and WATCHDOG_INACTIVE.
RTEMS_INLINE_ROUTINE void _Watchdog_Insert_seconds | ( | Watchdog_Control * | the_watchdog, |
Watchdog_Interval | units | ||
) |
This routine inserts THE_WATCHDOG into the seconds watchdog chain for a time of UNITS seconds.
The INSERT_MODE indicates whether THE_WATCHDOG is to be activated automatically or later, explicitly by the caller.
References _Watchdog_Insert(), _Watchdog_Seconds_header, Watchdog_Control::initial, and RTEMS_INLINE_ROUTINE.
RTEMS_INLINE_ROUTINE void _Watchdog_Insert_ticks | ( | Watchdog_Control * | the_watchdog, |
Watchdog_Interval | units | ||
) |
This routine inserts THE_WATCHDOG into the ticks watchdog chain for a time of UNITS ticks.
The INSERT_MODE indicates whether THE_WATCHDOG is to be activated automatically or later, explicitly by the caller.
References _Watchdog_Insert(), _Watchdog_Ticks_header, and Watchdog_Control::initial.
RTEMS_INLINE_ROUTINE void _Watchdog_Preinitialize | ( | Watchdog_Control * | the_watchdog | ) |
Pre-initializes a watchdog.
This routine must be called before a watchdog is used in any way. The exception are statically initialized watchdogs via WATCHDOG_INITIALIZER().
[in] | the_watchdog | The uninitialized watchdog. |
References Watchdog_Control::id, Watchdog_Control::routine, Watchdog_Control::state, Watchdog_Control::user_data, and WATCHDOG_INACTIVE.
Referenced by rtems_rate_monotonic_create(), and rtems_timer_create().
Watchdog_States _Watchdog_Remove | ( | Watchdog_Header * | header, |
Watchdog_Control * | the_watchdog | ||
) |
Removes the_watchdog from the watchdog chain.
This routine removes the_watchdog from the watchdog chain on which it resides and returns the state the_watchdog timer was in.
[in] | header | The watchdog chain. |
[in] | the_watchdog | will be removed |
the | state in which the_watchdog was in when removed |
RTEMS_INLINE_ROUTINE void _Watchdog_Reset_ticks | ( | Watchdog_Control * | the_watchdog | ) |
This routine resets THE_WATCHDOG timer to its state at INSERT time.
This routine is valid only on interval watchdog timers and is used to make an interval watchdog timer fire "every" so many ticks.
void _Watchdog_Tick | ( | void | ) |
Triggers a watchdog tick.
This routine executes TOD, watchdog and scheduler ticks.
References _Scheduler_Tick(), _Thread_Dispatch(), _Thread_Dispatch_is_enabled(), _TOD_Tickle_ticks(), and _Watchdog_Tickle_ticks().
void _Watchdog_Tickle | ( | Watchdog_Header * | header | ) |
This routine is invoked at appropriate intervals to update the header watchdog chain.
This routine is invoked at appropriate intervals to update the header watchdog chain. This routine decrements the delta counter in response to a tick.
[in] | header | is the watchdog chain to tickle |
Referenced by _Watchdog_Tickle_seconds(), and _Watchdog_Tickle_ticks().
SCORE_EXTERN Watchdog_Header _Watchdog_Seconds_header |
Watchdog chain which is managed at second boundaries.
This is the watchdog chain which is managed at second boundaries.
Referenced by _Watchdog_Insert_seconds(), and _Watchdog_Tickle_seconds().
SCORE_EXTERN Watchdog_Header _Watchdog_Ticks_header |
Watchdog chain which is managed at ticks.
This is the watchdog chain which is managed at ticks.
Referenced by _Watchdog_Insert_ticks(), and _Watchdog_Tickle_ticks().
volatile Watchdog_Interval _Watchdog_Ticks_since_boot |
The watchdog ticks counter.
With a 1ms watchdog tick, this counter overflows after 50 days since boot.
Referenced by _Scheduler_EDF_Priority_compare(), _Scheduler_EDF_Release_job(), _TOD_Tickle_ticks(), _Watchdog_Handler_initialization(), rtems_clock_get_ticks_since_boot(), and rtems_clock_tick_later().