\hypertarget{TBD_8ih}{
\section{TBD.ih File Reference}
\label{TBD_8ih}\index{TBD.ih@{TBD.ih}}
}
Task Block of Data manager, inline function prototypes. 

{\tt \#include \char`\"{}PBI/Inline.h\char`\"{}}\par
{\tt \#include \char`\"{}PBI/Attribute.h\char`\"{}}\par


Include dependency graph for TBD.ih:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=110pt]{TBD_8ih__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=119pt]{TBD_8ih__dep__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
TBD\_\-\_\-EXP\_\-PROTO void $\ast$$\ast$ \hyperlink{TBD_8ih_a0}{TBD\_\-\_\-locate} (void) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Locates the block of task data. \item\end{CompactList}\item 
TBD\_\-\_\-EXP\_\-PROTO void $\ast$$\ast$ \hyperlink{TBD_8ih_a1}{TBD\_\-\_\-glocate} (void) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Locates the block of task data. \item\end{CompactList}\item 
TBD\_\-\_\-EXP\_\-PROTO void $\ast$ \hyperlink{TBD_8ih_a2}{TBD\_\-\_\-get} (void $\ast$$\ast$tbd, int index) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Returns the value task global data at the specified index. \item\end{CompactList}\item 
TBD\_\-\_\-EXP\_\-PROTO void \hyperlink{TBD_8ih_a3}{TBD\_\-\_\-put} (void $\ast$$\ast$tbd, int index, void $\ast$value) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Puts the data value into the task global data at the specified index. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Task Block of Data manager, inline function prototypes. 

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


\footnotesize\begin{verbatim}    CVS $Id: TBD.ih,v 1.1.1.1 2006/02/10 21:45:36 saxton Exp $
\end{verbatim}
\normalsize


\subsection{Function Documentation}
\hypertarget{TBD_8ih_a2}{
\index{TBD.ih@{TBD.ih}!TBD__get@{TBD\_\-\_\-get}}
\index{TBD__get@{TBD\_\-\_\-get}!TBD.ih@{TBD.ih}}
\subsubsection[TBD\_\-\_\-get]{\setlength{\rightskip}{0pt plus 5cm}void $\ast$$\ast$ TBD\_\-\_\-get (void $\ast$$\ast$ {\em tbd}, int {\em index})}}
\label{TBD_8ih_a2}


Returns the value task global data at the specified index. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em tbd}]The table location, from a call to {\em \hyperlink{TBD_8h_a6}{TBD\_\-locate()}\/} or one of its cousins. \item[{\em index}]The index of the requested data value. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The data value at the specified index.\end{Desc}
The implementation of this function is very efficient of the VXWORKS platform, requiring approximately 3 instructions. It is highly recommended that the inline form of this function be used. The function call is provided only to make the code portable across all platforms.

\begin{Desc}
\item[Warning:]If you have any doubt the TBD facility has not been initialized for the task you a making the call in, make sure to check the value returned from {\em \hyperlink{TBD_8h_a6}{TBD\_\-locate()}\/} or one of its cousins for NULL before calling \hyperlink{TBD_8h_a4}{TBD\_\-get()}.\end{Desc}
\hypertarget{TBD_8ih_a1}{
\index{TBD.ih@{TBD.ih}!TBD__glocate@{TBD\_\-\_\-glocate}}
\index{TBD__glocate@{TBD\_\-\_\-glocate}!TBD.ih@{TBD.ih}}
\subsubsection[TBD\_\-\_\-glocate]{\setlength{\rightskip}{0pt plus 5cm}void $\ast$$\ast$ TBD\_\-\_\-glocate (void)}}
\label{TBD_8ih_a1}


Locates the block of task data. 

\begin{Desc}
\item[Returns:]Handle of the managed data area or NULL if called from a task that did not establish a managed data area.\end{Desc}
This call is similar to {\em \hyperlink{TBD_8ih_a0}{TBD\_\-\_\-locate()}\/}, but, if called in ISR context, returns a handle to the ISR specfic managed data area. Because the implementation of this function on Vx\-Work's platforms is only in the 6-8 instruction area, the user is encouraged to use the inline version of this routine.

