GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > ITC / V2-1-7

Constituent: itc     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

ITC_task.c File Reference

ITC task/service cmeonstruction routines. More...

#include <string.h>
#include "PBI/TBD_id.h"
#include "PBS/FORK.h"
#include "PBS/MBA.h"
#include "PBS/TBD.ih"
#include "PBS/TOC.h"
#include "MSG/MSG_pubdefs.h"
#include "CCSDS/CCSDS_pkt.h"
#include "ITC/ITC_msgs.h"
#include "ITC_inline.ih"
#include "ITC_prvdefs.h"
#include "ITC_meta.h"

Include dependency graph for ITC_task.c:

Include dependency graph

Functions

unsigned int createQueues (ITC_TaskID tid, unsigned int want)
 Allocate and initialize a block of queues.

void deleteQueues (ITC_TaskID tid, unsigned int have)
 De-allocate a block of queues.

unsigned int ITC_addQueue (struct _ITC_Task *task, ITC_QueueID qid)
 Add a queue to a task.

unsigned int ITC_attachApid (struct _ITC_Task *task, ITC_QueueID qid, const ITC_ApidDef *def, void *prm)
 Attach an APID definition to a queue.

unsigned int ITC_attachCmd (struct _ITC_Task *task, ITC_QueueID qid, const ITC_CommandList *lst, void *prm)
 Attach a command list to a queue (only one per queue).

unsigned int ITC_attachRaw (struct _ITC_Task *task, ITC_QueueID qid, ITC_cb_Processor *rtn, void *prm)
 Attach a raw processor to a queue (only one per queue).

unsigned int ITC_createService (struct _ITC_Task **task, ITC_TaskID tid, ITC_cb_Processor *rtn)
 Create a service task.

unsigned int ITC_createTask (struct _ITC_Task **task, ITC_TaskID tid)
 Create a task level container for queues.

unsigned int ITC_createTaskLite (struct _ITC_Task **task, ITC_TaskID tid)
 Create a lightweight ITC task.

unsigned int ITC_convertTaskLite (struct _ITC_Task *task)
 Convert a task to a lightweight ITC task.

unsigned int ITC_deleteTask (struct _ITC_Task *task)
 Delete a task container.

unsigned int ITC_detachApid (const ITC_ApidDef *def)
 Detach an APID definition from a queue.

unsigned int ITC_detachCmd (struct _ITC_Task *task, ITC_QueueID qid)
 Detach a command list from a queue.

unsigned int ITC_detachRaw (struct _ITC_Task *task, ITC_QueueID qid)
 Detach a raw processor from a queue.

_ITC_TaskITC_getTaskHandle (ITC_TaskID tid)
 Return the task handle for a given task ID.

