GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBS / V2-12-1 > pbs / rhel6-32


Interface   Data Structures   File List   Data Fields   Globals  

TASK.c File Reference

TASK, platform independent implementation. More...

#include <stdio.h>
#include <string.h>
#include <PBS/TASK.h>
#include <TASK_pvtdefs.h>
#include <PBS/TBD.h>
#include <TBD_pvtdefs.h>
#include <PBS/TOV.h>
#include <PBS/TOC.h>
#include <PBS/MBA.h>

Functions

int TASK_priority_number_compute (int priority, TASK_priority_type type, const TASK_tcb *tcb)
 Computes a priority number, either as an absolute or based on the priority of another task.
int TASK_attr_init (TASK_attr *attributes)
 Provides a standard method of initializing the attributes block to a set of known values. These values may be platform dependent.
int TASK_attr_priority_set (TASK_attr *attributes, int priority)
 Sets the priority field in the task attributes block to the the specified value. This can be either absolute or relative to the current task's priority.
TASK_tcbTASK_cvt (void)
 Converts an existing VXWORKs task or POSIX thread to TASK object.
int TASK_pause (unsigned int nsecs)
 Causes the calling task to wait (pause) for the specified number of nanoseconds.
int TASK_rvt (void)
 Reverts the current task back to its native self by stripping it of its TASK functionality.


Detailed Description

TASK, platform independent implementation.

Author:
JJRussell - russell@slac.stanford.edu

    CVS $Id: TASK.c,v 1.7 2011/03/24 23:05:46 apw Exp $

Just a place to gather the different implementations together. The real code is in the TASK.c.xx-xxx-xxx's.


Function Documentation

int TASK_attr_init ( TASK_attr attributes  ) 

Provides a standard method of initializing the attributes block to a set of known values. These values may be platform dependent.

Parameters:
attributes The attributes block to initialize
Returns:
Status.

References _TASK_attr::name, _TASK_attr::options, _TASK_attr::priority, _TASK_attr::stack_addr, and _TASK_attr::stack_size.

Referenced by wut_sys_connect().

int TASK_attr_priority_set ( TASK_attr attributes,
int  priority 
)

Sets the priority field in the task attributes block to the the specified value. This can be either absolute or relative to the current task's priority.

Parameters:
attributes The target attributes block
priority A signed integer indicating the absolute or relative priority.
Returns:
The assigned priority level.
Absolute priorities numbers are always expressed in terms of the native system.

References _TASK_attr::priority, and TASK__priority_number_limit().

Referenced by wut_sys_connect().

TASK_tcb* TASK_cvt ( void   ) 

Converts an existing VXWORKs task or POSIX thread to TASK object.

Returns:
The TASK's control block
Warning:
This is made for quick and dirty shell and test programming. It should never be used in production code. Use
See also:
TASK_convert () and

TASK_revert ().

References MBA_alloc(), MBA_free(), TASK_convert(), and TASK_xtcb_sizeof().

int TASK_pause ( unsigned int  nsecs  ) 

Causes the calling task to wait (pause) for the specified number of nanoseconds.

Parameters:
nsecs The number of nanoseconds to pause.
Returns:
Status
Warning:
This call should only be used for debugging purposes. The range of the pause is approximately 0 to 4 seconds.

References TASK_wait(), and TOV_from_nsecs().

int TASK_priority_number_compute ( int  priority,
TASK_priority_type  type,
const TASK_tcb tcb 
)

Computes a priority number, either as an absolute or based on the priority of another task.

Parameters:
priority If the type is specified as an absolute priority number, then this number is used as is. If the type is relative, then it is a signed number. Positive numbers are interpretted as raising the priority level (even though the value of the priority number itself may be decremented) whereas negative numbers are interpreted as lowering the priority level (even though the value of the priority number itself may be incremented.)
type The type or manner in which to set the priority. This can be either relative or absolulte.
tcb The task control block of a reference task. This is used iff type == TASK_K_PRIORITY_TYPE_REL. If specified as NULL, then the priority of the calling task is used.
Returns:
The priority number expressed in the native tasking model's scheme.
Simple utility routine to compute a priority potentially based on another task. The priority level is returned expressed in the native tasking model's scheme. If the type is an absolute priority, the priority number returned is potentially changed to keep it within bounds.

References TASK__priority_number_boost(), TASK__priority_number_limit(), TASK_K_PRIORITY_TYPE_REL, and TASK_priority_get().

int TASK_rvt ( void   ) 

Reverts the current task back to its native self by stripping it of its TASK functionality.

Warning:
This is made for quick and dirty shell and test programming. It should never be used in production code. Use
See also:
TASK_convert () and

TASK_revert (). This function should be used with its partner,

TASK_cvt().

References MBA_free(), TASK_revert(), and TASK_self().


Generated on Mon Aug 1 14:54:44 2011 by  doxygen 1.5.8