Watchdog Handler


Data Structures

struct  Watchdog_Control
 Watchdog Control Structure. More...

Defines

#define WATCHDOG_MAXIMUM_INTERVAL   ((Watchdog_Interval) 0xffffffff)
 Maximum Interval Length.
#define WATCHDOG_NO_TIMEOUT   0
 No timeout constant.

Typedefs

typedef uint32_t Watchdog_Interval
 Watchdog Interval Type.
typedef uint32_t(* Watchdog_Nanoseconds_since_last_tick_routine )(void)
 Watchdog Nanoseconds Since Last Tick Extension.
typedef void Watchdog_Service_routine
 Watchdog Service Routine Return Type.
typedef Watchdog_Service_routine(* Watchdog_Service_routine_entry )(Objects_Id, void *)
 Watchdog Service Routine Pointer Type.

Enumerations

enum  Watchdog_States { WATCHDOG_INACTIVE, WATCHDOG_BEING_INSERTED, WATCHDOG_ACTIVE, WATCHDOG_REMOVE_IT }
 Watchdog States Type. More...
enum  Watchdog_Adjust_directions { WATCHDOG_FORWARD, WATCHDOG_BACKWARD }
 Watchdog Adjustment Directions Type. More...

Functions

void _Watchdog_Handler_initialization (void)
 Watchdog Handler Initialization.
Watchdog_States _Watchdog_Remove (Watchdog_Control *the_watchdog)
 Remove Watchdog from List.
void _Watchdog_Adjust (Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units)
 Watchdog Adjust.
void _Watchdog_Insert (Chain_Control *header, Watchdog_Control *the_watchdog)
 Watchdog Insert.
void _Watchdog_Tickle (Chain_Control *header)
 Watchdog Tickle.
RTEMS_INLINE_ROUTINE void _Watchdog_Initialize (Watchdog_Control *the_watchdog, Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data)
RTEMS_INLINE_ROUTINE boolean _Watchdog_Is_active (Watchdog_Control *the_watchdog)
RTEMS_INLINE_ROUTINE void _Watchdog_Activate (Watchdog_Control *the_watchdog)
RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate (Watchdog_Control *the_watchdog)
RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_ticks (void)
RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_seconds (void)
RTEMS_INLINE_ROUTINE void _Watchdog_Insert_ticks (Watchdog_Control *the_watchdog, Watchdog_Interval units)
RTEMS_INLINE_ROUTINE void _Watchdog_Insert_seconds (Watchdog_Control *the_watchdog, Watchdog_Interval units)
RTEMS_INLINE_ROUTINE void _Watchdog_Adjust_seconds (Watchdog_Adjust_directions direction, Watchdog_Interval units)
RTEMS_INLINE_ROUTINE void _Watchdog_Adjust_ticks (Watchdog_Adjust_directions direction, Watchdog_Interval units)
RTEMS_INLINE_ROUTINE void _Watchdog_Reset (Watchdog_Control *the_watchdog)
RTEMS_INLINE_ROUTINE
Watchdog_Control
_Watchdog_Next (Watchdog_Control *the_watchdog)
RTEMS_INLINE_ROUTINE
Watchdog_Control
_Watchdog_Previous (Watchdog_Control *the_watchdog)
RTEMS_INLINE_ROUTINE
Watchdog_Control
_Watchdog_First (Chain_Control *header)
RTEMS_INLINE_ROUTINE
Watchdog_Control
_Watchdog_Last (Chain_Control *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
 Ticks Since System Boot.
SCORE_EXTERN
Watchdog_Nanoseconds_since_last_tick_routine 
_Watchdog_Nanoseconds_since_tick_handler
 Watchdog Nanoseconds Since Last Tick Handler.
SCORE_EXTERN Chain_Control _Watchdog_Ticks_chain
 Per Ticks Watchdog List.
SCORE_EXTERN Chain_Control _Watchdog_Seconds_chain
 Per Seconds Watchdog List.

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)

Maximum Interval Length.

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

