📄 taskinfo.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/taskInfo.html - generated by refgen from taskInfo.c --> <title> taskInfo </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>taskInfo</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>taskInfo</strong> - task information library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./taskInfo.html#taskOptionsSet">taskOptionsSet</a>( )</b> - change task options<br><b><a href="./taskInfo.html#taskOptionsGet">taskOptionsGet</a>( )</b> - examine task options<br><b><a href="./taskInfo.html#taskRegsGet">taskRegsGet</a>( )</b> - get a task's registers from the TCB<br><b><a href="./taskInfo.html#taskRegsSet">taskRegsSet</a>( )</b> - set a task's registers<br><b><a href="./taskInfo.html#taskName">taskName</a>( )</b> - get the name associated with a task ID<br><b><a href="./taskInfo.html#taskNameToId">taskNameToId</a>( )</b> - look up the task ID associated with a task name<br><b><a href="./taskInfo.html#taskIdDefault">taskIdDefault</a>( )</b> - set the default task ID<br><b><a href="./taskInfo.html#taskIsReady">taskIsReady</a>( )</b> - check if a task is ready to run<br><b><a href="./taskInfo.html#taskIsSuspended">taskIsSuspended</a>( )</b> - check if a task is suspended<br><b><a href="./taskInfo.html#taskIdListGet">taskIdListGet</a>( )</b> - get a list of active task IDs<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides a programmatic interface for obtaining task information.<p>Task information is crucial as a debugging aid and user-interface convenience during the development cycle of an application. The routines <b><a href="./taskInfo.html#taskOptionsGet">taskOptionsGet</a>( )</b>, <b><a href="./taskInfo.html#taskRegsGet">taskRegsGet</a>( )</b>, <b><a href="./taskInfo.html#taskName">taskName</a>( )</b>, <b><a href="./taskInfo.html#taskNameToId">taskNameToId</a>( )</b>, <b><a href="./taskInfo.html#taskIsReady">taskIsReady</a>( )</b>, <b><a href="./taskInfo.html#taskIsSuspended">taskIsSuspended</a>( )</b>, and <b><a href="./taskInfo.html#taskIdListGet">taskIdListGet</a>( )</b> are used to obtaintask information. Three routines -- <b><a href="./taskInfo.html#taskOptionsSet">taskOptionsSet</a>( )</b>, <b><a href="./taskInfo.html#taskRegsSet">taskRegsSet</a>( )</b>, and<b><a href="./taskInfo.html#taskIdDefault">taskIdDefault</a>( )</b> -- provide programmatic access to debugging features.<p>The chief drawback of using task information is that tasks maychange their state between the time the information is gathered and thetime it is utilized. Information provided by these routines shouldtherefore be viewed as a snapshot of the system, and not relied uponunless the task is consigned to a known state, such as suspended.<p>Task management and control routines are provided by <b><a href="./taskLib.html#top">taskLib</a></b>. Higher-leveltask information display routines are provided by <b><a href="./taskShow.html#top">taskShow</a></b>.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>taskLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskLib.html#top">taskLib</a></b>, <b><a href="./taskShow.html#top">taskShow</a></b>, <b><a href="./taskHookLib.html#top">taskHookLib</a></b>, <b><a href="./taskVarLib.html#top">taskVarLib</a></b>, <b><a href="./semLib.html#top">semLib</a></b>, <b><a href="./kernelLib.html#top">kernelLib</a></b>,<i>VxWorks Programmer's Guide: Basic OS </i><hr><a name="taskOptionsSet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>taskOptionsSet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>taskOptionsSet( )</strong> - change task options</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskOptionsSet ( int tid, /* task ID */ int mask, /* bit mask of option bits to unset */ int newOptions /* bit mask of option bits to set */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine changes the execution options of a task.The only option that can be changed after a task has been created is:<dl><dt><b>VX_UNBREAKABLE</b><dd>do not allow breakpoint debugging.</dl>For definitions, see <b>taskLib.h</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the task ID is invalid.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskInfo.html#top">taskInfo</a></b>, <b><a href="./taskInfo.html#taskOptionsGet">taskOptionsGet</a>( )</b><hr><a name="taskOptionsGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>taskOptionsGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>taskOptionsGet( )</strong> - examine task options</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskOptionsGet ( int tid, /* task ID */ int * pOptions /* task's options */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets the current execution options of the specified task.The option bits returned by this routine indicate the following modes:<dl><dt><b>VX_FP_TASK</b><dd>execute with floating-point coprocessor support.<dt><b>VX_PRIVATE_ENV</b><dd>include private environment support (see <b><a href="./envLib.html#top">envLib</a></b>).<dt><b>VX_NO_STACK_FILL</b><dd>do not fill the stack for use by <b>checkstack( )</b>.<dt><b>VX_UNBREAKABLE</b><dd>do not allow breakpoint debugging.</dl>For definitions, see <b>taskLib.h</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the task ID is invalid.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskInfo.html#top">taskInfo</a></b>, <b><a href="./taskInfo.html#taskOptionsSet">taskOptionsSet</a>( )</b><hr><a name="taskRegsGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>taskRegsGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>taskRegsGet( )</strong> - get a task's registers from the TCB</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskRegsGet ( int tid, /* task ID */ REG_SET * pRegs /* put register contents here */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gathers task information kept in the TCB. It copies thecontents of the task's registers to the register structure <i>pRegs</i>.<p></blockquote><h4>NOTE</h4><blockquote><p>This routine only works well if the task is known to be in a stable,non-executing state. Self-examination, for instance, is not advisable,as results are unpredictable.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the task ID is invalid.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskInfo.html#top">taskInfo</a></b>, <b><a href="./taskLib.html#taskSuspend">taskSuspend</a>( )</b>, <b><a href="./taskInfo.html#taskRegsSet">taskRegsSet</a>( )</b><hr><a name="taskRegsSet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>taskRegsSet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>taskRegsSet( )</strong> - set a task's registers</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskRegsSet ( int tid, /* task ID */ REG_SET * pRegs /* get register contents from here */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine loads a specified register set <i>pRegs</i> into a specifiedtask's TCB.<p></blockquote><h4>NOTE</h4><blockquote><p>This routine only works well if the task is known not to be in the readystate. Suspending the task before changing the register set isrecommended.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the task ID is invalid.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskInfo.html#top">taskInfo</a></b>, <b><a href="./taskLib.html#taskSuspend">taskSuspend</a>( )</b>, <b><a href="./taskInfo.html#taskRegsGet">taskRegsGet</a>( )</b><hr><a name="taskName"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>taskName( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>taskName( )</strong> - get the name associated with a task ID</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>char *taskName ( int tid /* ID of task whose name is to be found */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns a pointer to the name of a task of a specified ID, ifthe task has a name. If the task has no name, it returns an empty string. <p></blockquote><h4>RETURNS</h4><blockquote><p>A pointer to the task name, or NULL if the task ID is invalid.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskInfo.html#top">taskInfo</a></b><hr><a name="taskNameToId"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>taskNameToId( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>taskNameToId( )</strong> - look up the task ID associated with a task name</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int taskNameToId ( char * name /* task name to look up */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns the ID of the task matching a specified name.Referencing a task in this way is inefficient, since it involves a searchof the task list.<p></blockquote><h4>RETURNS</h4><blockquote><p>The task ID, or ERROR if the task is not found.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_taskLib_NAME_NOT_FOUND</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskInfo.html#top">taskInfo</a></b><hr><a name="taskIdDefault"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>taskIdDefault( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>taskIdDefault( )</strong> - set the default task ID</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int taskIdDefault ( int tid /* user supplied task ID; if 0, return default */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine maintains a global default task ID. This ID is used bylibraries that want to allow a task ID argument to take on a default valueif the user did not explicitly supply one.<p>If <i>tid</i> is not zero (i.e., the user did specify a task ID), the defaultID is set to that value, and that value is returned. If <i>tid</i> is zero(i.e., the user did not specify a task ID), the default ID is not changedand its value is returned. Thus the value returned is always the lasttask ID the user specified.<p></blockquote><h4>RETURNS</h4><blockquote><p>The most recent non-zero task ID.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskInfo.html#top">taskInfo</a></b>, <b><a href="./dbgLib.html#top">dbgLib</a></b>, <i>VxWorks Programmer's Guide: Target Shell, </i><b><a href="../../tornado/tools/windsh.html#top" >windsh</a></b>, <i>Tornado User's Guide: Shell</i><hr><a name="taskIsReady"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>taskIsReady( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>taskIsReady( )</strong> - check if a task is ready to run</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>BOOL taskIsReady ( int tid /* task ID */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine tests the status field of a task to determineif it is ready to run.<p></blockquote><h4>RETURNS</h4><blockquote><p>TRUE if the task is ready, otherwise FALSE.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskInfo.html#top">taskInfo</a></b><hr><a name="taskIsSuspended"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>taskIsSuspended( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>taskIsSuspended( )</strong> - check if a task is suspended</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>BOOL taskIsSuspended ( int tid /* task ID */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine tests the status field of a task to determineif it is suspended.<p></blockquote><h4>RETURNS</h4><blockquote><p>TRUE if the task is suspended, otherwise FALSE.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskInfo.html#top">taskInfo</a></b><hr><a name="taskIdListGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>taskIdListGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>taskIdListGet( )</strong> - get a list of active task IDs</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int taskIdListGet ( int idList[], /* array of task IDs to be filled in */ int maxTasks /* max tasks <i>idList</i> can accommodate */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine provides the calling task with a list of all activetasks. An unsorted list of task IDs for no more than <i>maxTasks</i> tasks isput into <i>idList</i>.<p></blockquote><h4>WARNING</h4><blockquote><p><p>Kernel rescheduling is disabled with <b><a href="./taskLib.html#taskLock">taskLock</a>( )</b> while tasks are filledinto the <i>idList</i>. There is no guarantee that all the tasks are validor that new tasks have not been created by the time this routine returns.<p></blockquote><h4>RETURNS</h4><blockquote><p>The number of tasks put into the ID list.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskInfo.html#top">taskInfo</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -