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


Interface   Data Structures   File List   Data Fields   Globals  

ITC_task.c File Reference

ITC task/service configuration routines. More...

#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".


Detailed Description

ITC task/service configuration routines.

CVS $Id: ITC_task.c,v 1.17 2011/03/25 21:01:11 apw Exp $
Author:
A.P.Waite
ITC_task.c provides the interfaces to configure ITC based tasks.

Function Documentation

static FORK_cb_status ableQueues ( unsigned int  iqm,
unsigned int  opt 
) [inline, static]

Enable/disable fork queues.

Parameters:
iqm (in) ITC queue mask (or of members of ITC_QIM_xxx)
opt (in) Enable/disable (0/1 enable/disable)
Return values:
FORK_C_CONTINUE Continue fork
~FORK_C_CONTINUE Shut down fork

References _ITC_Task::enable, _ITC_Task::fcb, _ITC_Queue::fqm, ITC_getTaskID(), ITC_isTaskDrained(), ITC_QIM_METAHI, ITC_QIM_METALO, ITC_qpl, ITC_TID_NONE, ITC_tpl, ITC_TSK_STOPPING, _ITC_Task::mskall, _ITC_Task::mskdis, _ITC_Task::state, and _ITC_Task::tid.

Referenced by ITC_disableQueues(), and ITC_enableQueues().

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.

Parameters:
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
Return values:
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
checkState() is a state integrity checker. It demands that the master control block exists and be in state creq, it also demands that the task control block exists and be in state treq. If these conditions are met, the routine returns ITC_SUCCESS, otherwise it generates a message and returns with a non-ITC_SUCCESS message.

Warning:
If successful, the master control block will be returned with the mutex locked. Any failure and the mutex is returned unlocked.

References _ITC_Task::chk, ITC_ctl_states, ITC_icb, _ITC_Control::mtx, _ITC_Task::state, _ITC_Control::state, and _ITC_Task::tid.

Referenced by ITC_addQueue(), ITC_attachApid(), ITC_attachCommand(), ITC_attachMemory(), ITC_attachRaw(), ITC_convertDispatch(), ITC_convertFork(), ITC_convertTaskLite(), ITC_deleteTask(), ITC_detachApid(), ITC_detachCommand(), ITC_detachMemory(), ITC_detachRaw(), ITC_redirectApid(), ITC_removeQueue(), ITC_revertDispatch(), ITC_revertTaskLite(), ITC_stopTask(), and startTask().

static 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

References _ITC_Queue::chk, _ITC_Queue::dspPrm, _ITC_Queue::dspRtn, ITC_dispatchApp(), ITC_qpl, _ITC_Queue::qid, and _ITC_Queue::tid.

Referenced by ITC_addQueue(), and ITC_createTask().

static 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

References ITC_qpl.

Referenced by ITC_addQueue(), and ITC_createTask().

unsigned int ITC_addQueue ( ITC_Task task,
ITC_QueueID  qid 
)

Add a queue to a task.

Parameters:
task (in) Task handle
qid (in) Queue ID
Return values:
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

References checkState(), createQueues(), deleteQueues(), ITC_CTL_INITIALIZED, ITC_icb, ITC_K_USERQS, ITC_L_USERQS, ITC_qpl, ITC_TSK_INITIALIZED, ITC_TSK_TYP_LITE, _ITC_Task::mskall, _ITC_Control::mtx, _ITC_Task::tid, and _ITC_Task::typ.

unsigned int ITC_attachApid ( 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)
Warning:
Caller is responsible for ensuring the persistence of the ITC_ApidDef structure and the validity of the context parameter. This routine only captures pointers.
Return values:
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
Attach an APID definition structure to a queue.

References _ITC_ApidDef::apid, checkState(), _ITC_Apid::def, ITC_apl, ITC_CTL_INITIALIZED, ITC_icb, ITC_K_USERQS, ITC_L_USERQS, ITC_qpl, ITC_TSK_INITIALIZED, ITC_TSK_TYP_APP, _ITC_Control::mtx, _ITC_Apid::prm, _ITC_Apid::qid, _ITC_Apid::rsvd, _ITC_Apid::tid, _ITC_Task::tid, _ITC_Task::typ, and validApidRx().

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).

Parameters:
task (in) Task handle
qid (in) Queue ID
lst (in) A command list
prm (in) User context parameter (per command list)
Warning:
Caller is responsible for ensuring the persistence of the ITC_CommandList structure and the validity of the context parameter. This routine only captures pointers.
Return values:
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

