I'm confused by the "watchdog tickle chain"

Eric Norum eric.norum at usask.ca
Thu Mar 21 22:27:58 UTC 2002


On Thursday, March 21, 2002, at 04:08 PM, Phil Torre wrote:

> I'm confused by how the watchdog tickle code works, and want to make
> sure that I haven't screwed it up with any of my changes.
>
> (This is RTEMS-4.5.0 on MPC860.)
>
> The function _Watchdog_Tickle() pulls the first Watchdog_Control object
> off of the chain, and decrements its delta_interval.  If delta_interval
> is zero, it processes the object.  If delta_interval is nonzero, it
> just returns.
>
> It seems like this should only work if the chain of objects is sorted
> by delta_interval.  However, when I fire up a debugger and walk the
> chain (by following the Node.next pointer), it looks like the 
> delta_interval
> values are pretty random.
>
> Is this correct, or am I doing something to mess up the operation of
> the delta chain?
>
> (This came up because our application code is doing *something* which
> causes the wall clock to stop counting.  The _TOD_Current.ticks value
> increments forever without _TOD_Current.seconds being updated.  In
> this state, the watchdog object for _TOD_Tickle is still on the delta
> chain, but it's stuck behind an object with a delta_interval of
> 0xffffffe0 or so, like it got decremented twice and underflowed.)
>
>

The delta_interval in the watchdog chain is the number of ticks to wait 
*relative to the previous entry*.  Thus decrementing the ticks of the 
first element on the chain effectively decrements the ticks of all 
elements on the chain.  The cost, of course, is the time taken to walk 
the queue when inserting an element (see the code for _Watchdog_Insert), 
but this presumably happens a lot less often than _Watchdog_Tickle().
--
Eric Norum <eric.norum at usask.ca>
Department of Electrical Engineering
University of Saskatchewan
Saskatoon, Canada.
Phone: (306) 966-5394   FAX:   (306) 966-5407




More information about the users mailing list