\hypertarget{WUT_8c}{
\section{WUT.c File Reference}
\label{WUT_8c}\index{WUT.c@{WUT.c}}
}
WakeUp Timer facility.  


{\tt \#include $<$PBS/WUT.h$>$}\par
{\tt \#include $<$PBS/WUT\_\-tmr.h$>$}\par
{\tt \#include $<$PBS/TOV.h$>$}\par
{\tt \#include $<$PBS/FPA.h$>$}\par
{\tt \#include $<$PBS/MBA.h$>$}\par
{\tt \#include $<$PBS/Q.h$>$}\par
{\tt \#include $<$PBS/Q.ih$>$}\par
{\tt \#include $<$PBS/PTS.h$>$}\par
{\tt \#include $<$WCT\_\-pvtdefs.h$>$}\par
{\tt \#include $<$PBI/PTR.h$>$}\par
{\tt \#include $<$stddef.h$>$}\par
{\tt \#include $<$WUT\_\-debug.c$>$}\par
\subsection*{Classes}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__WUT__keepalive__ctx}{\_\-WUT\_\-keepalive\_\-ctx}
\begin{CompactList}\small\item\em Callback structure for the keepalive callbacks. \item\end{CompactList}\item 
struct \hyperlink{struct__WUT__keepalive}{\_\-WUT\_\-keepalive}
\begin{CompactList}\small\item\em Captures the keepalive timer entry and context parameter. \item\end{CompactList}\item 
struct \hyperlink{struct__WCB__common}{\_\-WCB\_\-common}
\begin{CompactList}\small\item\em WakeUp Control Block. \item\end{CompactList}\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{WUT_8c_4360b0685ae4ff43f3b8a2de574ea822}{
\#define \hyperlink{WUT_8c_4360b0685ae4ff43f3b8a2de574ea822}{WUT\_\-DEBUG}}
\label{WUT_8c_4360b0685ae4ff43f3b8a2de574ea822}

\begin{CompactList}\small\item\em Used to include debugging code. \item\end{CompactList}\item 
\#define \hyperlink{WUT_8c_10b2d890d871e1489bb02b7e70d9bdfb}{STATIC}~static
\begin{CompactList}\small\item\em Kludge for Doxygen,. \item\end{CompactList}\item 
\#define \hyperlink{WUT_8c_b954dd9973466d22c2ddb11fb55d8f8e}{MEMBER\_\-OFFSET}(\_\-structure, \_\-member)~offsetof (\_\-structure, \_\-member)
\begin{CompactList}\small\item\em Calculates the offset, in bytes, of the specified {\em \_\-member\/} in {\em \_\-structure\/}. \item\end{CompactList}\item 
\#define \hyperlink{WUT_8c_e751038269028893e04f2397abc85454}{WUT\_\-M\_\-KEY}~1
\begin{CompactList}\small\item\em WUT key used to allow some normally prohibited actions. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef struct \hyperlink{struct__WUT__keepalive__ctx}{\_\-WUT\_\-keepalive\_\-ctx} \hyperlink{WUT_8c_8c82ef1637e7771201173944a64c697c}{WUT\_\-keepalive\_\-ctx}
\begin{CompactList}\small\item\em Typedef for WUT\_\-keepalive\_\-ctx. \item\end{CompactList}\item 
typedef struct \hyperlink{struct__WUT__keepalive}{\_\-WUT\_\-keepalive} \hyperlink{WUT_8c_964762aff5e18846dad6261386f8dab0}{WUT\_\-keepalive}
\begin{CompactList}\small\item\em Typedef for struct {\em \hyperlink{struct__WUT__keepalive}{\_\-WUT\_\-keepalive}\/}. \item\end{CompactList}\item 
typedef struct \hyperlink{struct__WCB__common}{\_\-WCB\_\-common} \hyperlink{WUT_8c_b2c79ad889594cbe6d95841650d101b6}{WCB\_\-common}
\begin{CompactList}\small\item\em Typedef for struct {\em \hyperlink{struct__WCB}{\_\-WCB}\/}. \item\end{CompactList}\item 
typedef struct \hyperlink{struct__WCB}{\_\-WCB} \hyperlink{WUT_8c_6963b9d03c5eb96755bacde09c89b96a}{WCB}
\begin{CompactList}\small\item\em Typedef for struct {\em \hyperlink{struct__WCB}{\_\-WCB}\/}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
STATIC \hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$ \hyperlink{WUT_8c_d106907f661b3fd6ac8266d60dada29e}{add\_\-key} (const \hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut)
\begin{CompactList}\small\item\em Adds an special key to the timer entry handle. Operations which are normally prohibited are allowed in special circumstances. \item\end{CompactList}\item 
STATIC int \hyperlink{WUT_8c_80608c0a1c9ab4edb2fd760234bf55b2}{has\_\-key} (const \hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut)
\begin{CompactList}\small\item\em Tests whether the WUT timer entry has the special key attached. \item\end{CompactList}\item 
STATIC \hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$ \hyperlink{WUT_8c_fad7cef6e353d2f08135731e58bd0bfe}{remove\_\-key} (const \hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut)
\begin{CompactList}\small\item\em Removes the special key from a WUT timer entry. \item\end{CompactList}\item 
STATIC \hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$ \hyperlink{WUT_8c_c32883d34426be1b9c6d92e19e117098}{get\_\-wut} (const \hyperlink{struct__Q__node}{Q\_\-node} $\ast$node)
\begin{CompactList}\small\item\em Returns a pointer to top of the WUT timer structure. \item\end{CompactList}\item 
STATIC \hyperlink{WUT_8h_cf93e8b743b4ee8b00e573ba59ffc7b8}{WUT\_\-state} \hyperlink{WUT_8c_5103a55ac9cf0b3b7527a50469d7f985}{add\_\-wut} (\hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut, register \hyperlink{TOV_8h_8px-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} tov)
\begin{CompactList}\small\item\em Adds the specified WUT timer entry into the active que. \item\end{CompactList}\item 
STATIC const \hyperlink{struct__Q__node}{Q\_\-node} $\ast$ \hyperlink{WUT_8c_5c329612363621f090f8c867ff28babc}{find} (const \hyperlink{struct__Q__head}{Q\_\-head} $\ast$que, register \hyperlink{TOV_8h_8px-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} tov)
\begin{CompactList}\small\item\em Scans the que to find the last timer entry with a timeout value smaller than {\em tov\/}. \item\end{CompactList}\item 
STATIC int \hyperlink{WUT_8c_c8b2131ece953232cac23d3d34061c8e}{cmp\_\-lt\_\-tov} (\hyperlink{TOV_8h_8px-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} tov\_\-a, \hyperlink{TOV_8h_8px-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} tov\_\-b)
\begin{CompactList}\small\item\em Platform implementation dependent routine to compare to timeout values. \item\end{CompactList}\item 
STATIC int \hyperlink{WUT_8c_e3fcf0fdc2f90feda97d0d5d15ae774d}{lock\_\-que} (\hyperlink{struct__WCB}{WCB} $\ast$wcb)
\begin{CompactList}\small\item\em Platform implementation dependent routine to lock the WUT timer que. \item\end{CompactList}\item 
STATIC void \hyperlink{WUT_8c_0c2eef093e6fcfc1b6fa467e390354e4}{unlock\_\-que} (\hyperlink{struct__WCB}{WCB} $\ast$wcb, int key)
\begin{CompactList}\small\item\em Platform implementation dependent routine to unlock the WUT timer que. \item\end{CompactList}\item 
STATIC void \hyperlink{WUT_8c_f729f8bb71302dc52dbba0a01d730488}{arm\_\-handler} (\hyperlink{struct__WCB}{WCB} $\ast$wcb, \hyperlink{TOV_8h_8px-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} tov)
\begin{CompactList}\small\item\em Seeds the timer interrupt to handle expire a {\em tov\/}. \item\end{CompactList}\item 
STATIC void \hyperlink{WUT_8c_e466777b7afd2dfa7d352907b4230ba8}{arm\_\-handler\_\-nxt\_\-wut} (\hyperlink{struct__WCB}{WCB} $\ast$wcb, const \hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut)
\begin{CompactList}\small\item\em Seeds the timer interrupt to handle expire at the timeout associated with the specified WUT timer entry. \item\end{CompactList}\item 
STATIC int \hyperlink{WUT_8c_1c3e31e0c7205df36c3c570716cd3678}{wut\_\-sys\_\-connect} (\hyperlink{struct__WCB}{WCB} $\ast$wcb)
\begin{CompactList}\small\item\em Platform dependent part of the WUT system connection process. \item\end{CompactList}\item 
STATIC int \hyperlink{WUT_8c_b8fdc99648379ae82dfb7099dccb0791}{wut\_\-sys\_\-shutdown} (\hyperlink{struct__WCB}{WCB} $\ast$wcb)
\begin{CompactList}\small\item\em Platform dependent shutdown of the WUT system. \item\end{CompactList}\item 
STATIC void \hyperlink{WUT_8c_25266f0b18fd62e0b90685d1a7409f5d}{wut\_\-spc\_\-init} (\hyperlink{struct__WCB}{WCB} $\ast$wcb)
\begin{CompactList}\small\item\em Initializes the processor specific portion of the control block. \item\end{CompactList}\item 
\hyperlink{WUT__cb_8h_eb854e382ed8f33a9886c7e1ee83d115}{WUT\_\-cb\_\-status} \hyperlink{WUT_8c_b5cf8027b2b39dce250608d2184b13ec}{WUT\_\-keepalive\_\-rtn} (\hyperlink{struct__WUT__keepalive__ctx}{WUT\_\-keepalive\_\-ctx} $\ast$keepalive, \hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut)
\begin{CompactList}\small\item\em Simple WUT timer callback routine used to drive the VxWorks system clock. \item\end{CompactList}\item 
\hyperlink{WUT__cb_8h_eb854e382ed8f33a9886c7e1ee83d115}{WUT\_\-cb\_\-status} \hyperlink{WUT_8c_18bc2ed40a2c3dcef4692b979de499cc}{WUT\_\-keepalive\_\-update} (\hyperlink{struct__WUT__keepalive__ctx}{WUT\_\-keepalive\_\-ctx} $\ast$keepalive, \hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut)
\begin{CompactList}\small\item\em Simple WUT timer callback routine used to update the WCT clock. \item\end{CompactList}\item 
STATIC void \hyperlink{WUT_8c_d2cd7cb8f0d144cc063a26fa062de245}{init\_\-wut} (void $\ast$unused, \hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut, int pckt\_\-size, int pcb\_\-offset)
\begin{CompactList}\small\item\em Initializes each timer entry as it is added to the Free Packet Pool. \item\end{CompactList}\item 
\hyperlink{WUT_8h_cf93e8b743b4ee8b00e573ba59ffc7b8}{WUT\_\-state} \hyperlink{WUT_8c_122141063fed149d3cc84a217f34e333}{WUT\_\-cancel} (\hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut)
\begin{CompactList}\small\item\em Cancels a WUT timer entry. \item\end{CompactList}\item 
\hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$ \hyperlink{WUT_8c_23c2d24c579d8519dc856dd67f7d8c2c}{WUT\_\-create} ()
\begin{CompactList}\small\item\em Allocate a WUT timer entry. \item\end{CompactList}\item 
\hyperlink{WUT_8h_cf93e8b743b4ee8b00e573ba59ffc7b8}{WUT\_\-state} \hyperlink{WUT_8c_65e57cfd1025e3dfc4a88047dd60a7d5}{WUT\_\-destroy} (\hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut)
\begin{CompactList}\small\item\em Destroys, ie frees, an unused WUT timer entry. \item\end{CompactList}\item 
\hyperlink{WUT_8h_cf93e8b743b4ee8b00e573ba59ffc7b8}{WUT\_\-state} \hyperlink{WUT_8c_28b6ce60e4a57805a49f6ad4dd13ed3d}{WUT\_\-expire} (\hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut)
\begin{CompactList}\small\item\em Marks a wut timer as expire. \item\end{CompactList}\item 
\hyperlink{WUT_8h_cf93e8b743b4ee8b00e573ba59ffc7b8}{WUT\_\-state} \hyperlink{WUT_8c_c6cb19a6f32c589c18daba6d2c0b580a}{WUT\_\-restart} (\hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut, register \hyperlink{TOV_8h_8px-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} tov)
\begin{CompactList}\small\item\em Restarts a WUT timer entry. \item\end{CompactList}\item 
\hyperlink{WUT_8h_cf93e8b743b4ee8b00e573ba59ffc7b8}{WUT\_\-state} \hyperlink{WUT_8c_81993670a0ec3d08db3ecd53f29a4ab6}{WUT\_\-start} (\hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut, register \hyperlink{TOV_8h_8px-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} tov, \hyperlink{WUT__cb_8h_28b8c3518de74d15b54a6176b0e78a95}{WUT\_\-cb\_\-routine} cb, void $\ast$prm)
\begin{CompactList}\small\item\em Establishes and starts a WUT timer entry. \item\end{CompactList}\item 
\hyperlink{WUT_8h_cf93e8b743b4ee8b00e573ba59ffc7b8}{WUT\_\-state} \hyperlink{WUT_8c_bfa53b05e9697be36f05f7dd0942e04f}{WUT\_\-state\_\-get} (const \hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut)
\begin{CompactList}\small\item\em Gets the current state of the WUT timer entry. \item\end{CompactList}\item 
\hyperlink{TOV_8h_8px-xxx-xxx_3892d8eb40cbdd76345c0e4177fbf430}{TOV} \hyperlink{WUT_8c_22ca032e598f3e1f4c879b9c2d40c900}{WUT\_\-tov\_\-get} (const \hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut)
\begin{CompactList}\small\item\em Gets the current TOV of the WUT timer entry. \item\end{CompactList}\item 
int \hyperlink{WUT_8c_9d5f856c6b2070f0029b865bd50f227a}{WUT\_\-overrun} (const \hyperlink{struct__WUT__tmr}{WUT\_\-tmr} $\ast$wut)
\begin{CompactList}\small\item\em Returns how 'on-time' the timer ISR was serviced. \item\end{CompactList}\item 
unsigned int \hyperlink{WUT_8c_a5a0bb284562d3e4c4077cd09798cc4f}{WUT\_\-frequency} ()
\begin{CompactList}\small\item\em Gets frequency, in Hertz of the WUT clock. \item\end{CompactList}\item 
int \hyperlink{WUT_8c_bb0dc362eb8f96140708cdc7a98e66b6}{WUT\_\-sys\_\-adjust} (long long int dnsecx)
\begin{CompactList}\small\item\em Adjusts all the current entries on the WUT timer que in response to a change in the base time. \item\end{CompactList}\item 
int \hyperlink{WUT_8c_9901e37ee66b5c7803468becc3dc0657}{WUT\_\-sys\_\-init} (int count)
\begin{CompactList}\small\item\em One time WUT services initialization routine. \item\end{CompactList}\item 
int \hyperlink{WUT_8c_c9524b8dd04058097f2375cf248c508c}{WUT\_\-sys\_\-connect} (unsigned int keepalive, unsigned int update)
\begin{CompactList}\small\item\em One time WUT connection routine to start WUT system. \item\end{CompactList}\item 
int \hyperlink{WUT_8c_e938c890a49442dd345d0ab758c03ec2}{WUT\_\-sys\_\-reset} (unsigned int keepalive, unsigned int update)
\begin{CompactList}\small\item\em Resets the keepalive and update times. \item\end{CompactList}\item 
int \hyperlink{WUT_8c_addda3a106ee9259e0ef1a9472cc90bf}{WUT\_\-sys\_\-shutdown} ()
\begin{CompactList}\small\item\em Shuts down the WUT routine. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
WakeUp Timer facility. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}

   CVS $Id: WUT.c,v 1.15 2011/08/06 01:28:27 russell Exp $
\end{verbatim}
\normalsize


\begin{Desc}
\item[]Implementation file for the os/platform/compiler independent WUT routines. These routines provide the same style of functionality as the VxWorks 'wdb' routines, but with two important differences.\end{Desc}
\begin{itemize}
\item They are portable between VxWorks and Unix (Posix) platforms\item They provided timing capability at a resolution comparable to the highest resolution clock available. \end{itemize}


\subsection{Define Documentation}
\hypertarget{WUT_8c_b954dd9973466d22c2ddb11fb55d8f8e}{
\index{WUT.c@{WUT.c}!MEMBER\_\-OFFSET@{MEMBER\_\-OFFSET}}
\index{MEMBER\_\-OFFSET@{MEMBER\_\-OFFSET}!WUT.c@{WUT.c}}
\subsubsection[{MEMBER\_\-OFFSET}]{\setlength{\rightskip}{0pt plus 5cm}\#define MEMBER\_\-OFFSET(\_\-structure, \/  \_\-member)~offsetof (\_\-structure, \_\-member)}}
\label{WUT_8c_b954dd9973466d22c2ddb11fb55d8f8e}


Calculates the offset, in bytes, of the specified {\em \_\-member\/} in {\em \_\-structure\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-structure}]The name or typedef of the structure \item[{\em \_\-member}]The member name \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The offset, in bytes, of the specified {\em \_\-member\/} in {\em \_\-structure\/} \end{Desc}


Referenced by get\_\-wut().\hypertarget{WUT_8c_10b2d890d871e1489bb02b7e70d9bdfb}{
\index{WUT.c@{WUT.c}!STATIC@{STATIC}}
\index{STATIC@{STATIC}!WUT.c@{WUT.c}}
\subsubsection[{STATIC}]{\setlength{\rightskip}{0pt plus 5cm}\#define STATIC~static}}
\label{WUT_8c_10b2d890d871e1489bb02b7e70d9bdfb}


Kludge for Doxygen,. 

\begin{Desc}
\item[]Doxygen does not like to float documentation for static functions across file boundaries. By defining a symbol for static, Doxygen no longer understands that the function is, in fact, static. Oh, the tangled WEB we weave. \end{Desc}
\hypertarget{WUT_8c_e751038269028893e04f2397abc85454}{
\index{WUT.c@{WUT.c}!WUT\_\-M\_\-KEY@{WUT\_\-M\_\-KEY}}
\index{WUT\_\-M\_\-KEY@{WUT\_\-M\_\-KEY}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-M\_\-KEY}]{\setlength{\rightskip}{0pt plus 5cm}\#define WUT\_\-M\_\-KEY~1}}
\label{WUT_8c_e751038269028893e04f2397abc85454}


WUT key used to allow some normally prohibited actions. 

\begin{Desc}
\item[]If this key is attached to the WUT timer handle, certain normally prohibited actions are allowed. In particular, one is allowed to DESTROY and REQUE WUT timer entries from the user callback routine. Note that this information cannot be carried with the state information, since all threads of execution would then have this priviledged status. One gets 'copy' semantics by attaching the key to the handle. \end{Desc}


Referenced by add\_\-key(), has\_\-key(), and remove\_\-key().

\subsection{Typedef Documentation}
\hypertarget{WUT_8c_6963b9d03c5eb96755bacde09c89b96a}{
\index{WUT.c@{WUT.c}!WCB@{WCB}}
\index{WCB@{WCB}!WUT.c@{WUT.c}}
\subsubsection[{WCB}]{\setlength{\rightskip}{0pt plus 5cm}{\bf WCB}}}
\label{WUT_8c_6963b9d03c5eb96755bacde09c89b96a}


Typedef for struct {\em \hyperlink{struct__WCB}{\_\-WCB}\/}. 

\begin{Desc}
\item[]This structure contains all the control variables for the WakeUp Timer facility. It consists of a common or platform independent piece {\em WCB\_\-common\/} and, optionally, a platform dependent piece. \end{Desc}
\hypertarget{WUT_8c_b2c79ad889594cbe6d95841650d101b6}{
\index{WUT.c@{WUT.c}!WCB\_\-common@{WCB\_\-common}}
\index{WCB\_\-common@{WCB\_\-common}!WUT.c@{WUT.c}}
\subsubsection[{WCB\_\-common}]{\setlength{\rightskip}{0pt plus 5cm}{\bf WCB\_\-common}}}
\label{WUT_8c_b2c79ad889594cbe6d95841650d101b6}


Typedef for struct {\em \hyperlink{struct__WCB}{\_\-WCB}\/}. 

\begin{Desc}
\item[]This structure contains all the control variables for the WakeUp Timer facility. \end{Desc}
\hypertarget{WUT_8c_964762aff5e18846dad6261386f8dab0}{
\index{WUT.c@{WUT.c}!WUT\_\-keepalive@{WUT\_\-keepalive}}
\index{WUT\_\-keepalive@{WUT\_\-keepalive}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-keepalive}]{\setlength{\rightskip}{0pt plus 5cm}{\bf WUT\_\-cb\_\-status} {\bf WUT\_\-keepalive}}}
\label{WUT_8c_964762aff5e18846dad6261386f8dab0}


Typedef for struct {\em \hyperlink{struct__WUT__keepalive}{\_\-WUT\_\-keepalive}\/}. 

Simple WUT timer callback routine used as a periodic keepalive.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em period}]Pointer to the period (in nanoseconds) \item[{\em wut}]The WUT timer entry \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em WUT\_\-K\_\-STATE\_\-CHANGE\_\-YES}]This is provided mainly for symmetry with the VxWorks implementation. In that implementation, this routine drives the system clock. In the POSIX implementation, it is just a periodic heartbeat.\end{description}
\end{Desc}
The return value reflects the fact the timer entries state has been changed by the callback routine (its been restarted). \hypertarget{WUT_8c_8c82ef1637e7771201173944a64c697c}{
\index{WUT.c@{WUT.c}!WUT\_\-keepalive\_\-ctx@{WUT\_\-keepalive\_\-ctx}}
\index{WUT\_\-keepalive\_\-ctx@{WUT\_\-keepalive\_\-ctx}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-keepalive\_\-ctx}]{\setlength{\rightskip}{0pt plus 5cm}{\bf WUT\_\-keepalive\_\-ctx}}}
\label{WUT_8c_8c82ef1637e7771201173944a64c697c}


Typedef for WUT\_\-keepalive\_\-ctx. 

\begin{Desc}
\item[]Currently there are two styles of keepalive callbacks. The usual callback depends on an external source to update the WCT clock. The external source is likely the GPS 1 PPS signal or the on-board auxilliary realtime clocks.\end{Desc}
\begin{Desc}
\item[]The other style is the a keepalive that updates the WCT clock itself. This is a little incestuous, but is useful in low performance, debugging work. \end{Desc}


\subsection{Function Documentation}
\hypertarget{WUT_8c_d106907f661b3fd6ac8266d60dada29e}{
\index{WUT.c@{WUT.c}!add\_\-key@{add\_\-key}}
\index{add\_\-key@{add\_\-key}!WUT.c@{WUT.c}}
\subsubsection[{add\_\-key}]{\setlength{\rightskip}{0pt plus 5cm}STATIC {\bf WUT\_\-tmr} $\ast$ add\_\-key (const {\bf WUT\_\-tmr} $\ast$ {\em wut})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{WUT_8c_d106907f661b3fd6ac8266d60dada29e}


Adds an special key to the timer entry handle. Operations which are normally prohibited are allowed in special circumstances. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wut}]The WUT timer entry to modify. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The modified WUT timer entry.\end{Desc}
\begin{Desc}
\item[]This is an internal routine only. \end{Desc}


References WUT\_\-M\_\-KEY.

Referenced by WUT\_\-sys\_\-handler().\hypertarget{WUT_8c_5103a55ac9cf0b3b7527a50469d7f985}{
\index{WUT.c@{WUT.c}!add\_\-wut@{add\_\-wut}}
\index{add\_\-wut@{add\_\-wut}!WUT.c@{WUT.c}}
\subsubsection[{add\_\-wut}]{\setlength{\rightskip}{0pt plus 5cm}STATIC {\bf WUT\_\-state} add\_\-wut ({\bf WUT\_\-tmr} $\ast$ {\em wut}, \/  register {\bf TOV} {\em tov})}}
\label{WUT_8c_5103a55ac9cf0b3b7527a50469d7f985}


Adds the specified WUT timer entry into the active que. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wut}]The WUT timer entry to add \item[{\em tov}]The timeout value. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em WUT\_\-K\_\-QUEUED}]\end{description}
\end{Desc}
\begin{Desc}
\item[]This is an internal only routine. This routine scans the timer queue and places this entry before any other entries with a later timeout value. The active que is always ordered by timeout value, with the most quickly to expire at the top and the least at the bottom. \end{Desc}


References arm\_\-handler(), cmp\_\-lt\_\-tov(), \_\-WCB::com, find(), \_\-Q\_\-node::flnk, get\_\-wut(), lock\_\-que(), \_\-WUT\_\-tmr::node, \_\-Q\_\-head::node, Q\_\-\_\-insert(), Q\_\-\_\-jam(), \_\-WCB\_\-common::que, \_\-WUT\_\-tmr::state, \_\-WUT\_\-tmr::tov, unlock\_\-que(), Wcb, WUT\_\-K\_\-ACTIVE, and WUT\_\-K\_\-QUEUED.

Referenced by WUT\_\-restart(), and WUT\_\-start().\hypertarget{WUT_8c_f729f8bb71302dc52dbba0a01d730488}{
\index{WUT.c@{WUT.c}!arm\_\-handler@{arm\_\-handler}}
\index{arm\_\-handler@{arm\_\-handler}!WUT.c@{WUT.c}}
\subsubsection[{arm\_\-handler}]{\setlength{\rightskip}{0pt plus 5cm}void arm\_\-handler ({\bf WCB} $\ast$ {\em wcb}, \/  {\bf TOV} {\em tov})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{WUT_8c_f729f8bb71302dc52dbba0a01d730488}


Seeds the timer interrupt to handle expire a {\em tov\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wcb}]The WUT control block \item[{\em tov}]The expiration timeout value \end{description}
\end{Desc}


References BUG\_\-check(), \_\-WCB\_\-qlt::cv, \_\-WCB\_\-specific::qlt, and \_\-WCB::spc.

Referenced by add\_\-wut().\hypertarget{WUT_8c_e466777b7afd2dfa7d352907b4230ba8}{
\index{WUT.c@{WUT.c}!arm\_\-handler\_\-nxt\_\-wut@{arm\_\-handler\_\-nxt\_\-wut}}
\index{arm\_\-handler\_\-nxt\_\-wut@{arm\_\-handler\_\-nxt\_\-wut}!WUT.c@{WUT.c}}
\subsubsection[{arm\_\-handler\_\-nxt\_\-wut}]{\setlength{\rightskip}{0pt plus 5cm}void arm\_\-handler\_\-nxt\_\-wut ({\bf WCB} $\ast$ {\em wcb}, \/  const {\bf WUT\_\-tmr} $\ast$ {\em wut})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{WUT_8c_e466777b7afd2dfa7d352907b4230ba8}


Seeds the timer interrupt to handle expire at the timeout associated with the specified WUT timer entry. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wcb}]The WUT control block \item[{\em wut}]The WUT timer entry. \end{description}
\end{Desc}


References BUG\_\-check(), \_\-WCB\_\-qlt::cv, \_\-WCB\_\-specific::qlt, and \_\-WCB::spc.

Referenced by WUT\_\-cancel().\hypertarget{WUT_8c_c8b2131ece953232cac23d3d34061c8e}{
\index{WUT.c@{WUT.c}!cmp\_\-lt\_\-tov@{cmp\_\-lt\_\-tov}}
\index{cmp\_\-lt\_\-tov@{cmp\_\-lt\_\-tov}!WUT.c@{WUT.c}}
\subsubsection[{cmp\_\-lt\_\-tov}]{\setlength{\rightskip}{0pt plus 5cm}int cmp\_\-lt\_\-tov ({\bf TOV} {\em tov\_\-a}, \/  {\bf TOV} {\em tov\_\-b})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{WUT_8c_c8b2131ece953232cac23d3d34061c8e}


Platform implementation dependent routine to compare to timeout values. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em tov\_\-a}]The first of the two timeout values to compare \item[{\em tov\_\-b}]The second of the two timeout values to compare \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]non-zero if tov\_\-a $<$ tov\_\-b, else 0 \end{Desc}


References \_\-TOV\_\-u::tov, and \_\-TOV\_\-u::ts.

Referenced by add\_\-wut(), find(), and WUT\_\-sys\_\-handler().\hypertarget{WUT_8c_5c329612363621f090f8c867ff28babc}{
\index{WUT.c@{WUT.c}!find@{find}}
\index{find@{find}!WUT.c@{WUT.c}}
\subsubsection[{find}]{\setlength{\rightskip}{0pt plus 5cm}STATIC const {\bf Q\_\-node} $\ast$ find (const {\bf Q\_\-head} $\ast$ {\em que}, \/  register {\bf TOV} {\em tov})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{WUT_8c_5c329612363621f090f8c867ff28babc}


Scans the que to find the last timer entry with a timeout value smaller than {\em tov\/}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]The active timer que to scan \item[{\em tov}]The target expiration time \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The last timer entry with a timeout value smaller than {\em tov\/}.\end{Desc}
\begin{Desc}
\item[]This is an internal only routine. \end{Desc}


References cmp\_\-lt\_\-tov(), \_\-Q\_\-node::flnk, get\_\-wut(), \_\-Q\_\-head::node, and \_\-WUT\_\-tmr::tov.

Referenced by add\_\-wut().\hypertarget{WUT_8c_c32883d34426be1b9c6d92e19e117098}{
\index{WUT.c@{WUT.c}!get\_\-wut@{get\_\-wut}}
\index{get\_\-wut@{get\_\-wut}!WUT.c@{WUT.c}}
\subsubsection[{get\_\-wut}]{\setlength{\rightskip}{0pt plus 5cm}STATIC {\bf WUT\_\-tmr} $\ast$ get\_\-wut (const {\bf Q\_\-node} $\ast$ {\em node})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{WUT_8c_c32883d34426be1b9c6d92e19e117098}


Returns a pointer to top of the WUT timer structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em node}]The node (que links) of the WUT timer entry\end{description}
\end{Desc}
\begin{Desc}
\item[]This is an internal routine only. WUT timer entries are queued on both a free list and an active list. Because the que links are not at the top of the structure, but at some fixed offset from the top, a uniform method of paging to the top of WUT timer structure is provided. \end{Desc}


References MEMBER\_\-OFFSET.

Referenced by add\_\-wut(), find(), WUT\_\-cancel(), WUT\_\-sys\_\-adjust(), WUT\_\-sys\_\-handler(), and wut\_\-sys\_\-kill().\hypertarget{WUT_8c_80608c0a1c9ab4edb2fd760234bf55b2}{
\index{WUT.c@{WUT.c}!has\_\-key@{has\_\-key}}
\index{has\_\-key@{has\_\-key}!WUT.c@{WUT.c}}
\subsubsection[{has\_\-key}]{\setlength{\rightskip}{0pt plus 5cm}STATIC int has\_\-key (const {\bf WUT\_\-tmr} $\ast$ {\em wut})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{WUT_8c_80608c0a1c9ab4edb2fd760234bf55b2}


Tests whether the WUT timer entry has the special key attached. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wut}]The WUT timer entry to test. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A non zero value if the special key is attached.\end{Desc}
\begin{Desc}
\item[]This is an internal routine only. \end{Desc}


References WUT\_\-M\_\-KEY.

Referenced by WUT\_\-cancel(), WUT\_\-destroy(), WUT\_\-expire(), WUT\_\-restart(), and WUT\_\-start().\hypertarget{WUT_8c_d2cd7cb8f0d144cc063a26fa062de245}{
\index{WUT.c@{WUT.c}!init\_\-wut@{init\_\-wut}}
\index{init\_\-wut@{init\_\-wut}!WUT.c@{WUT.c}}
\subsubsection[{init\_\-wut}]{\setlength{\rightskip}{0pt plus 5cm}STATIC void init\_\-wut (void $\ast$ {\em unused}, \/  {\bf WUT\_\-tmr} $\ast$ {\em wut}, \/  int {\em pckt\_\-size}, \/  int {\em pcb\_\-offset})}}
\label{WUT_8c_d2cd7cb8f0d144cc063a26fa062de245}


Initializes each timer entry as it is added to the Free Packet Pool. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em unused}]Unused parameter \item[{\em wut}]The WUT timer entry to initialize \item[{\em pckt\_\-size}]The size of a packet \item[{\em pcb\_\-offset}]The offset to the FPA control structure\end{description}
\end{Desc}
\begin{Desc}
\item[]Initializes each timer entry as it is added to the WUT timer's free list. \end{Desc}


References \_\-WUT\_\-tmr::state, and WUT\_\-K\_\-FREE.

Referenced by WUT\_\-sys\_\-init().\hypertarget{WUT_8c_e3fcf0fdc2f90feda97d0d5d15ae774d}{
\index{WUT.c@{WUT.c}!lock\_\-que@{lock\_\-que}}
\index{lock\_\-que@{lock\_\-que}!WUT.c@{WUT.c}}
\subsubsection[{lock\_\-que}]{\setlength{\rightskip}{0pt plus 5cm}int lock\_\-que ({\bf WCB} $\ast$ {\em wcb})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{WUT_8c_e3fcf0fdc2f90feda97d0d5d15ae774d}


Platform implementation dependent routine to lock the WUT timer que. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wcb}]Pointer to the WUT control block \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A key to be used to unlock the que. \end{Desc}


References BUG\_\-check(), \_\-WCB\_\-qlt::mutex, \_\-WCB\_\-specific::qlt, and \_\-WCB::spc.

Referenced by add\_\-wut(), WUT\_\-cancel(), and wut\_\-sys\_\-kill().\hypertarget{WUT_8c_fad7cef6e353d2f08135731e58bd0bfe}{
\index{WUT.c@{WUT.c}!remove\_\-key@{remove\_\-key}}
\index{remove\_\-key@{remove\_\-key}!WUT.c@{WUT.c}}
\subsubsection[{remove\_\-key}]{\setlength{\rightskip}{0pt plus 5cm}STATIC {\bf WUT\_\-tmr} $\ast$ remove\_\-key (const {\bf WUT\_\-tmr} $\ast$ {\em wut})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{WUT_8c_fad7cef6e353d2f08135731e58bd0bfe}


Removes the special key from a WUT timer entry. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wut}]The WUT timer entry to remove the key from.\end{description}
\end{Desc}
\begin{Desc}
\item[]This is an internal routine only. \end{Desc}


References WUT\_\-M\_\-KEY.

Referenced by WUT\_\-cancel(), WUT\_\-destroy(), WUT\_\-expire(), WUT\_\-keepalive\_\-rtn(), WUT\_\-restart(), WUT\_\-start(), WUT\_\-state\_\-get(), and WUT\_\-tov\_\-get().\hypertarget{WUT_8c_0c2eef093e6fcfc1b6fa467e390354e4}{
\index{WUT.c@{WUT.c}!unlock\_\-que@{unlock\_\-que}}
\index{unlock\_\-que@{unlock\_\-que}!WUT.c@{WUT.c}}
\subsubsection[{unlock\_\-que}]{\setlength{\rightskip}{0pt plus 5cm}void unlock\_\-que ({\bf WCB} $\ast$ {\em wcb}, \/  int {\em key})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{WUT_8c_0c2eef093e6fcfc1b6fa467e390354e4}


Platform implementation dependent routine to unlock the WUT timer que. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wcb}]Pointer to the WUT control block \item[{\em key}]The key used to unlock the que (returned from {\em \hyperlink{WUT_8c_e3fcf0fdc2f90feda97d0d5d15ae774d}{lock\_\-que()}\/} \end{description}
\end{Desc}


References BUG\_\-check(), \_\-WCB\_\-qlt::mutex, \_\-WCB\_\-specific::qlt, and \_\-WCB::spc.

Referenced by add\_\-wut(), WUT\_\-cancel(), and wut\_\-sys\_\-kill().\hypertarget{WUT_8c_122141063fed149d3cc84a217f34e333}{
\index{WUT.c@{WUT.c}!WUT\_\-cancel@{WUT\_\-cancel}}
\index{WUT\_\-cancel@{WUT\_\-cancel}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-cancel}]{\setlength{\rightskip}{0pt plus 5cm}{\bf WUT\_\-state} WUT\_\-cancel ({\bf WUT\_\-tmr} $\ast$ {\em wut})}}
\label{WUT_8c_122141063fed149d3cc84a217f34e333}


Cancels a WUT timer entry. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wut}]The WUT timer entry to cancel \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The new state. If successful this is WUT\_\-K\_\-CANCELLED\end{Desc}
\begin{Desc}
\item[]Cancels a WUT timer entry. Due to race conditions, this is a very tricky operation. Only timer entries in the WUT\_\-K\_\-QUEUED state may be cancelled. If the timer entry is not in this state, the cancel operation fails and the current state is returned to the user. \end{Desc}


References arm\_\-handler\_\-nxt\_\-wut(), \_\-WCB::com, \_\-Q\_\-node::flnk, get\_\-wut(), has\_\-key(), lock\_\-que(), \_\-WUT\_\-tmr::node, \_\-Q\_\-head::node, Q\_\-\_\-unlink(), \_\-WCB\_\-common::que, remove\_\-key(), \_\-WUT\_\-tmr::state, unlock\_\-que(), Wcb, WUT\_\-K\_\-CANCELLED, and WUT\_\-K\_\-QUEUED.\hypertarget{WUT_8c_23c2d24c579d8519dc856dd67f7d8c2c}{
\index{WUT.c@{WUT.c}!WUT\_\-create@{WUT\_\-create}}
\index{WUT\_\-create@{WUT\_\-create}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-create}]{\setlength{\rightskip}{0pt plus 5cm}{\bf WUT\_\-tmr}$\ast$ WUT\_\-create (void)}}
\label{WUT_8c_23c2d24c579d8519dc856dd67f7d8c2c}


Allocate a WUT timer entry. 

\begin{Desc}
\item[Returns:]If successful, a handle for WUT timer entry, else NULL\end{Desc}
\begin{Desc}
\item[]Allocates, without blocking a WUT timer entry. If successful, the state of the timer entry is updated to WUT\_\-K\_\-ALLOCATED. \end{Desc}


References \_\-WCB::com, \_\-WCB\_\-common::fcb, FPA\_\-get(), \_\-WUT\_\-tmr::state, Wcb, and WUT\_\-K\_\-ALLOCATED.\hypertarget{WUT_8c_65e57cfd1025e3dfc4a88047dd60a7d5}{
\index{WUT.c@{WUT.c}!WUT\_\-destroy@{WUT\_\-destroy}}
\index{WUT\_\-destroy@{WUT\_\-destroy}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-destroy}]{\setlength{\rightskip}{0pt plus 5cm}{\bf WUT\_\-state} WUT\_\-destroy ({\bf WUT\_\-tmr} $\ast$ {\em wut})}}
\label{WUT_8c_65e57cfd1025e3dfc4a88047dd60a7d5}