References checkState(), _ITC_Queue::cmdLst, _ITC_Queue::cmdPrm, ITC_CTL_INITIALIZED, ITC_icb, ITC_K_USERQS, ITC_L_USERQS, ITC_qpl, ITC_TSK_INITIALIZED, ITC_TSK_TYP_APP, _ITC_Control::mtx, _ITC_Task::tid, and _ITC_Task::typ.

unsigned int ITC_attachMemory ( ITC_Task task,
ITC_QueueID  qid,
ITC_cb_Memory rtn,
void *  prm 
)

Attach a memory manager description to a queue.

Parameters:
task (in) Task handle
qid (in) Queue ID
rtn (in) Memory allocation routine
prm (in) Memory allocation routine parameter
Return values:
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
ITC_attachMemory() attaches an abstract memory manager to a queue so that driver level tasks can allocate memory from applications tasks.

References checkState(), ITC_CTL_INITIALIZED, ITC_icb, ITC_K_USERQS, ITC_L_USERQS, ITC_qpl, ITC_TSK_INITIALIZED, _ITC_Queue::memPrm, _ITC_Queue::memRtn, _ITC_Control::mtx, and _ITC_Task::tid.

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).

Parameters:
task (in) Task handle
qid (in) Queue ID
rtn (in) Callback for raw packets
prm (in) User context parameter (per raw processor)
Warning:
Caller is responsible for ensuring the persistence and validity of the context parameter. This routine only captures pointers.
Return values:
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

References checkState(), ITC_CTL_INITIALIZED, ITC_icb, ITC_K_USERQS, ITC_L_USERQS, ITC_qpl, ITC_TSK_INITIALIZED, ITC_TSK_TYP_LITE, _ITC_Control::mtx, _ITC_Queue::rawPrm, _ITC_Queue::rawRtn, _ITC_Task::tid, and _ITC_Task::typ.

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.

Parameters:
task (in) Task handle
qid (in) Queue ID
rtn (in) Plug-in routine
prm (in) Plug-in routine parameter
Warning:
Caller is responsible for ensuring the persistence and validity of the context parameter. This routine only captures pointers.
Return values:
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

References checkState(), _ITC_Queue::dspPrm, _ITC_Queue::dspRtn, ITC_CTL_INITIALIZED, ITC_icb, ITC_K_USERQS, ITC_L_USERQS, ITC_qpl, ITC_TSK_INITIALIZED, ITC_TSK_TYP_LITE, _ITC_Control::mtx, _ITC_Task::tid, and _ITC_Task::typ.

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.

Parameters:
task (in) Task handle
qid (in) Queue ID
rtn (in) Fork callback routine
prm (in) Fork callback routine parameter
Warning:
Caller is responsible for ensuring the persistence and validity of the context parameter. This routine only captures pointers.
Return values:
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

References checkState(), _ITC_Queue::frk, _ITC_Queue::frkPrm, _ITC_Queue::frkRtn, ITC_CTL_INITIALIZED, ITC_icb, ITC_K_USERQS, ITC_L_USERQS, ITC_qpl, ITC_TSK_INITIALIZED, ITC_TSK_TYP_LITE, _ITC_Control::mtx, _ITC_Task::tid, and _ITC_Task::typ.

unsigned int ITC_convertTaskLite ( ITC_Task task  ) 

Convert a task to a lightweight ITC task.

Parameters:
task (in) Task handle
Return values:
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
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.

References checkState(), ITC_CTL_INITIALIZED, ITC_icb, ITC_K_LITES, ITC_L_LITES, ITC_TSK_CONVERTED, ITC_TSK_INITIALIZED, ITC_TSK_TYP_LITE, _ITC_Control::mtx, _ITC_Task::state, _ITC_Task::tbd, _ITC_Task::tid, and _ITC_Task::typ.

