RTEMS CPU Kit with SuperCore  4.10.99.0
Data Structures | Defines | Typedefs | Enumerations | Functions | Variables
Watchdog Handler
SuperCore

This handler encapsulates functionality related to the scheduling of watchdog functions to be called at specific times in the future. More...

Collaboration diagram for Watchdog Handler:

Data Structures

struct  Watchdog_Control
 The control block used to manage each watchdog timer. More...

Defines

#define WATCHDOG_MAXIMUM_INTERVAL   ((Watchdog_Interval) 0xffffffff)
 Control block used to manage intervals.
#define WATCHDOG_NO_TIMEOUT   0
 The constant for indefinite wait.

Typedefs

typedef uint32_t Watchdog_Interval
 Type is used to specify the length of intervals.
typedef uint32_t(* Watchdog_Nanoseconds_since_last_tick_routine )(void)
 Pointer to the BSP plugin to obtain the number of nanoseconds since the last clock tick.
typedef void Watchdog_Service_routine
 Return type from a Watchdog Service Routine.
typedef Watchdog_Service_routine(* Watchdog_Service_routine_entry )(Objects_Id, void *)
 Pointer to a watchdog service routine.

Enumerations

enum  Watchdog_States { WATCHDOG_INACTIVE, WATCHDOG_BEING_INSERTED, WATCHDOG_ACTIVE, WATCHDOG_REMOVE_IT }
 Set of the states which a watchdog timer may be at any given time. More...
enum  Watchdog_Adjust_directions { WATCHDOG_FORWARD, WATCHDOG_BACKWARD }
 the manner in which a watchdog chain may be adjusted by the _Watchdog_Adjust routine. More...

Functions

void _Watchdog_Handler_initialization (void)
 Initialize the watchdog handler.
Watchdog_States _Watchdog_Remove (Watchdog_Control *the_watchdog)
 Removes the_watchdog from the watchdog chain.
void _Watchdog_Adjust (Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units)
 Adjusts the header watchdog chain in the forward or backward direction for units ticks.
void _Watchdog_Adjust_to_chain (Chain_Control *header, Watchdog_Interval units_arg, Chain_Control *to_fire)
 Adjusts the header watchdog chain in the forward direction for units_arg ticks.
void _Watchdog_Insert (Chain_Control *header, Watchdog_Control *the_watchdog)
 Inserts the_watchdog into the header watchdog chain for a time of units.
void _Watchdog_Tickle (Chain_Control *header)
 This routine is invoked at appropriate intervals to update the header watchdog chain.
void _Watchdog_Report (const char *name, Watchdog_Control *watch)
 Report information on a single watchdog instance.
void _Watchdog_Report_chain (const char *name, Chain_Control *header)
 Report information on a watchdog chain.
uint32_t _Watchdog_Nanoseconds_since_tick_default_handler (void)
 Handler for default nanoseconds since last tick.
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.
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_Deactivate (Watchdog_Control *the_watchdog)
 This routine deactivates THE_WATCHDOG timer which will remain 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.
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.
RTEMS_INLINE_ROUTINE void _Watchdog_Adjust_seconds (Watchdog_Adjust_directions direction, Watchdog_Interval units)
 This routine adjusts the seconds watchdog chain in the forward or backward DIRECTION for UNITS seconds.
RTEMS_INLINE_ROUTINE void _Watchdog_Adjust_ticks (Watchdog_Adjust_directions direction, Watchdog_Interval units)
 This routine adjusts the ticks watchdog chain in the forward or backward DIRECTION for UNITS ticks.
RTEMS_INLINE_ROUTINE void _Watchdog_Reset (Watchdog_Control *the_watchdog)
 This routine resets THE_WATCHDOG timer to its state at INSERT time.
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 (Chain_Control *header)
 This routine returns a pointer to the first watchdog timer on the watchdog chain HEADER.
RTEMS_INLINE_ROUTINE
Watchdog_Control
_Watchdog_Last (Chain_Control *header)
 This routine returns a pointer to the last watchdog timer on the watchdog chain HEADER.