Destroys, ie frees, an unused WUT timer entry. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wut}]The WUT timer entry to destroy \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]If successful, WUT\_\-K\_\-FREE, else its current state.\end{Desc}
\begin{Desc}
\item[]A WUT timer entry can only be destroyed, ie returned to the free list, if it is in the state\end{Desc}
\begin{itemize}
\item WUT\_\-K\_\-ALLOCATED\item WUT\_\-K\_\-CANCELLED\item WUT\_\-K\_\-EXPIRED\item or if it being destroyed as part of its ISR callback routine.\end{itemize}


\begin{Desc}
\item[]The user should ensure the timer entry was destroyed by checking that the returned state is WUT\_\-K\_\-FREE. Note that this value may also be returned if the timer entry was already in the the freed state. \end{Desc}


References \_\-WCB::com, \_\-WCB\_\-common::fcb, FPA\_\-free(), has\_\-key(), remove\_\-key(), \_\-WUT\_\-tmr::state, Wcb, WUT\_\-K\_\-ALLOCATED, and WUT\_\-K\_\-FREE.\hypertarget{WUT_8c_28b6ce60e4a57805a49f6ad4dd13ed3d}{
\index{WUT.c@{WUT.c}!WUT\_\-expire@{WUT\_\-expire}}
\index{WUT\_\-expire@{WUT\_\-expire}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-expire}]{\setlength{\rightskip}{0pt plus 5cm}{\bf WUT\_\-state} WUT\_\-expire ({\bf WUT\_\-tmr} $\ast$ {\em wut})}}
\label{WUT_8c_28b6ce60e4a57805a49f6ad4dd13ed3d}