unsigned int ITC_createTask ( 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 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
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().

References _ITC_CommandCount::bad, _ITC_Task::chk, _ITC_TaskConfirm::cmd, _ITC_Task::cnf, _ITC_Control::cnt, _ITC_CommandCount::cnt, createQueues(), deleteQueues(), _ITC_TaskConfirm::drp, _ITC_Task::enable, _ITC_Task::fcb, ITC_CTL_INITIALIZED, ITC_ctl_states, ITC_icb, ITC_K_APPS, ITC_K_SVCS, ITC_L_APPS, ITC_L_SVCS, ITC_L_TASKS, ITC_LVL_ALL, ITC_LVL_ERROR, ITC_QID_METAHI, ITC_QID_METALO, ITC_tpl, ITC_TSK_INITIALIZED, ITC_TSK_TYP_APP, ITC_TSK_TYP_LITE, ITC_TSK_TYP_SVC, _ITC_TaskConfirm::level, _ITC_Task::mskall, _ITC_Task::mskdis, _ITC_Control::mtx, _ITC_TaskConfirm::prm, _ITC_TaskConfirm::rtn, _ITC_Task::sem, _ITC_Task::state, _ITC_Control::state, _ITC_Task::stopPrm, _ITC_Task::stopRtn, _ITC_Task::tbd, _ITC_Task::tid, _ITC_CommandCount::tim, _ITC_Task::tran, and _ITC_Task::typ.

unsigned int ITC_deleteTask ( ITC_Task task  ) 

Delete a task container.

Parameters:
task (in) Task handle
Return values:
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

References checkState(), _ITC_Control::cnt, ITC_apl, ITC_CTL_INITIALIZED, ITC_icb, ITC_L_QUEUES, ITC_qpl, ITC_tpl, ITC_TSK_INITIALIZED, _ITC_Control::mtx, _ITC_Task::sem, _ITC_Apid::tid, and _ITC_Task::tid.

unsigned int ITC_detachApid ( const ITC_ApidDef def  ) 

Detach an APID definition from a queue.

Parameters:
def (in) APID definition
Return values:
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

References _ITC_ApidDef::apid, checkState(), ITC_apl, ITC_CTL_INITIALIZED, ITC_icb, ITC_tpl, ITC_TSK_INITIALIZED, _ITC_Control::mtx, _ITC_Apid::tid, and validApidRx().

unsigned int ITC_detachCommand ( 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_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

References checkState(), _ITC_Queue::cmdLst, _ITC_Queue::cmdPrm, ITC_CTL_INITIALIZED, ITC_icb, ITC_K_USERQS, ITC_L_USERQS, ITC_qpl, ITC_TSK_INITIALIZED, _ITC_Control::mtx, and _ITC_Task::tid.

unsigned int ITC_detachMemory ( ITC_Task task,
ITC_QueueID  qid 
)

Detach a memory control description from a queue.

Parameters:
task (in) Task handle
qid (in) Queue ID
Return values:
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

References checkState(), ITC_CTL_INITIALIZED, ITC_icb, ITC_K_USERQS, ITC_L_USERQS, ITC_qpl, ITC_TSK_INITIALIZED, _ITC_Queue::memPrm, _ITC_Queue::memRtn, _ITC_Control::mtx, and _ITC_Task::tid.

unsigned int ITC_detachRaw ( 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_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

References checkState(), ITC_CTL_INITIALIZED, ITC_icb, ITC_K_USERQS, ITC_L_USERQS, ITC_qpl, ITC_TSK_INITIALIZED, _ITC_Control::mtx, _ITC_Queue::rawPrm, _ITC_Queue::rawRtn, and _ITC_Task::tid.

FORK_cb_status ITC_disableQueues ( unsigned int  iqm  ) 

Disable a set of ITC queues.

Parameters:
iqm (in) ITC queue mask (or of members of ITC_QIM_xxx)
Return values:
FORK_C_CONTINUE Continue fork
~FORK_C_CONTINUE Shut down fork

References ableQueues().

FORK_cb_status ITC_enableQueues ( unsigned int  iqm  ) 

Enable a set of ITC queues.

Parameters:
iqm (in) ITC queue mask (or of members of ITC_QIM_xxx)
Return values:
FORK_C_CONTINUE Continue fork
~FORK_C_CONTINUE Shut down fork

References ableQueues().

FORK_cb_status ITC_isTaskDrained ( ITC_Task task  ) 

Determine if a task has drained all its activities.

Parameters:
task (in) ITC task handle
Return values:
FORK_C_CONTINUE Continue fork
~FORK_C_CONTINUE Shut down fork

References _ITC_Queue::cnt, ITC_L_QUEUES, ITC_qpl, _ITC_Task::mskdis, _ITC_Task::stopPrm, _ITC_Task::stopRtn, _ITC_Task::tbd, and _ITC_Task::tid.

Referenced by ableQueues(), ITC_dispatch(), and ITC_stopMeta().

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.

Parameters:
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
Return values:
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

References checkState(), _ITC_Task::chk, ITC_apl, ITC_CTL_INITIALIZED, ITC_icb, ITC_K_APPS, ITC_K_USERQS, ITC_L_APPS, ITC_L_USERQS, ITC_tpl, ITC_TSK_INITIALIZED, ITC_TSK_TYP_APP, _ITC_Control::mtx, _ITC_Apid::qid, _ITC_Task::state, _ITC_Apid::tid, _ITC_Task::typ, and validApidRx().

unsigned int ITC_removeQueue ( 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_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

References checkState(), _ITC_Queue::cmdLst, ITC_apl, ITC_CTL_INITIALIZED, ITC_icb, ITC_K_USERQS, ITC_L_USERQS, ITC_qpl, ITC_TSK_INITIALIZED, ITC_TSK_TYP_LITE, _ITC_Queue::memRtn, _ITC_Task::mskall, _ITC_Control::mtx, _ITC_Apid::qid, _ITC_Queue::rawRtn, _ITC_Apid::tid, _ITC_Task::tid, and _ITC_Task::typ.

unsigned int ITC_revertDispatch ( ITC_Task task,
ITC_QueueID  qid 
)

Revert the task dispatch routine to the default plug-in.

Parameters:
task (in) Task handle
qid (in) Queue ID
Return values:
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

References checkState(), _ITC_Queue::dspPrm, _ITC_Queue::dspRtn, ITC_CTL_INITIALIZED, ITC_dispatchApp(), ITC_icb, ITC_K_USERQS, ITC_L_USERQS, ITC_qpl, ITC_TSK_INITIALIZED, ITC_TSK_TYP_LITE, _ITC_Control::mtx, _ITC_Task::tid, and _ITC_Task::typ.

unsigned int ITC_revertTaskLite ( ITC_Task task  ) 

Revert a lightweight ITC task to a regular task.

Parameters:
task (in) Task handle
Return values:
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
Warning:
This routine must be called in the context of the task wishing to be reverted.
ITC_revertTaskLite() reverts a lightweight ITC task to a regular task.

References checkState(), ITC_CTL_INITIALIZED, ITC_icb, ITC_K_LITES, ITC_L_LITES, ITC_TSK_CONVERTED, ITC_TSK_INITIALIZED, ITC_TSK_TYP_LITE, _ITC_Control::mtx, _ITC_Task::state, _ITC_Task::tbd, _ITC_Task::tid, and _ITC_Task::typ.

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).

Parameters:
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
Return values:
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

References startTask().

unsigned int ITC_startTaskW ( ITC_Task task,
const TASK_attr *  attr,
ITC_cb_Meta rtn,
void *  prm 
)

Fork the specified ITC task (blocking version).

Parameters:
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
Return values:
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

References startTask().

unsigned int ITC_stopTask ( ITC_Task task,
ITC_cb_Meta rtn,
void *  prm 
)

Stop an ITC task.

Parameters:
task (in) Task handle
rtn (in) User's task stop routine (can be NULL)
prm (in) User's task stop routine parameter
Warning:
This routine is blocking (on FORK_join)
Return values:
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

References checkState(), _ITC_Task::fcb, _ITC_Queue::fqi, _ITC_Queue::fqm, ITC_CTL_INITIALIZED, ITC_icb, ITC_L_QUEUES, ITC_QID_METAHI, ITC_qpl, ITC_stopMeta(), ITC_TSK_INITIALIZED, ITC_TSK_STARTED, ITC_TSK_STOPSYNC, _ITC_Task::msg, _ITC_Control::mtx, _ITC_Fork::prm0, _ITC_Fork::prm1, _ITC_Task::state, _ITC_Fork::task, and _ITC_Task::tid.

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.

Parameters:
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
Return values:
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

References checkState(), _ITC_Task::fcb, _ITC_Queue::fqi, _ITC_Queue::fqm, _ITC_Queue::frkPrm, _ITC_Queue::frkRtn, ITC_CTL_INITIALIZED, ITC_dispatch(), ITC_icb, ITC_L_QUEUES, ITC_QID_METAHI, ITC_qpl, ITC_startMeta(), ITC_TSK_INITIALIZED, ITC_TSK_STARTING, _ITC_Task::msg, _ITC_Control::mtx, _ITC_Fork::prm0, _ITC_Fork::prm1, _ITC_Task::sem, _ITC_Task::state, _ITC_Fork::task, and _ITC_Task::tid.

Referenced by ITC_startTask(), and ITC_startTaskW().


Variable Documentation

const char* ITC_tsk_states[ITC_L_TSK_STATES]

Initial value:

{
    "uninitialized",
    "initialized",
    "starting",
    "started",
    "stopsync",
    "stopping",
    "converted"
}
String constants for ITC task control block states.

Referenced by ITC_attachCmdConfirm(), and ITC_detachCmdConfirm().

const char * ITC_tsk_types[ITC_L_TSK_TYPES]

Initial value:

{
    "service",
    "application",
    "lightweight"
}
String constants for ITC task types.


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