Variables

SCORE_EXTERN volatile uint32_t _Watchdog_Sync_level
 Watchdog synchronization level.
SCORE_EXTERN volatile uint32_t _Watchdog_Sync_count
 Watchdog synchronization count.
SCORE_EXTERN volatile
Watchdog_Interval 
_Watchdog_Ticks_since_boot
 The number of ticks since the system was booted.
Watchdog_Nanoseconds_since_last_tick_routine _Watchdog_Nanoseconds_since_tick_handler
 The number of nanoseconds since the last clock tick.
SCORE_EXTERN Chain_Control _Watchdog_Ticks_chain
 Watchdog chain which is managed at ticks.
SCORE_EXTERN Chain_Control _Watchdog_Seconds_chain
 Watchdog chain which is managed at second boundaries.

Detailed Description

This handler encapsulates functionality related to the scheduling of watchdog functions to be called at specific times in the future.

Note:
This handler does not have anything to do with hardware watchdog timers.

Define Documentation

#define WATCHDOG_MAXIMUM_INTERVAL   ((Watchdog_Interval) 0xffffffff)

Control block used to manage intervals.

The following type defines the control block used to manage intervals.

#define WATCHDOG_NO_TIMEOUT   0

The constant for indefinite wait.

This is the constant for indefinite wait. It is actually an illegal interval.


Typedef Documentation

typedef uint32_t Watchdog_Interval

Type is used to specify the length of intervals.

This type is used to specify the length of intervals.

Pointer to the BSP plugin to obtain the number of nanoseconds since the last clock tick.

This type defines a pointer to the BSP plugin to obtain the number of nanoseconds since the last clock tick.

Return type from a Watchdog Service Routine.

This type defines the return type from a Watchdog Service Routine.

Pointer to a watchdog service routine.

This type define a pointer to a watchdog service routine.


Enumeration Type Documentation

the manner in which a watchdog chain may be adjusted by the _Watchdog_Adjust routine.

The following enumerated type details the manner in which a watchdog chain may be adjusted by the _Watchdog_Adjust routine. The direction indicates a movement FORWARD or BACKWARD in time.

Enumerator:
WATCHDOG_FORWARD 

adjust delta value forward

WATCHDOG_BACKWARD 

adjust delta value backward

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.

Enumerator:
WATCHDOG_INACTIVE 

This is the state when the watchdog is off all chains.

WATCHDOG_BEING_INSERTED 

This is the state when the watchdog is off all chains, but we are currently searching for the insertion point.

WATCHDOG_ACTIVE 

This is the state when the watchdog is on a chain, and allowed to fire.

WATCHDOG_REMOVE_IT 

This is the state when the watchdog is on a chain, but we should remove without firing if it expires.


Function Documentation

void _Watchdog_Adjust ( Chain_Control header,
Watchdog_Adjust_directions  direction,
Watchdog_Interval  units 
)

Adjusts the header watchdog chain in the forward or backward direction for units ticks.

This routine adjusts the header watchdog chain in the forward or backward direction for units ticks.

Parameters:
[in]headeris the watchdog chain to adjust
[in]directionis the direction to adjust header
[in]unitsis the number of units to adjust header

Referenced by _Watchdog_Adjust_seconds(), and _Watchdog_Adjust_ticks().

RTEMS_INLINE_ROUTINE void _Watchdog_Adjust_seconds ( Watchdog_Adjust_directions  direction,
Watchdog_Interval  units 
)

This routine adjusts the seconds watchdog chain in the forward or backward DIRECTION for UNITS seconds.

This is invoked when the current time of day is changed.

References _Watchdog_Adjust(), and _Watchdog_Seconds_chain.

void _Watchdog_Adjust_to_chain ( Chain_Control header,
Watchdog_Interval  units_arg,
Chain_Control to_fire 
)

Adjusts the header watchdog chain in the forward direction for units_arg ticks.