Marks a wut timer as expire. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wut}]The WUT timer entry to expire \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]IF successful, WUT\_\-K\_\-EXPIRED, else the current state\end{Desc}
\begin{Desc}
\item[]This routine must only be called from the user's callback routine. The user must call this, or one of WUT\_\-cancel, WUT\_\-start or WUT\_\-restart in his callback before calling the routine being used to synchronize with another thread of execution. If successful, the WUT timer entry will be changed from the ACTIVE state to the EXPIRED state. Once in the EXPIRED state, ownership of the timer entry is effectively transferred from the WUT facility back to the user.\end{Desc}
\begin{Desc}
\item[Warning:]This mechanism should be used instead of passing back {\em WUT\_\-K\_\-STATE\_\-CHANGED\_\-YES\/} or {\em WUT\_\-K\_\-STATE\_\-CHANGED\_\-NO\/} from the user's callback routine. This mechanism will continued to be honored and will work correctly on platforms where the WUT callback routine executes in a higher priority thread (for us VxWorks and not {\bf any} of the host platforms. So to be {\em portable\/} and {\em correct\/}, use this call in lieu of the return code. The return code in portable code should now always be {\em WUT\_\-K\_\-STATE\_\-CHANGED\_\-YES\/}.

This call is necessary on platforms on POSIX platforms that do not support task priorities. On these platforms, the WUT timer cannot be protected by having the callback routine run in a higher priority thread. This means that WUT driver servicing the timer que cannot touch the WUT timer after the user's callback has been called. If this were allowed, there is a possibility that as soon as the user calls his synchronization routine, the thread waiting on that synchronization mechanism can begin execution. In that case, the user would make the reasonable assumption that the WUT timer handle is no longer property of the WUT facility. This call effectively declares to the WUT timer entry is no longer property of the WUT facility.\end{Desc}
\begin{Desc}
\item[]A previous implementation marked the timer entry EXPIRED after the return, thus allowing a hole between when the user called his synchronization method and when the driver marked it as inactive when the WUT timer was still property of the WUT facility. The user ownership assumption was thus violated.\end{Desc}
\begin{Desc}
\item[]Technically the previous implementation was protected since the state of the timer was still active, thus prohibiting operations on the timer. However, while technically correct, this implementation gave the user no good method (other than spinning) to know when the timer entry went to the expired state. \end{Desc}


