GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > PBS / V2-10-8

Constituent: pbs     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

TBD.ih File Reference

Task Block of Data manager, inline function prototypes. More...

#include "PBI/Inline.h"
#include "PBI/Attribute.h"

Include dependency graph for TBD.ih:

This graph shows which files directly or indirectly include this file:


Functions

TBD__EXP_PROTO void ** TBD__locate (void) ATTR_UNUSED_OK
 Locates the block of task data.
TBD__EXP_PROTO void ** TBD__glocate (void) ATTR_UNUSED_OK
 Locates the block of task data.
TBD__EXP_PROTO void * TBD__get (void **tbd, int index) ATTR_UNUSED_OK
 Returns the value task global data at the specified index.
TBD__EXP_PROTO void TBD__put (void **tbd, int index, void *value) ATTR_UNUSED_OK
 Puts the data value into the task global data at the specified index.

Detailed Description

Task Block of Data manager, inline function prototypes.

Author:
JJRussell - russell@slac.stanford.edu
    CVS $Id: TBD.ih,v 1.4 2004/12/07 16:13:05 russell Exp $

Function Documentation

void ** TBD__get void **  tbd,
int  index
 

Returns the value task global data at the specified index.

Parameters:
tbd The table location, from a call to TBD_locate() or one of its cousins.
index The index of the requested data value.
Returns:
The data value at the specified index.
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.

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 TBD_locate() or one of its cousins for NULL before calling TBD_get().

void ** TBD__glocate void   ) 
 

Locates the block of task data.

Returns:
Handle of the managed data area or NULL if called from a task that did not establish a managed data area.
This call is similar to 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 VxWork's platforms is only in the 6-8 instruction area, the user is encouraged to use the inline version of this routine.

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.
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 TBD__locate() for a usage example.

void ** TBD__locate void   ) 
 

Locates the block of task data.

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).
This function returns a handle to the managed area for the current task. This handle is passed to TBD_put() and 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.

Warning:
There are two limitations to this routine on VXWORKs platforms.
  1. Calling from a task with no established managed area
  2. Calling at ISR level

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.
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 TBD__glocate().
EXAMPLE
-------
   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);
   } 

void TBD__put void **  tbd,
int  index,
void *  value
 

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

Parameters:
tbd The table location, from a call to TBD__locate() or one of its cousins.
index The index of the target data word
value The value to put into the target data word
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.


Generated on Tue Nov 22 20:24:40 2005 by  doxygen 1.4.4