ITC_TaskID ITC_getTaskID ()
 Return the ITC task ID of the calling task (if it's an ITC task).

unsigned int ITC_removeQueue (struct _ITC_Task *task, ITC_QueueID qid)
 Remove a queue from a task.

unsigned int ITC_startTask (struct _ITC_Task *task, const TASK_attr *attr, ITC_cb_StartTask *rtn, void *prm)
 Fork a task with the queues described in the task handle.

unsigned int ITC_stopTask (struct _ITC_Task *task)
 Stop an ITC task.


Detailed Description

ITC task/service cmeonstruction routines.

CVS $Id: ITC_task.c,v 1.7 2005/01/07 05:05:43 apw Exp $
Author:
A.P.Waite
ITC_task.c provides the interfaces to construct ITC based tasks.

Function Documentation

unsigned int createQueues ITC_TaskID  tid,
unsigned int  want
[inline, static]
 

Allocate and initialize a block of queues.

Parameters:
tid (in) Task ID for which to create queues
want (in) Bit-mask of queues requested
Returns:
Bit-mask of queues created

void deleteQueues ITC_TaskID  tid,
unsigned int  have
[inline, static]
 

De-allocate a block of queues.

Parameters:
tid (in) Task ID for which to delete queues
have (in) Bit-mask of queues to delete

unsigned int ITC_addQueue struct _ITC_Task task,
ITC_QueueID  qid
 

Add a queue to a task.

Parameters:
task (in) Task handle
qid (in) Queue ID
Return values:
ITC_NOTINIT ITC has not been initialized
ITC_QUEUITC Queue ID reserved for ITC
ITC_QUEUINIT Queue initialization failed
ITC_QUEURNG Queue ID is out of range
ITC_QUEUSTAT Queue not in state undefined
ITC_SUCCESS Success
ITC_TASKHNDL Task handle is invalid
ITC_TASKSTAT Task not in state initialized

Here is the call graph for this function:

unsigned int ITC_attachApid struct _ITC_Task task,
ITC_QueueID  qid,
const ITC_ApidDef def,
void *  prm
 

Attach an APID definition to a queue.

Parameters:
task (in) Task handle
qid (in) Queue ID
def (in) APID definition
prm (in) User context parameter (per APID)
Return values:
ITC_ALOCFAIL Cannot allocate for an ITC_Apid object
ITC_DBLAPID Table entry for this APID already in use
ITC_NOTINIT ITC has not been initialized
ITC_QUEURNG Queue ID is out of range
ITC_QUEUSTAT Queue not in state initialized
ITC_SUCCESS Success
ITC_TASKHNDL Task handle is invalid
ITC_TASKSTAT Task not in state initialized

Here is the call graph for this function:

unsigned int ITC_attachCmd struct _ITC_Task task,
ITC_QueueID  qid,
const ITC_CommandList lst,
void *  prm
 

Attach a command list to a queue (only one per queue).

Parameters:
task (in) Task handle
qid (in) Queue ID
lst (in) A command list
prm (in) User context parameter (per command list)
Return values:
ITC_DBLCMD Command entry for this queue alrady in use
ITC_NOTINIT ITC has not been initialized
ITC_QUEURNG Queue ID is out of range
ITC_QUEUSTAT Queue not in state initialized
ITC_SUCCESS Success
ITC_TASKHNDL Task handle is invalid
ITC_TASKSTAT Task not in state initialized

unsigned int ITC_attachRaw struct _ITC_Task task,
ITC_QueueID  qid,
ITC_cb_Processor rtn,
void *  prm
 

Attach a raw processor to a queue (only one per queue).

Parameters:
task (in) Task handle
qid (in) Queue ID
rtn (in) Callback for raw packets
prm (in) User context parameter (per raw processor)
Return values:
ITC_DBLRAW Raw protocol handler for this queue already defined
ITC_NOTINIT ITC has not been initialized
ITC_RAWRTN Cannot specify a NULL routine
ITC_QUEURNG Queue ID is out of range
ITC_QUEUSTAT Queue not in state initialized
ITC_SUCCESS Success
ITC_TASKHNDL Task handle is invalid
ITC_TASKSTAT Task not in state initialized

unsigned int ITC_convertTaskLite struct _ITC_Task task  ) 
 

Convert a task to a lightweight ITC task.

Parameters:
task (in) Task handle
Return values:
ITC_SUCCESS Success
Warning:
This routine must be called in the context of the task wishing to be converted.
ITC_convertTaskLite() converts an existing task to a lightweight ITC task.

unsigned int ITC_createService struct _ITC_Task **  task,
ITC_TaskID  tid,
ITC_cb_Processor rtn
 

Create a service task.

Parameters:
task (out) Task handle (pass to ITC_startTask())
tid (in) Service ID (taken from preassigned service list)
rtn (in) Service callback routine
Return values:
ITC_ALOCFAIL Cannot allocate an ITC_Task object
ITC_NOTINIT ITC has not been initialized
ITC_SUCCESS Success
ITC_TASKQUEU Cannot create task queues
ITC_TASKRNG Task ID not valid for a service task
ITC_TASKSTAT Task not in state undefined
ITC_createService() creates a complete service task. The only function that can be applied to such a task handle is ITC_startTask().

Here is the call graph for this function:

unsigned int ITC_createTask struct _ITC_Task **  task,
ITC_TaskID  tid
 

Create a task level container for queues.

Parameters:
task (out) Task handle (pass to other task configuration routines)
tid (in) Task ID (taken from preassigned application list)
Return values:
ITC_ALOCFAIL Cannot allocate an ITC_Task object
ITC_NOTINIT ITC has not been initialized
ITC_SUCCESS Success
ITC_TASKQUEU Cannot create task queues
ITC_TASKRNG Task ID not valid for an application task
ITC_TASKSTAT Task not in state undefined
ITC_createTask() creates a bare task structure that can be further configured by calls to other task configuration routines. See ITC_addQueue(), ITC_attachRaw(), ITC_attachApid(), ITC_attachCommand(). Once the task configuration is completed, the task can be started with a call to ITC_startTask().

Here is the call graph for this function:

unsigned int ITC_createTaskLite struct _ITC_Task **  task,
ITC_TaskID  tid
 

Create a lightweight ITC task.

Parameters:
task (out) Task handle
tid (in) Task ID (taken from preassigned lightweight list)
Return values:
ITC_ALOCFAIL Cannot allocate an ITC_Task object
ITC_NOTINIT ITC has not been initialized
ITC_SUCCESS Success
ITC_TASKRNG Task ID not valid for a lightweight task
ITC_TASKSTAT Task not in state undefined
ITC_createTaskLite() creates a lightweight ITC task structure. This can be registered by a non-ITC task to give the task some (but not all) of the features of an ITC task.