References has\_\-key(), remove\_\-key(), \_\-WUT\_\-tmr::state, and WUT\_\-K\_\-EXPIRED.\hypertarget{WUT_8c_a5a0bb284562d3e4c4077cd09798cc4f}{
\index{WUT.c@{WUT.c}!WUT\_\-frequency@{WUT\_\-frequency}}
\index{WUT\_\-frequency@{WUT\_\-frequency}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-frequency}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int WUT\_\-frequency (void)}}
\label{WUT_8c_a5a0bb284562d3e4c4077cd09798cc4f}


Gets frequency, in Hertz of the WUT clock. 

\begin{Desc}
\item[Returns:]The frequency in Hertz of the WUT clock\end{Desc}
\begin{Desc}
\item[]In principle this allows the caller to translate physical time units, like nanoseconds, into the internal time units used by the WUT facility. However, this is only a crude conversion. For more accurate conversions the TOV facility should be used. One should consider this function as for informational purposes only. \end{Desc}


References PTS\_\-frequency().\hypertarget{WUT_8c_b5cf8027b2b39dce250608d2184b13ec}{
\index{WUT.c@{WUT.c}!WUT\_\-keepalive\_\-rtn@{WUT\_\-keepalive\_\-rtn}}
\index{WUT\_\-keepalive\_\-rtn@{WUT\_\-keepalive\_\-rtn}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-keepalive\_\-rtn}]{\setlength{\rightskip}{0pt plus 5cm}{\bf WUT\_\-cb\_\-status} WUT\_\-keepalive\_\-rtn ({\bf WUT\_\-keepalive\_\-ctx} $\ast$ {\em keepalive}, \/  {\bf WUT\_\-tmr} $\ast$ {\em wut})}}
\label{WUT_8c_b5cf8027b2b39dce250608d2184b13ec}