\begin{Desc}
\item[Warning:]While this function will return non-NULL in an ISR context, it still may return a NULL handle if called from a task that has not established a task specific managed data area.\end{Desc}
If you have any doubts about whether the calling context has a managed area associated with it, make sure to check this handle being non-NULL before using it. If the caller knows that the calling context is always at task level, the TBD\_\-\_\-locate is more efficient.

See {\em \hyperlink{TBD_8ih_a0}{TBD\_\-\_\-locate()}\/} for a usage example.\hypertarget{TBD_8ih_a0}{
\index{TBD.ih@{TBD.ih}!TBD__locate@{TBD\_\-\_\-locate}}
\index{TBD__locate@{TBD\_\-\_\-locate}!TBD.ih@{TBD.ih}}
\subsubsection[TBD\_\-\_\-locate]{\setlength{\rightskip}{0pt plus 5cm}void $\ast$$\ast$ TBD\_\-\_\-locate (void)}}
\label{TBD_8ih_a0}


Locates the block of task data. 

\begin{Desc}
\item[Returns:]Handle of the managed data area or NULL if called from a task that did not establish a managed data area or if called from an ISR (interrupt level).\end{Desc}
This function returns a handle to the managed area for the current task. This handle is passed to {\em \hyperlink{TBD_8h_a5}{TBD\_\-put()}\/} and {\em \hyperlink{TBD_8h_a4}{TBD\_\-get()}\/} to perform reads and writes to selected locations.

The implementation of this function is very efficient of the VXWORKS platform, requiring approximately 2 instructions. It is highly recommended that the inline form of this function be used.

\begin{Desc}
\item[Warning:]There are two limitations to this routine on VXWORKs platforms.\end{Desc}
\begin{enumerate}
\item Calling from a task with no established managed area\item Calling at ISR level\end{enumerate}


\begin{Desc}
\item[]In the first case of calling from a task with established area will yield NULL as its returned pointer. Provided one checks for NULL, this routine's behaviour is well-defined.\end{Desc}
\begin{Desc}
\item[]In the second case of calling from a ISR level, the result is undefined. (Actually it is defined, the pointer is that of the interrupted task.) If you have any doubts about whether the calling context maybe ISR, the use the more general, but less efficient \hyperlink{TBD_8ih_a1}{TBD\_\-\_\-glocate()}.\end{Desc}
{\bf EXAMPLE} \par
 {\bf -------} \par
 

\footnotesize\begin{verbatim}   void   **tbd = TBD__locate ();

   / * Check for NULL * /
   if (tbd != NULL)
   {
       int   org_1 = TBD__get (tbd, DATA_IDX_1);
       int   org_2 = TBD__get (tbd, DATA_IDX_2];
   
       TBD__put (tbd, DATA_IDX_1, 0xdeadbeef);
       TBD__put (tbd, DATA_IDX_2, 0xabadcafe);
   } 
\end{verbatim}
\normalsize
\hypertarget{TBD_8ih_a3}{
\index{TBD.ih@{TBD.ih}!TBD__put@{TBD\_\-\_\-put}}
\index{TBD__put@{TBD\_\-\_\-put}!TBD.ih@{TBD.ih}}
\subsubsection[TBD\_\-\_\-put]{\setlength{\rightskip}{0pt plus 5cm}void TBD\_\-\_\-put (void $\ast$$\ast$ {\em tbd}, int {\em index}, void $\ast$ {\em value})}}
\label{TBD_8ih_a3}


Puts the data value into the task global data at the specified index. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em tbd}]The table location, from a call to {\em \hyperlink{TBD_8ih_a0}{TBD\_\-\_\-locate()}\/} or one of its cousins. \item[{\em index}]The index of the target data word \item[{\em value}]The value to put into the target data word\end{description}
\end{Desc}
The implementation of this function is very efficient of the VXWORKS platform, requiring approximately 3 instructions. It is highly recommended that the inline form of this function be used.