#define WATCHDOG_NO_TIMEOUT   0

No timeout constant.

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


Typedef Documentation

typedef uint32_t Watchdog_Interval

Watchdog Interval Type.

This type is used to specify the length of intervals.

Watchdog Nanoseconds Since Last Tick Extension.

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

Watchdog Service Routine Return Type.

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

Watchdog Service Routine Pointer Type.

This type define a pointer to a watchdog service routine.


Enumeration Type Documentation

Watchdog Adjustment Directions Type.

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

Watchdog States Type.

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

RTEMS_INLINE_ROUTINE void _Watchdog_Activate ( Watchdog_Control the_watchdog  ) 

This routine activates THE_WATCHDOG timer which is already on a watchdog chain.

References Watchdog_Control::state, and WATCHDOG_ACTIVE.

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

Watchdog Adjust.

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

Parameters:
[in] header is the watchdog chain to adjust
[in] direction is the direction to adjust header
[in] units is 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.

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.

References _Watchdog_Adjust(), and _Watchdog_Ticks_chain.

RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate ( Watchdog_Control the_watchdog  ) 

This routine deactivates THE_WATCHDOG timer which will remain on a watchdog chain.

References Watchdog_Control::state, and WATCHDOG_REMOVE_IT.

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.

References Chain_Control::first.

void _Watchdog_Handler_initialization ( void   ) 

Watchdog Handler Initialization.

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

void _Watchdog_Insert ( Chain_Control header,
Watchdog_Control the_watchdog 
)

Watchdog Insert.

This routine inserts the_watchdog into the header watchdog chain for a time of units.

Parameters:
[in] header is the_watchdog list to insert the_watchdog on
[in] the_watchdog is the watchdog to insert

Referenced by _Watchdog_Insert_seconds(), _Watchdog_Insert_ticks(), 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_Insert(), _Watchdog_Seconds_chain, and Watchdog_Control::initial.

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_chain, and Watchdog_Control::initial.

RTEMS_INLINE_ROUTINE boolean _Watchdog_Is_active ( Watchdog_Control the_watchdog  ) 

This routine returns TRUE if the watchdog timer is in the ACTIVE state, and FALSE otherwise.

References Watchdog_Control::state, and WATCHDOG_ACTIVE.

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.

References Chain_Control::last.

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.

References Chain_Node_struct::next, and Watchdog_Control::Node.

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.

References Watchdog_Control::Node, and Chain_Node_struct::previous.

Watchdog_States _Watchdog_Remove ( Watchdog_Control the_watchdog  ) 

Remove Watchdog from List.

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_watchdog will be removed
Returns:
the state in which the_watchdog was in when removed

Referenced by _Watchdog_Reset().

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_Insert(), _Watchdog_Remove(), and _Watchdog_Ticks_chain.

void _Watchdog_Tickle ( Chain_Control header  ) 

Watchdog Tickle.

This routine is invoked at appropriate intervals to update the header watchdog chain.

Parameters:
[in] header is the watchdog chain to tickle

Referenced by _Watchdog_Tickle_seconds(), and _Watchdog_Tickle_ticks().

RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_seconds ( void   ) 

This routine is invoked at each clock tick to update the seconds watchdog chain.

References _Watchdog_Seconds_chain, and _Watchdog_Tickle().

RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_ticks ( void   ) 

This routine is invoked at each clock tick to update the ticks watchdog chain.

References _Watchdog_Tickle(), and _Watchdog_Ticks_chain.


Variable Documentation

Watchdog Nanoseconds Since Last Tick Handler.

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

Per Seconds Watchdog List.

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

Referenced by _Watchdog_Adjust_seconds(), _Watchdog_Insert_seconds(), and _Watchdog_Tickle_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.

Per Ticks Watchdog List.

This is the watchdog chain which is managed at ticks.

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

Ticks Since System Boot.

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


Generated on Fri Jul 4 00:21:26 2008 for RTEMSSuperCore by  doxygen 1.5.6