Simple WUT timer callback routine used to drive the VxWorks system clock. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em keepalive}]The keepalive control structure. \item[{\em wut}]The WUT timer entry \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em WUT\_\-K\_\-STATE\_\-CHANGE\_\-YES}]\end{description}
\end{Desc}
\begin{Desc}
\item[VXWORKS Implementation Note]On the PowerPC platform, this routine is used to keep the decrement counter within its limited range, ensuring that no timer entry attempts to seed it with a value beyond it's limits. It is also used to update the VxWork's system clock by calling tickAnnounce().\end{Desc}
\begin{Desc}
\item[Return Value]The return value reflects the fact the timer entries state has been changed by the callback routine (its been restarted). \end{Desc}


References \_\-WUT\_\-keepalive\_\-ctx::period, remove\_\-key(), \_\-WUT\_\-tmr::tov, TOV\_\-add\_\-nsecx(), WUT\_\-K\_\-STATE\_\-CHANGE\_\-YES, and WUT\_\-restart().

Referenced by WUT\_\-sys\_\-connect(), and WUT\_\-sys\_\-reset().\hypertarget{WUT_8c_18bc2ed40a2c3dcef4692b979de499cc}{
\index{WUT.c@{WUT.c}!WUT\_\-keepalive\_\-update@{WUT\_\-keepalive\_\-update}}
\index{WUT\_\-keepalive\_\-update@{WUT\_\-keepalive\_\-update}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-keepalive\_\-update}]{\setlength{\rightskip}{0pt plus 5cm}{\bf WUT\_\-cb\_\-status} WUT\_\-keepalive\_\-update ({\bf WUT\_\-keepalive\_\-ctx} $\ast$ {\em keepalive}, \/  {\bf WUT\_\-tmr} $\ast$ {\em wut})}}
\label{WUT_8c_18bc2ed40a2c3dcef4692b979de499cc}


