GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> ITC / V3-9-1 > itc / linux-gcc
#include <string.h>
#include "PBI/TBD_id.h"
#include "PBS/FFS.ih"
#include "PBS/FORK.h"
#include "PBS/MBA.h"
#include "PBS/TBD.ih"
#include "MSG/MSG_pubdefs.h"
#include "CCSDS/CCSDS_pkt.h"
#include "ITC/ITC_msgs.h"
#include "ITC_inline.ih"
#include "ITC_prvdefs.h"
Functions | |
static FORK_cb_status | ableQueues (unsigned int iqm, unsigned int opt) |
Enable/disable fork queues. | |
static unsigned int | checkState (ITC_ControlState creq, ITC_Task *tsk, ITC_TaskState treq, const char *func) |
Check the state of master and task control blocks. | |
static unsigned int | createQueues (ITC_TaskID tid, unsigned int want) |
Allocate and initialize a block of queues. | |
static void | deleteQueues (ITC_TaskID tid, unsigned int have) |
De-allocate a block of queues. | |
static unsigned int | startTask (ITC_Task *task, const TASK_attr *attr, ITC_cb_Meta *rtn, void *prm, unsigned int wait) |
Fork a task with the queues described in the task handle. | |
unsigned int | ITC_addQueue (ITC_Task *task, ITC_QueueID qid) |
Add a queue to a task. | |
unsigned int | ITC_attachApid (ITC_Task *task, ITC_QueueID qid, const ITC_ApidDef *def, void *prm) |
Attach an APID definition to a queue. | |
unsigned int | ITC_attachCommand (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_attachMemory (ITC_Task *task, ITC_QueueID qid, ITC_cb_Memory *rtn, void *prm) |
Attach a memory manager description to a queue. | |
unsigned int | ITC_attachRaw (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_convertDispatch (ITC_Task *task, ITC_QueueID qid, ITC_cb_Dispatch *rtn, void *prm) |
Modify the task dispatch routine with a new plug-in. | |
unsigned int | ITC_convertFork (ITC_Task *task, ITC_QueueID qid, FORK_cb_rtn rtn, void *prm) |
Modify a queue to be a pure fork queue. | |
unsigned int | ITC_convertTaskLite (ITC_Task *task) |
Convert a task to a lightweight ITC task. | |
unsigned int | ITC_createTask (ITC_Task **task, ITC_TaskID tid) |
Create a task level container for queues. | |
unsigned int | ITC_deleteTask (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_detachCommand (ITC_Task *task, ITC_QueueID qid) |
Detach a command list from a queue. | |
unsigned int | ITC_detachMemory (ITC_Task *task, ITC_QueueID qid) |
Detach a memory control description from a queue. | |
unsigned int | ITC_detachRaw (ITC_Task *task, ITC_QueueID qid) |
Detach a raw processor from a queue. | |
FORK_cb_status | ITC_disableQueues (unsigned int iqm) |
Disable a set of ITC queues. | |
FORK_cb_status | ITC_enableQueues (unsigned int iqm) |
Enable a set of ITC queues. | |
FORK_cb_status | ITC_isTaskDrained (ITC_Task *task) |
Determine if a task has drained all its activities. | |
unsigned int | ITC_removeQueue (ITC_Task *task, ITC_QueueID qid) |
Remove a queue from a task. | |
unsigned int | ITC_redirectApid (unsigned int APID, ITC_TaskID ntid, ITC_QueueID nqid, ITC_TaskID *otid, ITC_QueueID *oqid) |
Redirect APID dispatch to a new task/queue. | |
unsigned int | ITC_revertDispatch (ITC_Task *task, ITC_QueueID qid) |
Revert the task dispatch routine to the default plug-in. | |
unsigned int | ITC_revertTaskLite (ITC_Task *task) |
Revert a lightweight ITC task to a regular task. | |
unsigned int | ITC_startTask (ITC_Task *task, const TASK_attr *attr, ITC_cb_Meta *rtn, void *prm) |
Fork the specified ITC task (non-blocking version). | |
unsigned int | ITC_startTaskW (ITC_Task *task, const TASK_attr *attr, ITC_cb_Meta *rtn, void *prm) |
Fork the specified ITC task (blocking version). | |
unsigned int | ITC_stopTask (ITC_Task *task, ITC_cb_Meta *rtn, void *prm) |
Stop an ITC task. | |
Variables | |
const char * | ITC_tsk_states [ITC_L_TSK_STATES] |
String constants for ITC task control block states. | |
const char * | ITC_tsk_types [ITC_L_TSK_TYPES] |
String constants for ITC task types. | |
static const char | s_initialized [] = { "initialized" } |
The string "initialized". | |
static const char | s_uninitialized [] = { "uninitialized" } |
The string "initialized". |
CVS $Id: ITC_task.c,v 1.16 2007/08/24 20:14:39 apw Exp $
static FORK_cb_status ableQueues | ( | unsigned int | iqm, | |
unsigned int | opt | |||
) | [inline, static] |
Enable/disable fork queues.
iqm | (in) ITC queue mask (or of members of ITC_QIM_xxx) | |
opt | (in) Enable/disable (0/1 enable/disable) |
FORK_C_CONTINUE | Continue fork | |
~FORK_C_CONTINUE | Shut down fork |
static unsigned int checkState | ( | ITC_ControlState | creq, | |
ITC_Task * | tsk, | |||
ITC_TaskState | treq, | |||
const char * | func | |||
) | [inline, static] |
Check the state of master and task control blocks.
creq | (in) Required state of ITC master control block | |
tsk | (in) Task handle | |
treq | (in) Required state of task control block | |
func | (in) Name of function calling this routine |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Invalid task handle | |
ITC_TASKSTAT | Invalid task state for this operation |
static unsigned int createQueues | ( | ITC_TaskID | tid, | |
unsigned int | want | |||
) | [inline, static] |
Allocate and initialize a block of queues.
tid | (in) Task ID for which to create queues | |
want | (in) Bit-mask of queues requested |
static void deleteQueues | ( | ITC_TaskID | tid, | |
unsigned int | have | |||
) | [inline, static] |
De-allocate a block of queues.
tid | (in) Task ID for which to delete queues | |
have | (in) Bit-mask of queues to delete |
unsigned int ITC_addQueue | ( | ITC_Task * | task, | |
ITC_QueueID | qid | |||
) |
Add a queue to a task.
task | (in) Task handle | |
qid | (in) Queue ID |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_QUEUITC | Queue ID reserved for ITC | |
ITC_QUEUINIT | Queue initialization failed | |
ITC_QUEUSTAT | Queue not in state undefined | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKSTAT | Invalid task state for this operation | |
ITC_VARRNG | Out of range variable detected |
unsigned int ITC_attachApid | ( | ITC_Task * | task, | |
ITC_QueueID | qid, | |||
const ITC_ApidDef * | def, | |||
void * | prm | |||
) |
Attach an APID definition to a queue.
task | (in) Task handle | |
qid | (in) Queue ID | |
def | (in) APID definition | |
prm | (in) User context parameter (per APID) |
ITC_ALOCFAIL | Cannot allocate for an ITC_Apid object | |
ITC_APIDDBL | Table entry for this APID already in use | |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_QUEUSTAT | Queue not in state initialized | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKSTAT | Invalid task state for this operation | |
ITC_VARRNG | Out of range variable detected |
unsigned int ITC_attachCommand | ( | ITC_Task * | task, | |
ITC_QueueID | qid, | |||
const ITC_CommandList * | lst, | |||
void * | prm | |||
) |
Attach a command list to a queue (only one per queue).
task | (in) Task handle | |
qid | (in) Queue ID | |
lst | (in) A command list | |
prm | (in) User context parameter (per command list) |
ITC_CMDDBL | Command entry for this queue alrady in use | |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_QUEUSTAT | Queue not in state initialized | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKSTAT | Invalid task state for this operation | |
ITC_VARRNG | Out of range variable detected |
unsigned int ITC_attachMemory | ( | ITC_Task * | task, | |
ITC_QueueID | qid, | |||
ITC_cb_Memory * | rtn, | |||
void * | prm | |||
) |
Attach a memory manager description to a queue.
task | (in) Task handle | |
qid | (in) Queue ID | |
rtn | (in) Memory allocation routine | |
prm | (in) Memory allocation routine parameter |
ITC_ALOCFAIL | Cannot allocate for an ITC_Apid object | |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_MEMDBL | Memory control description block already attached | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_QUEUSTAT | Queue not in state initialized | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKSTAT | Invalid task state for this operation | |
ITC_VARRNG | Out of range variable detected |
unsigned int ITC_attachRaw | ( | ITC_Task * | task, | |
ITC_QueueID | qid, | |||
ITC_cb_Processor * | rtn, | |||
void * | prm | |||
) |
Attach a raw processor to a queue (only one per queue).
task | (in) Task handle | |
qid | (in) Queue ID | |
rtn | (in) Callback for raw packets | |
prm | (in) User context parameter (per raw processor) |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_RAWDBL | Raw protocol handler for this queue already defined | |
ITC_RAWRTN | Cannot specify a NULL routine | |
ITC_QUEUSTAT | Queue not in state initialized | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKSTAT | Invalid task state for this operation | |
ITC_VARRNG | Out of range variable detected |
unsigned int ITC_convertDispatch | ( | ITC_Task * | task, | |
ITC_QueueID | qid, | |||
ITC_cb_Dispatch * | rtn, | |||
void * | prm | |||
) |
Modify the task dispatch routine with a new plug-in.
task | (in) Task handle | |
qid | (in) Queue ID | |
rtn | (in) Plug-in routine | |
prm | (in) Plug-in routine parameter |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_QUEUSTAT | Queue not in state initialized | |
ITC_SUCCESS | Success | |
ITC_TASKDISP | NULL dispatch routine specified | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKSTAT | Invalid task state for this operation | |
ITC_TASKTYP | Invalid call for a lightweight task | |
ITC_VARRNG | Out of range variable detected |
unsigned int ITC_convertFork | ( | ITC_Task * | task, | |
ITC_QueueID | qid, | |||
FORK_cb_rtn | rtn, | |||
void * | prm | |||
) |
Modify a queue to be a pure fork queue.
task | (in) Task handle | |
qid | (in) Queue ID | |
rtn | (in) Fork callback routine | |
prm | (in) Fork callback routine parameter |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_QUEUSTAT | Queue not in state initialized | |
ITC_SUCCESS | Success | |
ITC_TASKDISP | NULL dispatch routine specified | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKSTAT | Invalid task state for this operation | |
ITC_TASKTYP | Invalid call for a lightweight task | |
ITC_VARRNG | Out of range variable detected |
unsigned int ITC_convertTaskLite | ( | ITC_Task * | task | ) |
Convert a task to a lightweight ITC task.
task | (in) Task handle |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Invalid task handle | |
ITC_TASKSTAT | Invalid task state for this operation |
unsigned int ITC_createTask | ( | ITC_Task ** | task, | |
ITC_TaskID | tid | |||
) |
Create a task level container for queues.
task | (out) Task handle (pass to other task configuration routines) | |
tid | (in) Task ID (taken from preassigned application list) |
ITC_ALOCFAIL | Cannot allocate an ITC_Task object | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_SUCCESS | Success | |
ITC_TASKQUEU | Cannot create task queues | |
ITC_TASKSTAT | Invalid task state for this operation | |
ITC_VARRNG | Out of range variable detected |
unsigned int ITC_deleteTask | ( | ITC_Task * | task | ) |
Delete a task container.
task | (in) Task handle |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKMISS | Task not in task table | |
ITC_TASKSTAT | Invalid task state for this operation |
unsigned int ITC_detachApid | ( | const ITC_ApidDef * | def | ) |
Detach an APID definition from a queue.
def | (in) APID definition |
ITC_APIDNONE | APID command table not attached to a queue | |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Invalid task handle | |
ITC_TASKSTAT | Invalid task state for this operation |
unsigned int ITC_detachCommand | ( | ITC_Task * | task, | |
ITC_QueueID | qid | |||
) |
Detach a command list from a queue.
task | (in) Task handle | |
qid | (in) Queue ID |
ITC_CMDNONE | No command table attached to the queue | |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_QUEUSTAT | Queue not in state initialized | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKSTAT | Invalid task state for this operation | |
ITC_VARRNG | Out of range variable detected |
unsigned int ITC_detachMemory | ( | ITC_Task * | task, | |
ITC_QueueID | qid | |||
) |
Detach a memory control description from a queue.
task | (in) Task handle | |
qid | (in) Queue ID |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_MEMNONE | No memory descriptor defined for this task/queue | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_QUEUSTAT | Queue not in state initialized | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKSTAT | Invalid task state for this operation | |
ITC_VARRNG | Out of range variable detected |
unsigned int ITC_detachRaw | ( | ITC_Task * | task, | |
ITC_QueueID | qid | |||
) |
Detach a raw processor from a queue.
task | (in) Task handle | |
qid | (in) Queue ID |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_RAWNONE | No raw protocol handler defined for this queue | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_QUEUSTAT | Queue not in state initialized | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKSTAT | Invalid task state for this operation | |
ITC_VARRNG | Out of range variable detected |
FORK_cb_status ITC_disableQueues | ( | unsigned int | iqm | ) |
Disable a set of ITC queues.
iqm | (in) ITC queue mask (or of members of ITC_QIM_xxx) |
FORK_C_CONTINUE | Continue fork | |
~FORK_C_CONTINUE | Shut down fork |
FORK_cb_status ITC_enableQueues | ( | unsigned int | iqm | ) |
Enable a set of ITC queues.
iqm | (in) ITC queue mask (or of members of ITC_QIM_xxx) |
FORK_C_CONTINUE | Continue fork | |
~FORK_C_CONTINUE | Shut down fork |
FORK_cb_status ITC_isTaskDrained | ( | ITC_Task * | task | ) |
Determine if a task has drained all its activities.
task | (in) ITC task handle |
FORK_C_CONTINUE | Continue fork | |
~FORK_C_CONTINUE | Shut down fork |
unsigned int ITC_redirectApid | ( | unsigned int | APID, | |
ITC_TaskID | ntid, | |||
ITC_QueueID | nqid, | |||
ITC_TaskID * | otid, | |||
ITC_QueueID * | oqid | |||
) |
Redirect APID dispatch to a new task/queue.
APID | (in) APID to redirect | |
ntid | (in) New task destination of APID dispatch | |
nqid | (in) New queue destination of APID dispatch | |
otid | (out) Old task destination of APID dispatch | |
oqid | (out) Old queue destination of APID dispatch |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_RAWDBL | Raw protocol handler for this queue already defined | |
ITC_RAWRTN | Cannot specify a NULL routine | |
ITC_QUEUSTAT | Queue not in state initialized | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKSTAT | Invalid task state for this operation | |
ITC_VARRNG | Out of range variable detected |
unsigned int ITC_removeQueue | ( | ITC_Task * | task, | |
ITC_QueueID | qid | |||
) |
Remove a queue from a task.
task | (in) Task handle | |
qid | (in) Queue ID |
ITC_ALOCLIVE | Memory allocator for this queue is still live | |
ITC_ALOCOUT | Memory allocations still outstanding for this queue | |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_QUEUITC | Queue ID reserved for ITC | |
ITC_QUEUMISS | No entry in queue table for this task/queue | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKSTAT | Invalid task state for this operation | |
ITC_VARRNG | Out of range variable detected |
unsigned int ITC_revertDispatch | ( | ITC_Task * | task, | |
ITC_QueueID | qid | |||
) |
Revert the task dispatch routine to the default plug-in.
task | (in) Task handle | |
qid | (in) Queue ID |
ITC_APIDRNG | Invalid APID | |
ITC_APIDTBL | No APID table entry for APID | |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKSTAT | Invalid task state for this operation | |
ITC_TASKTYP | Invalid call for a lightweight task | |
ITC_VARRNG | Out of range variable detected |
unsigned int ITC_revertTaskLite | ( | ITC_Task * | task | ) |
Revert a lightweight ITC task to a regular task.
task | (in) Task handle |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Invalid task handle | |
ITC_TASKSTAT | Invalid task state for this operation |
unsigned int ITC_startTask | ( | ITC_Task * | task, | |
const TASK_attr * | attr, | |||
ITC_cb_Meta * | rtn, | |||
void * | prm | |||
) |
Fork the specified ITC task (non-blocking version).
task | (in) Task handle | |
attr | (in) Task attributes (can be NULL) | |
rtn | (in) User's task start routine (can be NULL) | |
prm | (in) User's task start routine parameter |
ITC_ALOCFAIL | Cannot allocate for fork control block | |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_FORKINIT | Fork initialization failed | |
ITC_FORKQHND | Cannot recover all fork queue handles (obscure) | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKINIT | Cannot set up task intialization | |
ITC_TASKSTAT | Invalid task state for this operation |
unsigned int ITC_startTaskW | ( | ITC_Task * | task, | |
const TASK_attr * | attr, | |||
ITC_cb_Meta * | rtn, | |||
void * | prm | |||
) |
Fork the specified ITC task (blocking version).
task | (in) Task handle | |
attr | (in) Task attributes (can be NULL) | |
rtn | (in) User's task start routine (can be NULL) | |
prm | (in) User's task start routine parameter |
ITC_ALOCFAIL | Cannot allocate for fork control block | |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_FORKINIT | Fork initialization failed | |
ITC_FORKQHND | Cannot recover all fork queue handles (obscure) | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKINIT | Cannot set up task intialization | |
ITC_TASKSTAT | Invalid task state for this operation |
unsigned int ITC_stopTask | ( | ITC_Task * | task, | |
ITC_cb_Meta * | rtn, | |||
void * | prm | |||
) |
Stop an ITC task.
task | (in) Task handle | |
rtn | (in) User's task stop routine (can be NULL) | |
prm | (in) User's task stop routine parameter |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKSTAT | Invalid task state for this operation |
static unsigned int startTask | ( | ITC_Task * | task, | |
const TASK_attr * | attr, | |||
ITC_cb_Meta * | rtn, | |||
void * | prm, | |||
unsigned int | wait | |||
) | [static] |
Fork a task with the queues described in the task handle.
task | (in) Task handle | |
attr | (in) Task attributes (can be NULL) | |
rtn | (in) User's task start routine (can be NULL) | |
prm | (in) User's task start routine parameter | |
wait | (in) Flag indicating that startTask should wait for task start |
ITC_ALOCFAIL | Cannot allocate for fork control block | |
ITC_CTLSTAT | ITC control block not in state initialized | |
ITC_FORKINIT | Fork initialization failed | |
ITC_FORKQHND | Cannot recover all fork queue handles (obscure) | |
ITC_NOTINIT | ITC control block does not exist | |
ITC_SUCCESS | Success | |
ITC_TASKHNDL | Task handle is invalid | |
ITC_TASKINIT | Cannot set up task intialization | |
ITC_TASKSTAT | Invalid task state for this operation |
const char* ITC_tsk_states[ITC_L_TSK_STATES] |
Initial value:
{ "uninitialized", "initialized", "starting", "started", "stopsync", "stopping", "converted" }
const char * ITC_tsk_types[ITC_L_TSK_TYPES] |
Initial value:
{ "service", "application", "lightweight" }