This routine adjusts the header watchdog chain in the forward direction for units_arg ticks.

Parameters:
[in]headeris the watchdog chain to adjust
[in]units_argis the number of units to adjust header
[in]to_fireis a pointer to an initialized Chain_Control to which all watchdog instances that are to be fired will be placed.
Note:
This always adjusts forward.
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.

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 Watchdog_Control::state, WATCHDOG_INACTIVE, Watchdog_Control::routine, Watchdog_Control::id, and Watchdog_Control::user_data.

void _Watchdog_Insert ( Chain_Control 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.

Parameters:
[in]headeris the_watchdog list to insert the_watchdog on
[in]the_watchdogis the watchdog to insert

Referenced by _Watchdog_Insert_ticks(), _Watchdog_Insert_seconds(), and _Watchdog_Reset().

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_Control::initial, _Watchdog_Insert(), and _Watchdog_Seconds_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.

The INSERT_MODE indicates whether THE_WATCHDOG is to be activated automatically or later, explicitly by the caller.

References Watchdog_Control::initial, _Watchdog_Insert(), and _Watchdog_Ticks_chain.

uint32_t _Watchdog_Nanoseconds_since_tick_default_handler ( void  )

Handler for default nanoseconds since last tick.

Return values:
0Always.
Watchdog_States _Watchdog_Remove ( 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.

Parameters:
[in]the_watchdogwill be removed
Return values:
thestate in which the_watchdog was in when removed

Referenced by _Watchdog_Reset().

void _Watchdog_Report ( const char *  name,
Watchdog_Control watch 
)

Report information on a single watchdog instance.

This method prints a one line report on the watchdog instance provided. The name may be used to identify the watchdog and a space will be printed after name if it is not NULL.

Parameters:
[in]nameis a string to prefix the line with. If NULL, nothing is printed.
[in]watchis the watchdog instance to be printed.
Note:
This is a debug routine. It uses printk() and prudence should exercised when using it.
void _Watchdog_Report_chain ( const char *  name,
Chain_Control header 
)

Report information on a watchdog chain.

This method prints report on the watchdog chain provided. The name may be used to identify the watchdog chain and a space will be printed after name if it is not NULL.

Parameters:
[in]nameis a string to prefix the line with. If NULL, nothing is printed.
[in]headeris the watchdog chain to be printed.
Note:
This is a debug routine. It uses printk() and prudence should exercised when using it. It also disables interrupts so the chain can be traversed in a single atomic pass.
RTEMS_INLINE_ROUTINE void _Watchdog_Reset ( 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.

References _Watchdog_Remove(), _Watchdog_Insert(), and _Watchdog_Ticks_chain.

void _Watchdog_Tickle ( Chain_Control 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.

Parameters:
[in]headeris the watchdog chain to tickle

Referenced by _Watchdog_Tickle_ticks(), and _Watchdog_Tickle_seconds().


Variable Documentation

The number of nanoseconds since the last clock tick.

This is a pointer to the optional BSP plugin to obtain the number of nanoseconds since the last clock tick.

Watchdog chain which is managed at second boundaries.

This is the watchdog chain which is managed at second boundaries.

Referenced by _Watchdog_Tickle_seconds(), _Watchdog_Insert_seconds(), and _Watchdog_Adjust_seconds().

SCORE_EXTERN volatile uint32_t _Watchdog_Sync_count

Watchdog synchronization count.

This used for synchronization purposes during an insert on a watchdog delta chain.

SCORE_EXTERN volatile uint32_t _Watchdog_Sync_level

Watchdog synchronization level.

This used for synchronization purposes during an insert on a watchdog delta chain.

Watchdog chain which is managed at ticks.

This is the watchdog chain which is managed at ticks.

Referenced by _Watchdog_Tickle_ticks(), _Watchdog_Insert_ticks(), _Watchdog_Adjust_ticks(), and _Watchdog_Reset().

The number of ticks since the system was booted.

This contains the number of ticks since the system was booted.