⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 taskhooklib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/taskHookLib.html - generated by refgen from taskHookLib.c --> <title> taskHookLib </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>taskHookLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>taskHookLib</strong> - task hook library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./taskHookLib.html#taskHookInit">taskHookInit</a>(&nbsp;)</b>  -  initialize task hook facilities<br><b><a href="./taskHookLib.html#taskCreateHookAdd">taskCreateHookAdd</a>(&nbsp;)</b>  -  add a routine to be called at every task create<br><b><a href="./taskHookLib.html#taskCreateHookDelete">taskCreateHookDelete</a>(&nbsp;)</b>  -  delete a previously added task create routine<br><b><a href="./taskHookLib.html#taskSwitchHookAdd">taskSwitchHookAdd</a>(&nbsp;)</b>  -  add a routine to be called at every task switch<br><b><a href="./taskHookLib.html#taskSwitchHookDelete">taskSwitchHookDelete</a>(&nbsp;)</b>  -  delete a previously added task switch routine<br><b><a href="./taskHookLib.html#taskDeleteHookAdd">taskDeleteHookAdd</a>(&nbsp;)</b>  -  add a routine to be called at every task delete<br><b><a href="./taskHookLib.html#taskDeleteHookDelete">taskDeleteHookDelete</a>(&nbsp;)</b>  -  delete a previously added task delete routine<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides routines for adding extensions to the VxWorkstasking facility.  To allow task-related facilities to be added to thesystem without modifying the kernel, the kernel provides call-outs everytime a task is created, switched, or deleted.  The call-outs allow additionalroutines, or "hooks," to be invoked whenever these events occur.The hook management routines below allow hooks to be dynamically added toand deleted from the current lists of create, switch, and delete hooks:<dl><dt><b><a href="./taskHookLib.html#taskCreateHookAdd">taskCreateHookAdd</a>(&nbsp;)</b> and <b><a href="./taskHookLib.html#taskCreateHookDelete">taskCreateHookDelete</a>(&nbsp;)</b><dd>Add and delete routines to be called when a task is created.<dt><b><a href="./taskHookLib.html#taskSwitchHookAdd">taskSwitchHookAdd</a>(&nbsp;)</b> and <b><a href="./taskHookLib.html#taskSwitchHookDelete">taskSwitchHookDelete</a>(&nbsp;)</b><dd>Add and delete routines to be called when a task is switched.<dt><b><a href="./taskHookLib.html#taskDeleteHookAdd">taskDeleteHookAdd</a>(&nbsp;)</b> and <b><a href="./taskHookLib.html#taskDeleteHookDelete">taskDeleteHookDelete</a>(&nbsp;)</b><dd>Add and delete routines to be called when a task is deleted.</dl>This facility is used by <b><a href="./dbgLib.html#top">dbgLib</a></b> to provide task-specific breakpointsand single-stepping.  It is used by <b><a href="./taskVarLib.html#top">taskVarLib</a></b> for the "task variable"mechanism.  It is also used by <b><a href="./fppLib.html#top">fppLib</a></b> for floating-point coprocessorsupport.<p></blockquote><h4>NOTE</h4><blockquote><p>It is possible to have dependencies among task hook routines.  Forexample, a delete hook may use facilities that are cleaned up and deletedby another delete hook.  In such cases, the order in which the hooks runis important.  VxWorks runs the create and switch hooks in the order inwhich they were added, and runs the delete hooks in reverse of the orderin which they were added.  Thus, if the hooks are added in "hierarchical"order, such that they rely only on facilities whose hook routines havealready been added, then the required facilities will be initializedbefore any other facilities need them, and will be deleted after allfacilities are finished with them.<p>VxWorks facilities guarantee this by having each facility's initializationroutine first call any prerequisite facility's initialization routinebefore adding its own hooks.  Thus, the hooks are always added in thecorrect order.  Each initialization routine protects itself from multipleinvocations, allowing only the first invocation to have any effect.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>taskHookLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dbgLib.html#top">dbgLib</a></b>, <b><a href="./fppLib.html#top">fppLib</a></b>, <b><a href="./taskLib.html#top">taskLib</a></b>, <b><a href="./taskVarLib.html#top">taskVarLib</a></b><i>VxWorks Programmer's Guide: Basic OS </i><hr><a name="taskHookInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>taskHookInit(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>taskHookInit(&nbsp;)</strong> - initialize task hook facilities</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void taskHookInit (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is a NULL routine called to configure the task hook packageinto the system.  It is called automatically if the configuration macro<b>INCLUDE_TASK_HOOKS</b> is defined.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskHookLib.html#top">taskHookLib</a></b><hr><a name="taskCreateHookAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>taskCreateHookAdd(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>taskCreateHookAdd(&nbsp;)</strong> - add a routine to be called at every task create</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskCreateHookAdd    (    FUNCPTR createHook        /* routine to be called when a task is created */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds a specified routine to a list of routinesthat will be called whenever a task is created.  The routine should bedeclared as follows:<pre>    void createHook        (        WIND_TCB *pNewTcb     /* pointer to new task's TCB */        )</pre></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the table of task create routines is full.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskHookLib.html#top">taskHookLib</a></b>, <b><a href="./taskHookLib.html#taskCreateHookDelete">taskCreateHookDelete</a>(&nbsp;)</b><hr><a name="taskCreateHookDelete"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>taskCreateHookDelete(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>taskCreateHookDelete(&nbsp;)</strong> - delete a previously added task create routine</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskCreateHookDelete    (    FUNCPTR createHook        /* routine to be deleted from list */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine removes a specified routine from the list ofroutines to be called at each task create.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the routine is not in the table of task createroutines.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskHookLib.html#top">taskHookLib</a></b>, <b><a href="./taskHookLib.html#taskCreateHookAdd">taskCreateHookAdd</a>(&nbsp;)</b><hr><a name="taskSwitchHookAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>taskSwitchHookAdd(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>taskSwitchHookAdd(&nbsp;)</strong> - add a routine to be called at every task switch</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskSwitchHookAdd    (    FUNCPTR switchHook        /* routine to be called at every task switch */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds a specified routine to a list of routinesthat will be called at every task switch.  The routine should bedeclared as follows:<pre>    void switchHook        (        WIND_TCB *pOldTcb,    /* pointer to old task's WIND_TCB */        WIND_TCB *pNewTcb     /* pointer to new task's WIND_TCB */        )</pre></blockquote><h4>NOTE</h4><blockquote><p>User-installed switch hooks are called within the kernel context.Therefore, switch hooks do not have access to all VxWorksfacilities.  The following routines can be called from within a taskswitch hook:<p><table><tr valign=top><th align=left>Library    </th><th align=left>  Routines</tr><tr><td colspan="2"><hr></tr><tr valign=top><td align=left><b><a href="./bLib.html#top">bLib</a></b>       </td><td align=left>  All routines</tr><tr valign=top><td align=left><b><a href="./fppArchLib.html#top">fppArchLib</a></b> </td><td align=left>  <b><a href="./fppArchLib.html#fppSave">fppSave</a>(&nbsp;)</b>, <b><a href="./fppArchLib.html#fppRestore">fppRestore</a>(&nbsp;)</b></tr><tr valign=top><td align=left><b><a href="./intLib.html#top">intLib</a></b>     </td><td align=left>  <b><a href="./intLib.html#intContext">intContext</a>(&nbsp;)</b>, <b><a href="./intLib.html#intCount">intCount</a>(&nbsp;)</b>, <b><a href="./intArchLib.html#intVecSet">intVecSet</a>(&nbsp;)</b>, <b><a href="./intArchLib.html#intVecGet">intVecGet</a>(&nbsp;)</b></tr><tr valign=top><td align=left><b><a href="./lstLib.html#top">lstLib</a></b>     </td><td align=left>  All routines</tr><tr valign=top><td align=left><b><a href="./mathALib.html#top">mathALib</a></b>   </td><td align=left>  All routines, if <b><a href="./fppArchLib.html#fppSave">fppSave</a>(&nbsp;)</b>/<b><a href="./fppArchLib.html#fppRestore">fppRestore</a>(&nbsp;)</b> are used</tr><tr valign=top><td align=left><b><a href="./rngLib.html#top">rngLib</a></b>     </td><td align=left>  All routines except <b><a href="./rngLib.html#rngCreate">rngCreate</a>(&nbsp;)</b></tr><tr valign=top><td align=left><b><a href="./taskLib.html#top">taskLib</a></b>    </td><td align=left>  <b><a href="./taskLib.html#taskIdVerify">taskIdVerify</a>(&nbsp;)</b>, <b><a href="./taskInfo.html#taskIdDefault">taskIdDefault</a>(&nbsp;)</b>, <b><a href="./taskInfo.html#taskIsReady">taskIsReady</a>(&nbsp;)</b>,</tr><tr valign=top><td align=left>           </td><td align=left>  <b><a href="./taskInfo.html#taskIsSuspended">taskIsSuspended</a>(&nbsp;)</b>, <b><a href="./taskLib.html#taskTcb">taskTcb</a>(&nbsp;)</b></tr><tr valign=top><td align=left><b><a href="./vxLib.html#top">vxLib</a></b>      </td><td align=left>  <b><a href="./vxLib.html#vxTas">vxTas</a>(&nbsp;)</b></tr><tr valign=top><td align=left></tr></tr></table></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the table of task switch routines is full.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskHookLib.html#top">taskHookLib</a></b>, <b><a href="./taskHookLib.html#taskSwitchHookDelete">taskSwitchHookDelete</a>(&nbsp;)</b><hr><a name="taskSwitchHookDelete"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>taskSwitchHookDelete(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>taskSwitchHookDelete(&nbsp;)</strong> - delete a previously added task switch routine</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskSwitchHookDelete    (    FUNCPTR switchHook        /* routine to be deleted from list */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine removes the specified routine from the list ofroutines to be called at each task switch.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the routine is not in the table of task switchroutines.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskHookLib.html#top">taskHookLib</a></b>, <b><a href="./taskHookLib.html#taskSwitchHookAdd">taskSwitchHookAdd</a>(&nbsp;)</b><hr><a name="taskDeleteHookAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>taskDeleteHookAdd(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>taskDeleteHookAdd(&nbsp;)</strong> - add a routine to be called at every task delete</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskDeleteHookAdd    (    FUNCPTR deleteHook        /* routine to be called when a task is deleted */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds a specified routine to a list of routinesthat will be called whenever a task is deleted.  The routine should bedeclared as follows:<pre>    void deleteHook        (        WIND_TCB *pTcb        /* pointer to deleted task's WIND_TCB */        )</pre></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the table of task delete routines is full.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskHookLib.html#top">taskHookLib</a></b>, <b><a href="./taskHookLib.html#taskDeleteHookDelete">taskDeleteHookDelete</a>(&nbsp;)</b><p><hr><a name="taskDeleteHookDelete"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>taskDeleteHookDelete(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>taskDeleteHookDelete(&nbsp;)</strong> - delete a previously added task delete routine</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS taskDeleteHookDelete    (    FUNCPTR deleteHook        /* routine to be deleted from list */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine removes a specified routine from the list ofroutines to be called at each task delete.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the routine is not in the table of task deleteroutines.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./taskHookLib.html#top">taskHookLib</a></b>, <b><a href="./taskHookLib.html#taskDeleteHookAdd">taskDeleteHookAdd</a>(&nbsp;)</b></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -