GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > PBS / V2-10-10
Constituent: pbs     Tag: rad750
#include <semLib.h>
#include <intLib.h>
#include <taskHookLib.h>
#include "PBS/MBA.h"
#include "PBS/WUT.h"
#include "PBS/WUT_tmr.h"
Include dependency graph for TASK.c.vx-xxx-xxx:
Defines | |
#define | TASK_K_DEFAULT_STACK_SIZE 20000 |
Sets the stack size if the user does not explicitly declare one. | |
Functions | |
static void | task_create_hook (WIND_TCB *tcb) |
Performs additional per task creation functions. | |
static void | task_delete_hook (WIND_TCB *tcb) |
Performs per task deletion functions. | |
static void | task_entry_safe (int options, TASK_entry usr_entry, TASK_parameter usr_parameter, TASK_tcb *tcb) |
Task entry point when the task is being started in a task delete safe fashion. | |
static void | task_entry_unsafe (int options, TASK_entry usr_entry, TASK_parameter usr_parameter, TASK_tcb *tcb) |
Task entry point when the task is being started in a task delete unsafe fashion. | |
static WUT_cb_status | task_wakeup (void *semaphore, WUT_tmr *tmr) |
Timer callback routine used in implementing TASK_wait. | |
int | TASK_tcb_sizeof (void) |
Returns the size, in bytes, of a TCB to be used when creating or spawning a TASK. | |
int | TASK_xtcb_sizeof () |
Returns the size, in bytes, of a TCB to be used when converting an existing (platform native task) to a TASK type task. | |
int | TASK_activate (TASK_tcb *tcb) |
Activates a previously created task. | |
int | TASK_create (TASK_tcb *tcb, const TASK_attr *attributes, TASK_entry entry_point, TASK_parameter parameter) |
Creates, but does not activate a task. | |
int | TASK_convert (TASK_tcb *tcb, const TASK_attr *attributes, TASK_entry entry_point, TASK_parameter parameter) |
Converts an existing VxWorks task to a TASK. | |
int | TASK_revert (TASK_tcb *tcb) |
Strips a task/thread of its TASK functionality. | |
void | TASK_exit (void *exit_value) |
Causes the calling task to delete itself and allows notification to another task, via TASK_join() that the calling task has deleted itself. | |
int | TASK_join (TASK_tcb *tcb, void **exit_value) |
Blocks the calling task until the specified task completes. | |
const char * | TASK_name (const TASK_tcb *tcb) |
Returns a pointer to the task's name. | |
int | TASK_resume (TASK_tcb *tcb) |
Resumes a previously suspended task. | |
int | TASK_suspend (TASK_tcb *tcb) |
Suspends a task. | |
int | TASK_wait (const TOV tov) |
Causes the calling task to wait (pause) until the specified timeout is reached. | |
int | TASK_destroy (TASK_tcb *tcb) |
Destroys, ie deletes, a previously created task. | |
int | TASK_spawn (TASK_tcb *tcb, const TASK_attr *attributes, TASK_entry entry_point, TASK_parameter parameter) |
Convenience routine to both create and activate a task. | |
int | TASK_priority_get (const TASK_tcb *tcb) |
Gets the current priority of the specified task. The priority is returned expressed in the native tasking model's scheme. | |
int | TASK_priority_set (TASK_tcb *tcb, int priority) |
Sets priority of the specified task to the specified value. | |
int | TASK_block (TASK_block_handle *tbh, TASK_block_cb rtn, void *prm) |
Provides a simple way to turn an asynchronous routine into a synchronous routine. | |
int | TASK_sys_init (void) |
Performs one time only initialization of the TASK facility. | |
int | TASK_sys_shutdown (void) |
Performs the shutdown of the TASK facility. This essentially undoes what TASK_sys_init did. |
CVS $Id: TASK.c.vx-xxx-xxx,v 1.8 2004/12/07 16:13:13 russell Exp $
|
Activates a previously created task.
|
|
Provides a simple way to turn an asynchronous routine into a synchronous routine.
struct Synch { TASK_block_handle tbh; char buf[100]; void nbytes; SynchRtn synch_rtn; } synch; synch->synch_rtn = read_synch; status = TASK_block (&synch->tbh, read_it, &synch);
int read_synch (Synch *synch) { return TASK_unblock (synch->tbh); } |
|
Converts an existing VxWorks task to a TASK.
nbytes = TASK_xtcb_sizeof (); // Get the size of a conversion block tcb = MBA_alloc (nbytes); // Allocate memory for it // Give control to TASK, it will just call (*myRoutine)(myParameter) // then return when that routine is down status = TASK_convert (tcb, NULL, myRoutine, myParameter); // Strip this task of TASK functionality status = TASK_revert (tcb); // Return the TASK resources MBA_free (tcb); // Free the memory for the tcb The second usage is when doing informal coding in the shell.
nbytes = TASK_xtcb_sizeof (); // Get the size of a conversion block tcb = MBA_alloc (nbytes); // Allocate memory for it // Just create and initialize the tcb status = TASK_convert (tcb, NULL, NULL, NULL); ... lots of code // Strip this task of TASK functionality status = TASK_revert (tcb); // Return the TASK resources MBA_free (tcb); // Free the memory for the tcb Naturally the above example (the one without the user callback routine can be used in the other case also, but, style-wise, usage of the calback is structurally cleaner.
|
|
Creates, but does not activate a task.
|
|
Performs additional per task creation functions.
|
|
Performs per task deletion functions.
|
|
Destroys, ie deletes, a previously created task.
|
|
Task entry point when the task is being started in a task delete safe fashion.
|
|
Task entry point when the task is being started in a task delete unsafe fashion.
|
|
Causes the calling task to delete itself and allows notification to another task, via TASK_join() that the calling task has deleted itself.
Note that the status value is a void *, so a pointer to any piece of information can be supplied with the usual caveat that the memory the pointer is aimed at remains valid until read. |
|
Blocks the calling task until the specified task completes.
|
|
Returns a pointer to the task's name.
|
|
Gets the current priority of the specified task. The priority is returned expressed in the native tasking model's scheme.
|
|
Sets priority of the specified task to the specified value.
|
|
Resumes a previously suspended task.
|
|
Strips a task/thread of its TASK functionality.
Although this call can be used with TASK_create() and TASK_spawn(), it is most usually called after TASK_convert(). |
|
Convenience routine to both create and activate a task.
|
|
Suspends a task.
|
|
Performs one time only initialization of the TASK facility.
|
|
Performs the shutdown of the TASK facility. This essentially undoes what TASK_sys_init did.
|
|
Returns the size, in bytes, of a TCB to be used when creating or spawning a TASK.
|
|
Causes the calling task to wait (pause) until the specified timeout is reached.
|
|
Timer callback routine used in implementing TASK_wait.
|
|
Returns the size, in bytes, of a TCB to be used when converting an existing (platform native task) to a TASK type task.
|