GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> ITC / V3-9-2 > itc / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

ITC_driver.c File Reference

Collection of utility routines specific to drivers. More...

#include <string.h>
#include <PBS/FORK.h>
#include <PBI/TBD_id.h>
#include <PBS/TBD.ih>
#include <ITC/ITC_drvdefs.h>
#include <MSG/MSG_pubdefs.h>
#include <ITC/ITC_msgs.h>
#include <ITC_inline.ih>
#include <ITC_prvdefs.h>

Functions

void * ITC_allocFromQueue (ITC_Queue *queue, unsigned int siz, ITC_cb_Completion **rtn, void **cb0, void **cb1, void **cb2)
 Allocate memory from a queue.
FORK_que * ITC_getForkQueueHandle (ITC_TaskID tid, ITC_QueueID qid)
 Return the fork queue handle for the given task/queue.
unsigned int ITC_getPacketProtocol (const ITC_QueueItem *qitem)
 Return the complete ITC protocol word.
ITC_QueueITC_mapApid2Queue (unsigned short APID, ITC_TaskID *tid, ITC_QueueID *qid, unsigned int *scb)
 Return queue handle corresponding to APID.
ITC_QueueITC_mapDst2Queue (unsigned int itcp)
 Return queue handle corresponding to destination task/queue IDs.
ITC_NodeID ITC_setPacketSrcNodeID (ITC_QueueItem *qitem, ITC_NodeID nid)
 Set the source node ID for the given queue item.
ITC_TaskID ITC_setPacketSrcTaskID (ITC_QueueItem *qitem, ITC_TaskID tid)
 Set the source task ID for the given queue item.


Detailed Description

Collection of utility routines specific to drivers.

CVS $Id: ITC_driver.c,v 1.4 2011/03/25 21:01:11 apw Exp $
Author:
A.P.Waite

Function Documentation

void * ITC_allocFromQueue ( ITC_Queue queue,
unsigned int  siz,
ITC_cb_Completion **  rtn,
void **  cb0,
void **  cb1,
void **  cb2 
)

Allocate memory from a queue.

Parameters:
queue (in) Queue handle
siz (in) Bytes to allocate
rtn (out) Memory deallocation callback routine
cb0 (out) Memory deallocation callback routine parameter 0
cb1 (out) Memory deallocation callback routine parameter 1
cb2 (out) Memory deallocation callback routine parameter 2
Return values:
NULL Memory not allocated
x Pointer to allocated memory

References _ITC_Queue::chk, ITC_icb, _ITC_Queue::memPrm, _ITC_Queue::memRtn, _ITC_Queue::qid, _ITC_Control::rwi, and _ITC_Queue::tid.

FORK_que * ITC_getForkQueueHandle ( ITC_TaskID  tid,
ITC_QueueID  qid 
)

Return the fork queue handle for the given task/queue.

Parameters:
tid (in) Task ID
qid (in) Queue ID
Return values:
NULL Error (no such task, no such queue, task not started)
x The fork queue handle
ITC_getForkQueueHandle() returns the fork queue handle for task tid, queue qid.

Warning:
Fork queue handles are only known for ITC tasks in state "started".

References _ITC_Task::chk, ITC_L_QUEUES, ITC_L_TASKS, ITC_qpl, ITC_tpl, ITC_TSK_STARTED, ITC_TSK_STARTING, and _ITC_Task::state.

unsigned int ITC_getPacketProtocol ( const ITC_QueueItem qitem  ) 

Return the complete ITC protocol word.

Parameters:
qitem (in) Queue item
Returns:
The complete ITC protocol word

References _ITC_QueueItem::itcp.

ITC_Queue * ITC_mapApid2Queue ( unsigned short  APID,
ITC_TaskID tid,
ITC_QueueID qid,
unsigned int *  scb 
)

Return queue handle corresponding to APID.

Parameters:
APID (in) Application ID
tid (out) Task ID
qid (out) Queue ID
scb (out) Is broadcast command (0/1 => not broadcast/broadcast)
Return values:
NULL No mapping possible
x Queue handle

References ITC_apl, ITC_QID_NONE, ITC_qpl, ITC_TID_NONE, _ITC_Apid::qid, _ITC_Apid::tid, and validApidRx().

ITC_Queue * ITC_mapDst2Queue ( unsigned int  itcp  ) 

Return queue handle corresponding to destination task/queue IDs.

Parameters:
itcp (in) ITC protocol word
Return values:
NULL No mapping possible
x Queue handle

References ITC_icb, ITC_qpl, ITC_TID_NONE, _ITC_Control::map, _ITC_Control::nid, and _ITC_Map::ptid.

ITC_NodeID ITC_setPacketSrcNodeID ( ITC_QueueItem qitem,
ITC_NodeID  nid 
)

Set the source node ID for the given queue item.

Parameters:
qitem (in) Queue item pointer
nid (in) ITC node ID
Return values:
x Previous value of node ID (ITC_NID_NONE on error)
Warning:
This entry point is provided for use by ITC driver callbacks (lightweight tasks). There should never be any reason for other tasks to call this entry point.

References ITC_L_NODES, ITC_NID_NONE, and _ITC_QueueItem::itcp.

ITC_TaskID ITC_setPacketSrcTaskID ( ITC_QueueItem qitem,
ITC_TaskID  tid 
)

Set the source task ID for the given queue item.

Parameters:
qitem (in) Queue item pointer
tid (in) ITC task ID
Return values:
x Previous value of task ID (ITC_TID_NONE on error)
Warning:
This entry point is provided for use by ITC driver callbacks (lightweight tasks). There should never be any reason for other tasks to call this entry point.

References ITC_L_TASKS, ITC_TID_NONE, and _ITC_QueueItem::itcp.


Generated on Fri Sep 30 18:18:14 2011 by  doxygen 1.5.8