Simple WUT timer callback routine used to update the WCT clock. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em keepalive}]The keepalive control structure. \item[{\em wut}]The WUT timer entry \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em WUT\_\-K\_\-STATE\_\-CHANGE\_\-YES}]\end{description}
\end{Desc}
\begin{Desc}
\item[]This routine is used in systems without an external clock, such as the sysAuxClock or the GPS.\end{Desc}
\begin{Desc}
\item[]The WUT timer entry updates the WCT clock and the timer entry is then requeued with the specified delay relative to it's previous expiration time. This creates a fairly accurate clock.\end{Desc}
\begin{Desc}
\item[]The return value reflects the fact the timer entries state has been changed by the callback routine (its been restarted).\end{Desc}
\begin{Desc}
\item[VXWORKS IMPLEMENTATION NOTE]The VxWork's routine {\em tickAnnounce()\/}, is called to update the VxWork's system clock and WCT clock. \end{Desc}


Referenced by WUT\_\-sys\_\-connect(), and WUT\_\-sys\_\-reset().\hypertarget{WUT_8c_9d5f856c6b2070f0029b865bd50f227a}{
\index{WUT.c@{WUT.c}!WUT\_\-overrun@{WUT\_\-overrun}}
\index{WUT\_\-overrun@{WUT\_\-overrun}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-overrun}]{\setlength{\rightskip}{0pt plus 5cm}int WUT\_\-overrun (const {\bf WUT\_\-tmr} $\ast$ {\em wut})}}
\label{WUT_8c_9d5f856c6b2070f0029b865bd50f227a}


Returns how 'on-time' the timer ISR was serviced. 

\begin{Desc}
\item[Returns:]The current internal value of the WUT time\end{Desc}
\begin{Desc}
\item[]The caller may use this value to determine how 'on time' his callback routine was called. Remember, due to scheduling conflicts, the WUT facility may service the timer entry after its scheduled expiration time. It is up to the user to determine how late is 'too late'. \end{Desc}
\hypertarget{WUT_8c_c6cb19a6f32c589c18daba6d2c0b580a}{
\index{WUT.c@{WUT.c}!WUT\_\-restart@{WUT\_\-restart}}
\index{WUT\_\-restart@{WUT\_\-restart}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-restart}]{\setlength{\rightskip}{0pt plus 5cm}{\bf WUT\_\-state} WUT\_\-restart ({\bf WUT\_\-tmr} $\ast$ {\em wut}, \/  register {\bf TOV} {\em tov})}}
\label{WUT_8c_c6cb19a6f32c589c18daba6d2c0b580a}


Restarts a WUT timer entry. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wut}]The WUT timer entry to restart. \item[{\em tov}]The timeout value. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]If successful, WUT\_\-K\_\-QUEUED\end{Desc}
\begin{Desc}
\item[]Restarts an timer entry. Only inactive timer entries, ie those in the state WUT\_\-K\_\-ALLOCATED, WUT\_\-K\_\-CANCELLED and WUT\_\-K\_\-EXPIRED may be restarted or {\em WUT\_\-restart\/} is being called from the timer entries callback handler. If the state of the timer entry to be restarted is not one of these, the operation fails and \hyperlink{WUT_8h_c6cb19a6f32c589c18daba6d2c0b580a}{WUT\_\-restart()} returns the state of the timer entry. \end{Desc}


