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

📄 intr_notimes.t

📁 RTEMS (Real-Time Executive for Multiprocessor Systems) is a free open source real-time operating sys
💻 T
字号:
@c@c  COPYRIGHT (c) 1988-2002.@c  On-Line Applications Research Corporation (OAR).@c  All rights reserved.@c@c  $Id: intr_NOTIMES.t,v 1.6 2002/01/17 21:47:46 joel Exp $@c@chapter Interrupt Processing@section IntroductionDifferent types of processors respond to theoccurrence of an interrupt in its own unique fashion. Inaddition, each processor type provides a control mechanism toallow the proper handling of an interrupt.  The processordependent response to the interrupt which modifies the executionstate and results in the modification of the execution stream.This modification usually requires that an interrupt handlerutilize the provided control mechanisms to return to the normalprocessing stream.  Although RTEMS hides many of the processordependent details of interrupt processing, it is important tounderstand how the RTEMS interrupt manager is mapped onto theprocessor's unique architecture. Discussed in this chapter arethe the processor's response and control mechanisms as theypertain to RTEMS.@section Vectoring of Interrupt HandlerUpon receipt of an interrupt  the i960CAautomatically performs the following actions:@itemize @bullet@item saves the local register set,@item sets the Frame Pointer (FP) to point to the interruptstack,@item increments the FP by sixteen (16) to make room for theInterrupt Record,@item saves the current values of the arithmetic-controls (AC)register, the process-controls (PC) register, and the interruptvector number are saved in the Interrupt Record,@item the CPU sets the Instruction Pointer (IP) to the addressof the first instruction in the interrupt handler,@item the return-status field of the Previous Frame Pointer(PFP or R0) register is set to interrupt return,@item sets the PC state bit to interrupted,@item sets the current interrupt disable level in the PC tothe level of the current interrupt, and@item disables tracing.@end itemizeA nested interrupt is processed similarly by thei960CA with the exception that the Frame Pointer (FP) alreadypoints to the interrupt stack.  This means that the FP is NOToverwritten before space for the Interrupt Record is allocated.The state flag bit of the saved PC register in theInterrupt Record is examined by RTEMS to determine when an outermost interrupt is being exited.  Therefore, the user applicationcode MUST NOT modify this bit.@section Interrupt RecordThe structure of the Interrupt Record for the i960CAwhich is placed on the interrupt stack by the processor inresponse to an interrupt is as follows:@ifset use-ascii@example@group               +---------------------------+               |  Saved Process Controls   | NFP-16               +---------------------------+               | Saved Arithmetic Controls | NFP-12               +---------------------------+               |           UNUSED          | NFP-8               +---------------------------+               |           UNUSED          | NFP-4               +---------------------------+@end group@end example@end ifset@ifset use-tex@sp 1@tex\centerline{\vbox{\offinterlineskip\halign{\strut\vrule#&\hbox to 2.00in{\enskip\hfil#\hfil}&\vrule#&\hbox to 1.00in{\enskip\hfil#\hfil}\cr\multispan{3}\hrulefill\cr& Saved Process Controls && NFP-16\cr\multispan{3}\hrulefill\cr& Saved Arithmetic Controls && NFP-12\cr\multispan{3}\hrulefill\cr& UNUSED && NFP-8\cr\multispan{3}\hrulefill\cr& UNUSED && NFP-4\cr\multispan{3}\hrulefill\cr}}\hfil}@end tex@end ifset @ifset use-html@html<CENTER>  <TABLE COLS=2 WIDTH="40%" BORDER=2><TR><TD ALIGN=center><STRONG>Saved Process Controls</STRONG></TD>    <TD ALIGN=center>NFP-16</TD></TR><TR><TD ALIGN=center><STRONG>Saved Arithmetic Controls</STRONG></TD>    <TD ALIGN=center>NFP-12</TD></TR><TR><TD ALIGN=center><STRONG>UNUSED</STRONG></TD>    <TD ALIGN=center>NFP-8</TD></TR><TR><TD ALIGN=center><STRONG>UNUSED</STRONG></TD>    <TD ALIGN=center>NFP-4</TD></TR>  </TABLE></CENTER>@end html@end ifset@section Interrupt LevelsThirty-two levels (0-31) of interrupt priorities aresupported by the i960CA microprocessor with level thirty-one(31) being the highest priority.  Level zero (0) indicates thatinterrupts are fully enabled.  Interrupt requests for interruptswith priorities less than or equal to the current interrupt masklevel are ignored.Although RTEMS supports 256 interrupt levels, thei960CA only supports thirty-two.  RTEMS interrupt levels 0through 31 directly correspond to i960CA interrupt levels.  Allother RTEMS interrupt levels are undefined and their behavior isunpredictable.@section Disabling of Interrupts by RTEMSDuring the execution of directive calls, criticalsections of code may be executed.  When these sections areencountered, RTEMS disables interrupts to level thirty-one (31)before the execution of this section and restores them to theprevious level upon completion of the section.  RTEMS has beenoptimized to insure that interrupts are disabled for less thanRTEMS_MAXIMUM_DISABLE_PERIOD microseconds on aRTEMS_MAXIMUM_DISABLE_PERIOD_MHZ Mhz i960CA with zero wait states.These numbers will vary based the number of wait states andprocessor speed present on the target board.  [NOTE:  Thiscalculation was most recently performed for ReleaseRTEMS_RELEASE_FOR_MAXIMUM_DISABLE_PERIOD.]Non-maskable interrupts (NMI) cannot be disabled, andISRs which execute at this level MUST NEVER issue RTEMS systemcalls.  If a directive is invoked, unpredictable results mayoccur due to the inability of RTEMS to protect its criticalsections.  However, ISRs that make no system calls may safelyexecute as non-maskable interrupts.@section Register Cache FlushingThe i960CA version of the RTEMS interrupt manager isoptimized to insure that the flushreg instruction is onlyexecuted when a context switch is necessary.  The flushreginstruction flushes the i960CA register set cache and takes (14+ 23 * number of sets flushed) cycles to execute.  As the i960CAsupports caching of from five to sixteen register sets, thisinstruction takes from 129 to 382 cycles (3.90 to 11.57microseconds at 33 Mhz) to execute given no wait state memory.RTEMS flushes the register set cache only at the conclusion ofthe outermost ISR when a context switch is necessary.  Theregister set cache will not be flushed as part of processing anested interrupt or when a context switch is not necessary.This optimization is essential to providing high-performanceinterrupt management on the i960CA.@section Interrupt StackOn the i960CA, RTEMS allocates the interrupt stackfrom the Workspace Area.  The amount of memory allocated for theinterrupt stack is determined by the interrupt_stack_size fieldin the CPU Configuration Table.  During the initializationprocess, RTEMS will install its interrupt stack.

⌨️ 快捷键说明

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