📄 excarchlib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/excArchLib.html - generated by refgen from excArchLib.c --> <title> excArchLib </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>excArchLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>excArchLib</strong> - architecture-specific exception-handling facilities </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./excArchLib.html#excVecInit">excVecInit</a>( )</b> - initialize the exception/interrupt vectors<br><b><a href="./excArchLib.html#excConnect">excConnect</a>( )</b> - connect a C routine to an exception vector (PowerPC)<br><b><a href="./excArchLib.html#excIntConnect">excIntConnect</a>( )</b> - connect a C routine to an asynchronous exception vector (PowerPC, ARM)<br><b><a href="./excArchLib.html#excCrtConnect">excCrtConnect</a>( )</b> - connect a C routine to a critical exception vector (PowerPC 403)<br><b><a href="./excArchLib.html#excIntCrtConnect">excIntCrtConnect</a>( )</b> - connect a C routine to a critical interrupt vector (PowerPC 403)<br><b><a href="./excArchLib.html#excVecSet">excVecSet</a>( )</b> - set a CPU exception vector (PowerPC, ARM)<br><b><a href="./excArchLib.html#excVecGet">excVecGet</a>( )</b> - get a CPU exception vector (PowerPC, ARM)<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library contains exception-handling facilities that are architecturedependent. For information about generic (architecture-independent)exception-handling, see the manual entry for <b><a href="./excLib.html#top">excLib</a></b>.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>excLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./excLib.html#top">excLib</a></b>, <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="excVecInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>excVecInit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>excVecInit( )</strong> - initialize the exception/interrupt vectors</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS excVecInit (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets all exception vectors to point to the appropriatedefault exception handlers. These handlers will safely trap and reportexceptions caused by program errors or unexpected hardware interrupts.<dl><dt><b>MC680x0</b>:<dd>All vectors from vector 2 (address 0x0008) to 255 (address 0x03fc) areinitialized. Vectors 0 and 1 contain the reset stack pointer and programcounter.<dt><b>MIPS</b>:<dd>All MIPS exception, trap, and interrupt vectors are set to default handlers.<dt><b>x86</b>:<dd>All vectors from vector 0 (address (0x0000) to 255 (address 0x07f8) areinitialized to default handlers.<dt><b>PowerPC</b>:<dd>There are 48 vectors and only vectors that are used are initialized.<dt><b>SH</b>:<dd>There are 256 vectors, initialized with the default exception handler (for exceptions) or the unitialized interrupt handler (for interupts).On SH-2, vectors 0 and 1 contain the power-on reset program counter and stack pointer. Vectors 2 and 3 contain the manual reset program counter andstack pointer. On SH-3 and SH-4 processors the vector table is located at (vbr + 0x800), and the (exception code / 8) value is used as vector offset.The first two vectors are reserved for special use: "trapa #0" (offset 0x0)to implement software breakpoint, and "trapa #1' (offset 0x4) to detect integer zero divide exception.<dt><b>ARM</b>:<dd>All exception vectors are initialized to default handlers except 0x14(Address) which is now reserved on the ARM and 0x1C (FIQ), which is notused by VxWorks.<dt><b>SimSolaris/SimNT</b>:<dd>This routine does nothing on both simulators and always returns OK.</dl><p></blockquote><h4>NOTE</h4><blockquote><p>This routine is usually called from the system start-up routine,<b><a href="./usrConfig.html#usrInit">usrInit</a>( )</b>, in <b>usrConfig.c</b>. It must be called before interrupts are enabled.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, always.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./excArchLib.html#top">excArchLib</a></b>, <b><a href="./excLib.html#top">excLib</a></b><hr><a name="excConnect"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>excConnect( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>excConnect( )</strong> - connect a C routine to an exception vector (PowerPC)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS excConnect ( VOIDFUNCPTR * vector, /* exception vector to attach to */ VOIDFUNCPTR routine /* routine to be called */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine connects a specified C routine to a specified exceptionvector. An exception stub is created and in placed at <i>vector</i> in theexception table. The address of <i>routine</i> is stored in the exception stubcode. When an exception occurs, the processor jumps to the exception stubcode, saves the registers, and calls the C routines.<p>The routine can be any normal C code, except that it must notinvoke certain operating system functions that may block or performI/O operations.<p>The registers are saved to an Exception Stack Frame (ESF) placed on thestack of the task that has produced the exception. The structure of theESF used to save the registers is defined in <b>h/arch/ppc/esfPpc.h</b>.<p>The only argument passed by the exception stub to the C routine is a pointerto the ESF containing the registers values. The prototype of this C routineis described below:<pre> void excHandler (ESFPPC *);</pre>When the C routine returns, the exception stub restores the registers savedin the ESF and continues execution of the current task.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, always.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./excArchLib.html#top">excArchLib</a></b>, <b><a href="./excArchLib.html#excIntConnect">excIntConnect</a>( )</b>, <b><a href="./excArchLib.html#excVecSet">excVecSet</a>( )</b><hr><a name="excIntConnect"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>excIntConnect( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>excIntConnect( )</strong> - connect a C routine to an asynchronous exception vector (PowerPC, ARM)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS excIntConnect ( VOIDFUNCPTR * vector, /* exception vector to attach to */ VOIDFUNCPTR routine /* routine to be called */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine connects a specified C routine to a specified asynchronousexception vector.<p>When the C routine is invoked, interrupts are still locked. It is theresponsibility of the C routine to re-enable the interrupt.<p>The routine can be any normal C code, except that it must notinvoke certain operating system functions that may block or performI/O operations.<p></blockquote><h4>NOTE</h4><blockquote><p><p>On PowerPC, the vector is typically the external interrupt vector0x500 and the decrementer vector 0x900. An interrupt stub is createdand placed at <i>vector</i> in the exception table. The address of<i>routine</i> is stored in the interrupt stub code. When the asynchronousexception occurs the processor jumps to the interrupt stub code, savesonly the requested registers, and calls the C routines.<p>Before saving the requested registers, the interrupt stub switches from thecurrent task stack to the interrupt stack. For nested interrupts, nostack-switching is performed, because the interrupt is already set.<p></blockquote><h4>NOTE</h4><blockquote><p><p>On the ARM, the address of <i>routine</i> is stored in a function pointerto be called by the stub installed on the IRQ exception vectorfollowing an asynchronous exception. This routine is responsible fordetermining the interrupt source and despatching the correct handlerfor that source.<p>Before calling the routine, the interrupt stub switches to SVC mode,changes to a separate interrupt stack and saves necessary registers. Inthe case of a nested interrupt, no SVC stack switch occurs.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, always.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./excArchLib.html#top">excArchLib</a></b>, <b><a href="./excArchLib.html#excConnect">excConnect</a>( )</b>, <b><a href="./excArchLib.html#excVecSet">excVecSet</a>( )</b><hr><a name="excCrtConnect"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>excCrtConnect( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>excCrtConnect( )</strong> - connect a C routine to a critical exception vector (PowerPC 403)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS excCrtConnect ( VOIDFUNCPTR * vector, /* exception vector to attach to */ VOIDFUNCPTR routine /* routine to be called */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine connects a specified C routine to a specified critical exceptionvector. An exception stub is created and in placed at <i>vector</i> in theexception table. The address of <i>routine</i> is stored in the exception stubcode. When an exception occurs, the processor jumps to the exception stubcode, saves the registers, and call the C routines.<p>The routine can be any normal C code, except that it must notinvoke certain operating system functions that may block or performI/O operations.<p>The registers are saved to an Exception Stack Frame (ESF) which is placedon the stack of the task that has produced the exception. The ESF structureis defined in <b>h/arch/ppc/esfPpc.h</b>.<p>The only argument passed by the exception stub to the C routine is a pointerto the ESF containing the register values. The prototype of this C routineis as follows:<pre> void excHandler (ESFPPC *);</pre>When the C routine returns, the exception stub restores the registers savedin the ESF and continues execution of the current task.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, always.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./excArchLib.html#top">excArchLib</a></b>, <b><a href="./excArchLib.html#excIntConnect">excIntConnect</a>( )</b>, <b>excIntCrtConnect</b>, <b><a href="./excArchLib.html#excVecSet">excVecSet</a>( )</b><hr><a name="excIntCrtConnect"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>excIntCrtConnect( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>excIntCrtConnect( )</strong> - connect a C routine to a critical interrupt vector (PowerPC 403)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS excIntCrtConnect ( VOIDFUNCPTR * vector, /* exception vector to attach to */ VOIDFUNCPTR routine /* routine to be called */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine connects a specified C routine to a specified asynchronous critical exception vector such as the critical external interrupt vector (0x100), or the watchdog timer vector (0x1020). An interrupt stub is created and placed at <i>vector</i> in the exception table. The address of <i>routine</i> is stored in the interrupt stub code. When the asynchronous exception occurs,the processor jumps to the interrupt stub code, saves only the requested registers, and calls the C routines.<p>When the C routine is invoked, interrupts are still locked. It is theC routine's responsibility to re-enable interrupts.<p>The routine can be any normal C routine, except that it must notinvoke certain operating system functions that may block or performI/O operations.<p>Before the requested registers are saved, the interrupt stub switches from thecurrent task stack to the interrupt stack. In the case of nested interrupts, nostack switching is performed, because the interrupt stack is already set.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, always.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./excArchLib.html#top">excArchLib</a></b>, <b><a href="./excArchLib.html#excConnect">excConnect</a>( )</b>, <b>excCrtConnect</b>, <b><a href="./excArchLib.html#excVecSet">excVecSet</a>( )</b><hr><a name="excVecSet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>excVecSet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>excVecSet( )</strong> - set a CPU exception vector (PowerPC, ARM)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void excVecSet ( FUNCPTR * vector, /* vector offset */ FUNCPTR function /* address to place in vector */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine specifies the C routine that will be called when the exceptioncorresponding to <i>vector</i> occurs. This routine does not create theexception stub; it simply replaces the C routine to be called in theexception stub.<p></blockquote><h4>NOTE ARM</h4><blockquote><p><p>On the ARM, there is no <b><a href="./excArchLib.html#excConnect">excConnect</a>( )</b> routine, unlike the PowerPC. The Croutine is attached to a default stub using <b><a href="./excArchLib.html#excVecSet">excVecSet</a>( )</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./excArchLib.html#top">excArchLib</a></b>, <b><a href="./excArchLib.html#excVecGet">excVecGet</a>( )</b>, <b><a href="./excArchLib.html#excConnect">excConnect</a>( )</b>, <b><a href="./excArchLib.html#excIntConnect">excIntConnect</a>( )</b><hr><a name="excVecGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>excVecGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>excVecGet( )</strong> - get a CPU exception vector (PowerPC, ARM)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>FUNCPTR excVecGet ( FUNCPTR * vector /* vector offset */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns the address of the C routine currently connected to<i>vector</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>The address of the C routine.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./excArchLib.html#top">excArchLib</a></b>, <b><a href="./excArchLib.html#excVecSet">excVecSet</a>( )</b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -