📄 exclib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/excLib.html - generated by refgen from excLib.c --> <title> excLib </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>excLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>excLib</strong> - generic exception handling facilities </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./excLib.html#excInit">excInit</a>( )</b> - initialize the exception handling package<br><b><a href="./excLib.html#excHookAdd">excHookAdd</a>( )</b> - specify a routine to be called with exceptions<br><b><a href="./excLib.html#excTask">excTask</a>( )</b> - handle task-level exceptions<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides generic initialization facilities for handlingexceptions. It safely traps and reports exceptions caused by programerrors in VxWorks tasks, and it reports occurrences of interrupts that areexplicitly connected to other handlers. For information aboutarchitecture-dependent exception handling facilities, see the manual entryfor <b><a href="./excArchLib.html#top">excArchLib</a></b>.<p></blockquote><h4>INITIALIZATION</h4><blockquote><p>Initialization of <b><a href="./excLib.html#top">excLib</a></b> facilities occurs in two steps. First, the routine<b><a href="./excArchLib.html#excVecInit">excVecInit</a>( )</b> is called to set all vectors to the default handlers for anarchitecture provided by the corresponding architecture exception handlinglibrary. Since this does not involve VxWorks' kernel facilities, it isusually done early in the system start-up routine <b><a href="./usrConfig.html#usrInit">usrInit</a>( )</b> in the library<b>usrConfig.c</b> with interrupts disabled.<p>The rest of this package is initialized by calling <b><a href="./excLib.html#excInit">excInit</a>( )</b>, which spawnsthe exception support task, <b><a href="./excLib.html#excTask">excTask</a>( )</b>, and creates the message queues used tocommunicate with it.<p>Exceptions or uninitialized interrupts that occur after the vectorshave been initialized by <b><a href="./excArchLib.html#excVecInit">excVecInit</a>( )</b>, but before <b><a href="./excLib.html#excInit">excInit</a>( )</b> is called,cause a trap to the ROM monitor.<p></blockquote><h4>NORMAL EXCEPTION HANDLING</h4><blockquote><p>When a program error generates an exception (such as divide by zero, or abus or address error), the task that was executing when the error occurredis suspended, and a description of the exception is displayed on standardoutput. The VxWorks kernel and other system tasks continue uninterrupted.The suspended task can be examined with the usual VxWorks routines,including <b><a href="./usrLib.html#ti">ti</a>( )</b> for task information and <b><a href="./dbgLib.html#tt">tt</a>( )</b> for a stack trace. It maybe possible to fix the task and resume execution with <b><a href="./usrLib.html#tr">tr</a>( )</b>. However, tasksaborted in this way are often unsalvageable and can be deleted with <b><a href="./usrLib.html#td">td</a>( )</b>.<p>When an interrupt that is not connected to a handler occurs, the defaulthandler provided by the architecture-specific module displays adescription of the interrupt on standard output.<p></blockquote><h4>ADDITIONAL EXCEPTION HANDLING ROUTINE</h4><blockquote><p>The <b><a href="./excLib.html#excHookAdd">excHookAdd</a>( )</b> routine adds a routine that will be called when a hardwareexception occurs. This routine is called at the end of normal exceptionhandling.<p></blockquote><h4>TASK-LEVEL SUPPORT</h4><blockquote><p>The <b><a href="./excLib.html#excInit">excInit</a>( )</b> routine spawns <b><a href="./excLib.html#excTask">excTask</a>( )</b>, which performs special exceptionhandling functions that need to be done at task level. Do not suspend,delete, or change the priority of this task.<p></blockquote><h4>DBGLIB</h4><blockquote><p>The facilities of <b><a href="./excLib.html#top">excLib</a></b>, including <b><a href="./excLib.html#excTask">excTask</a>( )</b>, are used by <b><a href="./dbgLib.html#top">dbgLib</a></b> to supportbreakpoints, single-stepping, and additional exception handling functions.<p></blockquote><h4>SIGLIB</h4><blockquote><p>A higher-level, UNIX-compatible interface for hardware and softwareexceptions is provided by <b><a href="./sigLib.html#top">sigLib</a></b>. If <b><a href="./sigLib.html#sigvec">sigvec</a>( )</b> is used to initializethe appropriate hardware exception/interrupt (e.g., BUS ERROR == SIGSEGV),<b><a href="./excLib.html#top">excLib</a></b> will use the signal mechanism instead.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>excLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dbgLib.html#top">dbgLib</a></b>, <b><a href="./sigLib.html#top">sigLib</a></b>, <b><a href="./intLib.html#top">intLib</a></b><hr><a name="excInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>excInit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>excInit( )</strong> - initialize the exception handling package</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS excInit ()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine installs the exception handling facilities and spawns <b><a href="./excLib.html#excTask">excTask</a>( )</b>,which performs special exception handling functions that need to be done attask level. It also creates the message queue used to communicate with<b><a href="./excLib.html#excTask">excTask</a>( )</b>.<p></blockquote><h4>NOTE</h4><blockquote><p><p>The exception handling facilities should be installed as early aspossible during system initialization in the root task, <b><a href="./usrConfig.html#usrRoot">usrRoot</a>( )</b>, in<b>usrConfig.c</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if a message queue cannot be created or <b><a href="./excLib.html#excTask">excTask</a>( )</b> cannot bespawned.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./excLib.html#top">excLib</a></b>, <b><a href="./excLib.html#excTask">excTask</a>( )</b><hr><a name="excHookAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>excHookAdd( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>excHookAdd( )</strong> - specify a routine to be called with exceptions</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void excHookAdd ( FUNCPTR excepHook /* routine to call when exceptions occur */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine specifies a routine that will be called when hardwareexceptions occur. The specified routine is called after normal exceptionhandling, which includes displaying information about the error. Upon returnfrom the specified routine, the task that incurred the error is suspended.<p>The exception handling routine should be declared as:<pre> void myHandler ( int task, /* ID of offending task */ int vecNum, /* exception vector number */ <i>ESFxx</i> *pEsf /* pointer to exception stack frame */ )</pre>where <i>task</i> is the ID of the task that was running when the exceptionoccurred. <i>ESFxx</i> is architecture-specific and can be found by examining<b>/target/h/arch/<i>arch</i>/esf<i>arch</i>.h</b>; for example, the PowerPC uses ESFPPC.<p>This facility is normally used by <b>dbgLib( )</b> to activate its exceptionhandling mechanism. If an application provides its own exception handler,it will supersede the <b><a href="./dbgLib.html#top">dbgLib</a></b> mechanism.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./excLib.html#top">excLib</a></b>, <b><a href="./excLib.html#excTask">excTask</a>( )</b><hr><a name="excTask"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>excTask( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>excTask( )</strong> - handle task-level exceptions</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void excTask ()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is spawned as a task by <b><a href="./excLib.html#excInit">excInit</a>( )</b> to perform functionsthat cannot be performed at interrupt or trap level. It has a priority of 0.Do not suspend, delete, or change the priority of this task.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./excLib.html#top">excLib</a></b>, <b><a href="./excLib.html#excInit">excInit</a>( )</b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -