TSK_stat
Application Program Interface
2-507
C Interface
Syntax
TSK_stat(task, statbuf);
Parameters
TSK_Handle task;
/* task object handle */
TSK_Stat
*statbuf;
/* pointer to task status structure */
Return Value
Void
Description
TSK_stat retrieves attribute values and status information about a task.
Status information is returned through statbuf, which references a
structure of type TSK_Stat defined as follows:
struct TSK_Stat { /* task status structure */
TSK_Attrs attrs; /* task attributes */
TSK_Mode mode; /* task execution mode */
Ptr sp; /* task stack pointer */
#ifdef _55_
Ptr ssp; /* task system stack pointer */
#endif
size_t used; /* task stack used */
#ifdef _55_
size_t sysused; /* task system stack used */
#endif
};
When a task is preempted by a software or hardware interrupt, the task
execution mode returned for that task by TSK_stat is still TSK_RUNNING
because the task runs when the preemption ends.
The current task can inquire about itself by passing the output of
TSK_self as the first argument to TSK_stat. However, the task stack
pointer (sp) in the TSK_Stat structure is the value from the previous
context switch. In addition, the task system stack pointer (ssp) provided
for ’C55x is invalid when calling TSK_stat for the current task.
TSK_stat has a non-deterministic execution time. As such, it is not
recommended to call this API from SWIs or HWIs.
Constraints and
Calling Context
❏
statbuf cannot be NULL.
See Also
TSK_stat
Retrieve the status of a task