References add\_\-wut(), has\_\-key(), remove\_\-key(), \_\-WUT\_\-tmr::state, and WUT\_\-K\_\-ALLOCATED.

Referenced by WUT\_\-keepalive\_\-rtn().\hypertarget{WUT_8c_25266f0b18fd62e0b90685d1a7409f5d}{
\index{WUT.c@{WUT.c}!wut\_\-spc\_\-init@{wut\_\-spc\_\-init}}
\index{wut\_\-spc\_\-init@{wut\_\-spc\_\-init}!WUT.c@{WUT.c}}
\subsubsection[{wut\_\-spc\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}STATIC void wut\_\-spc\_\-init ({\bf WCB} $\ast$ {\em wcb})}}
\label{WUT_8c_25266f0b18fd62e0b90685d1a7409f5d}


Initializes the processor specific portion of the control block. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wcb}]The WUT control block \end{description}
\end{Desc}


Referenced by WUT\_\-sys\_\-init().\hypertarget{WUT_8c_81993670a0ec3d08db3ecd53f29a4ab6}{
\index{WUT.c@{WUT.c}!WUT\_\-start@{WUT\_\-start}}
\index{WUT\_\-start@{WUT\_\-start}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-start}]{\setlength{\rightskip}{0pt plus 5cm}{\bf WUT\_\-state} WUT\_\-start ({\bf WUT\_\-tmr} $\ast$ {\em wut}, \/  register {\bf TOV} {\em tov}, \/  {\bf WUT\_\-cb\_\-routine} {\em cb}, \/  void $\ast$ {\em prm})}}
\label{WUT_8c_81993670a0ec3d08db3ecd53f29a4ab6}


Establishes and starts a WUT timer entry. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wut}]The WUT timer entry to restart. \item[{\em tov}]The timeout value \item[{\em cb}]The address of the WUT timer entry's callback service routine. \item[{\em prm}]A user parameter passed transparently through to the timer entry's callback service routine \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]If successful, WUT\_\-K\_\-QUEUED\end{Desc}
\begin{Desc}
\item[]Places the WUT timer entry on the active queue. The timer entry to be started must be in one of the inactive states, ie WUT\_\-K\_\-ALLOCATED, WUT\_\-K\_\-CANCELLED or WUT\_\-K\_\-EXPIRED or it must own the special key, allowing it is to be started from the callback routine. If it is not in one of these conditions are true, the current state of the timer entry is returned.\end{Desc}
\begin{Desc}
\item[]The name is a bit of a misnomer, suggesting that this routine can only be called when the timer is initially place on the active que. Although it must be called to initially place the entry on the active que, this routine can be called to at any time (provided the state permits). When called in this fashion, it behaves very similarly to \hyperlink{WUT_8h_c6cb19a6f32c589c18daba6d2c0b580a}{WUT\_\-restart()}. The difference is that this routine allows one to reset not only a new expiration time, but also the callback routine and callback parameter.\end{Desc}
\begin{Desc}
\item[]Used cleverly, this routine could be used to create a state machine which executes at prescribed times, and whose next expiration callback is handled by a different routine. \end{Desc}


References add\_\-wut(), \_\-WUT\_\-tmr::cb, has\_\-key(), \_\-WUT\_\-tmr::prm, remove\_\-key(), \_\-WUT\_\-tmr::state, and WUT\_\-K\_\-ALLOCATED.

Referenced by wut\_\-sys\_\-shutdown().\hypertarget{WUT_8c_bfa53b05e9697be36f05f7dd0942e04f}{
\index{WUT.c@{WUT.c}!WUT\_\-state\_\-get@{WUT\_\-state\_\-get}}
\index{WUT\_\-state\_\-get@{WUT\_\-state\_\-get}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-state\_\-get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf WUT\_\-state} WUT\_\-state\_\-get (const {\bf WUT\_\-tmr} $\ast$ {\em wut})}}
\label{WUT_8c_bfa53b05e9697be36f05f7dd0942e04f}


Gets the current state of the WUT timer entry. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wut}]The WUT timer entry to get the state for. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The current state of the WUT timer entry.\end{Desc}
\begin{Desc}
\item[]Simple query routine to return the current state of a timer entry.\end{Desc}
\begin{Desc}
\item[Warning:]If the timer is in an active state or is shared amongst different threads, the state may not be static, ie it may change immediately after it is fetched. The user is responsible for using the results of this query wisely. \end{Desc}


References remove\_\-key(), and \_\-WUT\_\-tmr::state.\hypertarget{WUT_8c_bb0dc362eb8f96140708cdc7a98e66b6}{
\index{WUT.c@{WUT.c}!WUT\_\-sys\_\-adjust@{WUT\_\-sys\_\-adjust}}
\index{WUT\_\-sys\_\-adjust@{WUT\_\-sys\_\-adjust}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-sys\_\-adjust}]{\setlength{\rightskip}{0pt plus 5cm}int WUT\_\-sys\_\-adjust (long long int {\em dnsecx})}}
\label{WUT_8c_bb0dc362eb8f96140708cdc7a98e66b6}


Adjusts all the current entries on the WUT timer que in response to a change in the base time. 

\begin{Desc}
\item[Returns:]The number of entries that were adjusted\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dnsecx}]The number of nanoseconds to shift the timer que entries by.\end{description}
\end{Desc}
\begin{Desc}
\item[]This is a high level system routine used to fix-up the timer entries in response to a (hopefully) one-time resetting of the underlying system clock. The call to this routine will occur when the external time is known. Since this time is potentially well after the time WUT has started, it is necessary to adjust the entries on the WUT timer que to this new base time.\end{Desc}
\begin{Desc}
\item[Warning:]There is a gotcha in this and that is that all timer que entries up to this point are assumed to be relative timers. It really does not make any sense to have placed any absolute timers on the que, since, until the external time is known, one has no basis for establishing when an absolute timer will expire.

It is assumed that interrupts are locked during the course of this execution. \end{Desc}


References \_\-WCB::com, \_\-Q\_\-node::flnk, get\_\-wut(), \_\-Q\_\-head::node, \_\-WCB\_\-common::que, \_\-WUT\_\-tmr::tov, TOV\_\-K\_\-FOREVER, and Wcb.\hypertarget{WUT_8c_c9524b8dd04058097f2375cf248c508c}{
\index{WUT.c@{WUT.c}!WUT\_\-sys\_\-connect@{WUT\_\-sys\_\-connect}}
\index{WUT\_\-sys\_\-connect@{WUT\_\-sys\_\-connect}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-sys\_\-connect}]{\setlength{\rightskip}{0pt plus 5cm}int WUT\_\-sys\_\-connect (unsigned int {\em keepalive}, \/  unsigned int {\em update})}}
\label{WUT_8c_c9524b8dd04058097f2375cf248c508c}


One time WUT connection routine to start WUT system. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em keepalive}]The timeout period, in nsecs, to run the keepalive timer. \item[{\em update}]The update period. If non-zero, the WCT clock will be updated at this rate. If 0, then WCT clock will be update externally. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status \end{Desc}


References \_\-WUT\_\-tmr::cb, \_\-WCB::com, \_\-WUT\_\-keepalive::ctx, \_\-WUT\_\-keepalive\_\-ctx::elapsed, \_\-WCB\_\-common::keepalive, \_\-WUT\_\-tmr::node, \_\-WUT\_\-keepalive\_\-ctx::period, \_\-WUT\_\-tmr::prm, Q\_\-insert(), \_\-WCB\_\-common::que, \_\-WUT\_\-tmr::state, \_\-WCB\_\-common::terminator, \_\-WUT\_\-keepalive::tmr, \_\-WUT\_\-tmr::tov, TOV\_\-from\_\-nsecs(), TOV\_\-K\_\-FOREVER, \_\-WUT\_\-keepalive\_\-ctx::update, Wcb, WUT\_\-K\_\-QUEUED, WUT\_\-keepalive\_\-rtn(), WUT\_\-keepalive\_\-update(), and wut\_\-sys\_\-connect().

Referenced by PBS\_\-initialize2().\hypertarget{WUT_8c_1c3e31e0c7205df36c3c570716cd3678}{
\index{WUT.c@{WUT.c}!wut\_\-sys\_\-connect@{wut\_\-sys\_\-connect}}
\index{wut\_\-sys\_\-connect@{wut\_\-sys\_\-connect}!WUT.c@{WUT.c}}
\subsubsection[{wut\_\-sys\_\-connect}]{\setlength{\rightskip}{0pt plus 5cm}int wut\_\-sys\_\-connect ({\bf WCB} $\ast$ {\em wcb})}}
\label{WUT_8c_1c3e31e0c7205df36c3c570716cd3678}


Platform dependent part of the WUT system connection process. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wcb}]The WUT control block \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status \end{Desc}


References \_\-WCB\_\-qlt::cv, \_\-WCB\_\-qlt::mutex, \_\-WCB\_\-specific::qlt, \_\-WCB::spc, TASK\_\-attr\_\-init(), TASK\_\-attr\_\-priority\_\-set(), TASK\_\-spawn(), \_\-WCB\_\-specific::tcb, WUT\_\-K\_\-TASK\_\-PRIORITY, and WUT\_\-sys\_\-handler().

Referenced by WUT\_\-sys\_\-connect().\hypertarget{WUT_8c_9901e37ee66b5c7803468becc3dc0657}{
\index{WUT.c@{WUT.c}!WUT\_\-sys\_\-init@{WUT\_\-sys\_\-init}}
\index{WUT\_\-sys\_\-init@{WUT\_\-sys\_\-init}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-sys\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}int WUT\_\-sys\_\-init (int {\em count})}}
\label{WUT_8c_9901e37ee66b5c7803468becc3dc0657}


One time WUT services initialization routine. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em count}]The number of available timer entries \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[]Initializes a pool of WakeUp Timer entries. This is a one time system initialization call and establishes a fixed pool of timer entries. Enough timer entries should be configured to handle the maximum possible number of simoultaneosly outstanding requests. Timer entries are fairly cheap ($\sim$50 bytes) so one should allocate generously.\end{Desc}
\begin{Desc}
\item[]Having said that, the prudent programmer will allocate the timer entries he needs at his start-up time and hold on to them. While this is somewhat wasteful of system resources, it beats dealing with trying to allocate a timer entry during the meat of the code, only to come up empty handed. If this stategy is uniformily adopted it should be relatively easy to establish a working number. \end{Desc}


References \_\-WCB\_\-common::cnt, \_\-WCB::com, \_\-WCB\_\-common::fcb, FPA\_\-fcb\_\-sizeof(), FPA\_\-init(), FPA\_\-K\_\-PCB\_\-AT\_\-EOP, FPA\_\-K\_\-TYPE\_\-PENDING\_\-FIFO, init\_\-wut(), MBA\_\-alloc(), Q\_\-init(), \_\-WCB\_\-common::que, Wcb, and wut\_\-spc\_\-init().

Referenced by PBS\_\-initialize2().\hypertarget{WUT_8c_e938c890a49442dd345d0ab758c03ec2}{
\index{WUT.c@{WUT.c}!WUT\_\-sys\_\-reset@{WUT\_\-sys\_\-reset}}
\index{WUT\_\-sys\_\-reset@{WUT\_\-sys\_\-reset}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-sys\_\-reset}]{\setlength{\rightskip}{0pt plus 5cm}int WUT\_\-sys\_\-reset (unsigned int {\em keepalive}, \/  unsigned int {\em update})}}
\label{WUT_8c_e938c890a49442dd345d0ab758c03ec2}


Resets the keepalive and update times. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em keepalive}]The timeout period, in nsecs, to run the keepalive timer. One values is recognized as special\begin{enumerate}
\item 0, Leave as is\item anything else, The new keepalive period\end{enumerate}
\item[{\em update}]The new update period (in nanoseconds). Three values are recognized\begin{enumerate}
\item -1, Remove the updater, the implication is that the caller is assuming responsibility for this function\item 0, Leave as is\item anything else, the new update time, in nanoseconds\end{enumerate}
\end{description}
\end{Desc}
\begin{Desc}
\item[]This is used to establish new values for the keepalive and update timers. This is generally used after the initial initialization of the WUT facility, when one learns the absolute wall clock time. \end{Desc}


References \_\-WUT\_\-tmr::cb, \_\-WCB::com, \_\-WUT\_\-keepalive::ctx, \_\-WCB\_\-common::keepalive, \_\-WUT\_\-keepalive\_\-ctx::period, \_\-WUT\_\-keepalive::tmr, \_\-WUT\_\-keepalive\_\-ctx::update, Wcb, WUT\_\-keepalive\_\-rtn(), WUT\_\-keepalive\_\-update(), and wut\_\-period\_\-set().\hypertarget{WUT_8c_addda3a106ee9259e0ef1a9472cc90bf}{
\index{WUT.c@{WUT.c}!WUT\_\-sys\_\-shutdown@{WUT\_\-sys\_\-shutdown}}
\index{WUT\_\-sys\_\-shutdown@{WUT\_\-sys\_\-shutdown}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-sys\_\-shutdown}]{\setlength{\rightskip}{0pt plus 5cm}int WUT\_\-sys\_\-shutdown (void)}}
\label{WUT_8c_addda3a106ee9259e0ef1a9472cc90bf}


Shuts down the WUT routine. 

\begin{Desc}
\item[Returns:]Status, 1 indicates WUT was not started, so cannot be shutdown. \end{Desc}
\begin{Desc}
\item[]This is definitely a dicey function. It makes no check that the WUT que is empty. That is left to the poor user to guarantee.\end{Desc}
\begin{Desc}
\item[Warning:]Given the degree of difficulty reclaiming all the resources, this function should probably be regarded as a debugging aid only. It can be used when reloading PBS$>$\end{Desc}
\begin{Desc}
\item[]If one does call it from a real piece of code, then the user is obligated to cancel any and all WUT timers. In addition, any timers allocated from the WUT pool should be returned. This last step is not strictly necessary. WUT knows where all its timer entries are so it will free them whether the user does or doesn't. Freeing the timers is just for clean-living. \end{Desc}


References \_\-WCB::com, \_\-WCB\_\-common::fcb, MBA\_\-free(), Wcb, and wut\_\-sys\_\-shutdown().

Referenced by PBS\_\-shutdown().\hypertarget{WUT_8c_b8fdc99648379ae82dfb7099dccb0791}{
\index{WUT.c@{WUT.c}!wut\_\-sys\_\-shutdown@{wut\_\-sys\_\-shutdown}}
\index{wut\_\-sys\_\-shutdown@{wut\_\-sys\_\-shutdown}!WUT.c@{WUT.c}}
\subsubsection[{wut\_\-sys\_\-shutdown}]{\setlength{\rightskip}{0pt plus 5cm}int wut\_\-sys\_\-shutdown ({\bf WCB} $\ast$ {\em wcb})}}
\label{WUT_8c_b8fdc99648379ae82dfb7099dccb0791}


Platform dependent shutdown of the WUT system. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wcb}]The WUT control block \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Status \end{Desc}


References \_\-WCB::spc, TASK\_\-join(), \_\-WCB\_\-specific::tcb, TOV\_\-from\_\-nsecs(), WUT\_\-INIT, WUT\_\-start(), and wut\_\-sys\_\-kill().

Referenced by WUT\_\-sys\_\-shutdown().\hypertarget{WUT_8c_22ca032e598f3e1f4c879b9c2d40c900}{
\index{WUT.c@{WUT.c}!WUT\_\-tov\_\-get@{WUT\_\-tov\_\-get}}
\index{WUT\_\-tov\_\-get@{WUT\_\-tov\_\-get}!WUT.c@{WUT.c}}
\subsubsection[{WUT\_\-tov\_\-get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf TOV} WUT\_\-tov\_\-get (const {\bf WUT\_\-tmr} $\ast$ {\em wut})}}
\label{WUT_8c_22ca032e598f3e1f4c879b9c2d40c900}


Gets the current TOV of the WUT timer entry. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wut}]The WUT timer entry to get the TOV for. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The current TOV of the WUT timer entry.\end{Desc}
\begin{Desc}
\item[]Simply query routine to return the current state of a timer entry.\end{Desc}
\begin{Desc}
\item[Warning:]If the timer is in an active state or is shared amongst different threads, the TOV may not be static, ie it may change immediately after it is fetched. The user is responsible for using the results of this query wisely. \end{Desc}


References remove\_\-key(), and \_\-WUT\_\-tmr::tov.