unsigned int ITC_deleteTask struct _ITC_Task task  ) 
 

Delete a task container.

Parameters:
task (in) Task handle
Return values:
ITC_NOTINIT ITC has not been initialized
ITC_SUCCESS Success
ITC_TASKHNDL Task handle is invalid
ITC_TASKNULL Task not in task table
ITC_TASKSTAT Task not in state initialized

Here is the call graph for this function:

unsigned int ITC_detachApid const ITC_ApidDef def  ) 
 

Detach an APID definition from a queue.

Parameters:
def (in) APID definition
Return values:
ITC_NOAPID APID command table not attached to a queue
ITC_NOTINIT ITC has not been initialized
ITC_SUCCESS Success
ITC_TASKSTAT Task not in state initialized

Here is the call graph for this function:

unsigned int ITC_detachCmd struct _ITC_Task task,
ITC_QueueID  qid
 

Detach a command list from a queue.

Parameters:
task (in) Task handle
qid (in) Queue ID
Return values:
ITC_NOCMD No command table attached to the queue
ITC_NOTINIT ITC has not been initialized
ITC_QUEURNG Queue ID is out of range
ITC_QUEUSTAT Queue not in state initialized
ITC_SUCCESS Success
ITC_TASKHNDL Task handle is invalid
ITC_TASKSTAT Task not in state initialized

unsigned int ITC_detachRaw struct _ITC_Task task,
ITC_QueueID  qid
 

Detach a raw processor from a queue.

Parameters:
task (in) Task handle
qid (in) Queue ID
Return values:
ITC_NORAW No raw protocol handler defined for this queue
ITC_NOTINIT ITC has not been initialized
ITC_QUEURNG Queue ID is out of range
ITC_QUEUSTAT Queue not in state initialized
ITC_SUCCESS Success
ITC_TASKHNDL Task handle is invalid
ITC_TASKSTAT Task not in state initialized

struct _ITC_Task * ITC_getTaskHandle ITC_TaskID  tid  ) 
 

Return the task handle for a given task ID.

Return values:
NULL tid out or range or task not created
x Task handle
Warning:
Why do I have this feeling that I'm going to regret making this entry point available?
ITC_getTaskHandle() returns the task handle for the given task ID

ITC_NodeID ITC_getTaskID void   ) 
 

Return the ITC task ID of the calling task (if it's an ITC task).

Returns:
A task ID from the ITC_TaskID enumeration
Warning:
Not all tasks are ITC tasks. If a non-ITC task calls this routine, the value ITC_TID_UNKNOWN will be returned.
ITC_getTaskID() returns the task ID for the calling task.

unsigned int ITC_removeQueue struct _ITC_Task task,
ITC_QueueID  qid
 

Remove a queue from a task.

Parameters:
task (in) Task handle
qid (in) Queue ID
Return values:
ITC_ALOCLIVE Memory allocator for this queue is still live
ITC_ALOCOUT Memory allocations still outstanding for this queue
ITC_NOTINIT ITC has not been initialized
ITC_QUEUITC Queue ID reserved for ITC
ITC_QUEURNG Queue ID is out of range
ITC_SUCCESS Success
ITC_TASKHNDL Task handle is invalid
ITC_TASKSTAT Task not in state initialized

Here is the call graph for this function:

unsigned int ITC_startTask struct _ITC_Task task,
const TASK_attr *  attr,
ITC_cb_StartTask rtn,
void *  prm
 

Fork a task with the queues described in the task handle.

Parameters:
task (in) Task handle
attr (in) Task attributes (can be NULL)
rtn (in) User's task startup routine (can be NULL)
prm (in) User's task startup routine parameter
Return values:
ITC_ALOCFAIL Cannot allocate for fork control block
ITC_FORKINIT Fork initialization failed
ITC_FORKQHND Cannot recover all fork queue handles (obscure)
ITC_NOTINIT ITC has not been initialized
ITC_SUCCESS Success
ITC_TASKHNDL Task handle is invalid
ITC_TASKINIT Cannot set up task intialization
ITC_TASKSTAT Task not in state initialized

Here is the call graph for this function:

unsigned int ITC_stopTask struct _ITC_Task task  ) 
 

Stop an ITC task.

Warning:
This routine is blocking (on FORK_join)
Return values:
ITC_NOTINIT ITC has not been initialized
ITC_SUCCESS Success
ITC_TASKHNDL Task handle is invalid
ITC_TASKSTAT Task not in state started


Generated on Thu Mar 3 20:44:01 2005 by doxygen 1.3.3