source: rtems/doc/supplements/i960/intr_NOTIMES.t @ ae68ff0

4.104.114.84.95
Last change on this file since ae68ff0 was ae68ff0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/27/97 at 12:40:11

Initial revision

  • Property mode set to 100644
File size: 8.2 KB
Line 
1@ifinfo
2@node Interrupt Processing, Interrupt Processing Introduction, Memory Model Flat Memory Model, Top
3@end ifinfo
4@chapter Interrupt Processing
5@ifinfo
6@menu
7* Interrupt Processing Introduction::
8* Interrupt Processing Vectoring of Interrupt Handler::
9* Interrupt Processing Interrupt Record::
10* Interrupt Processing Interrupt Levels::
11* Interrupt Processing Disabling of Interrupts by RTEMS::
12* Interrupt Processing Register Cache Flushing::
13* Interrupt Processing Interrupt Stack::
14@end menu
15@end ifinfo
16
17@ifinfo
18@node Interrupt Processing Introduction, Interrupt Processing Vectoring of Interrupt Handler, Interrupt Processing, Interrupt Processing
19@end ifinfo
20@section Introduction
21
22Different types of processors respond to the
23occurrence of an interrupt in its own unique fashion. In
24addition, each processor type provides a control mechanism to
25allow the proper handling of an interrupt.  The processor
26dependent response to the interrupt which modifies the execution
27state and results in the modification of the execution stream.
28This modification usually requires that an interrupt handler
29utilize the provided control mechanisms to return to the normal
30processing stream.  Although RTEMS hides many of the processor
31dependent details of interrupt processing, it is important to
32understand how the RTEMS interrupt manager is mapped onto the
33processor's unique architecture. Discussed in this chapter are
34the the processor's response and control mechanisms as they
35pertain to RTEMS.
36
37@ifinfo
38@node Interrupt Processing Vectoring of Interrupt Handler, Interrupt Processing Interrupt Record, Interrupt Processing Introduction, Interrupt Processing
39@end ifinfo
40@section Vectoring of Interrupt Handler
41
42Upon receipt of an interrupt  the i960CA
43automatically performs the following actions:
44
45@itemize @bullet
46@item saves the local register set,
47
48@item sets the Frame Pointer (FP) to point to the interrupt
49stack,
50
51@item increments the FP by sixteen (16) to make room for the
52Interrupt Record,
53
54@item saves the current values of the arithmetic-controls (AC)
55register, the process-controls (PC) register, and the interrupt
56vector number are saved in the Interrupt Record,
57
58@item the CPU sets the Instruction Pointer (IP) to the address
59of the first instruction in the interrupt handler,
60
61@item the return-status field of the Previous Frame Pointer
62(PFP or R0) register is set to interrupt return,
63
64@item sets the PC state bit to interrupted,
65
66@item sets the current interrupt disable level in the PC to
67the level of the current interrupt, and
68
69@item disables tracing.
70@end itemize
71
72A nested interrupt is processed similarly by the
73i960CA with the exception that the Frame Pointer (FP) already
74points to the interrupt stack.  This means that the FP is NOT
75overwritten before space for the Interrupt Record is allocated.
76
77The state flag bit of the saved PC register in the
78Interrupt Record is examined by RTEMS to determine when an outer
79most interrupt is being exited.  Therefore, the user application
80code MUST NOT modify this bit.
81
82@ifinfo
83@node Interrupt Processing Interrupt Record, Interrupt Processing Interrupt Levels, Interrupt Processing Vectoring of Interrupt Handler, Interrupt Processing
84@end ifinfo
85@section Interrupt Record
86
87The structure of the Interrupt Record for the i960CA
88which is placed on the interrupt stack by the processor in
89response to an interrupt is as follows:
90
91@ifset use-ascii
92@example
93@group
94               +---------------------------+
95               |  Saved Process Controls   | NFP-16
96               +---------------------------+
97               | Saved Arithmetic Controls | NFP-12
98               +---------------------------+
99               |           UNUSED          | NFP-8
100               +---------------------------+
101               |           UNUSED          | NFP-4
102               +---------------------------+
103@end group
104@end example
105@end ifset
106
107@ifset use-tex
108@sp 1
109@tex
110\centerline{\vbox{\offinterlineskip\halign{
111\strut\vrule#&
112\hbox to 2.00in{\enskip\hfil#\hfil}&
113\vrule#&
114\hbox to 1.00in{\enskip\hfil#\hfil}
115\cr
116\multispan{3}\hrulefill\cr
117& Saved Process Controls && NFP-16\cr
118\multispan{3}\hrulefill\cr
119& Saved Arithmetic Controls && NFP-12\cr
120\multispan{3}\hrulefill\cr
121& UNUSED && NFP-8\cr
122\multispan{3}\hrulefill\cr
123& UNUSED && NFP-4\cr
124\multispan{3}\hrulefill\cr
125}}\hfil}
126@end tex
127@end ifset
128 
129@ifset use-html
130@html
131<CENTER>
132  <TABLE COLS=2 WIDTH="40%" BORDER=2>
133<TR><TD ALIGN=center><STRONG>Saved Process Controls</STRONG></TD>
134    <TD ALIGN=center>NFP-16</TD></TR>
135<TR><TD ALIGN=center><STRONG>Saved Arithmetic Controls</STRONG></TD>
136    <TD ALIGN=center>NFP-12</TD></TR>
137<TR><TD ALIGN=center><STRONG>UNUSED</STRONG></TD>
138    <TD ALIGN=center>NFP-8</TD></TR>
139<TR><TD ALIGN=center><STRONG>UNUSED</STRONG></TD>
140    <TD ALIGN=center>NFP-4</TD></TR>
141  </TABLE>
142</CENTER>
143@end html
144@end ifset
145
146@ifinfo
147@node Interrupt Processing Interrupt Levels, Interrupt Processing Disabling of Interrupts by RTEMS, Interrupt Processing Interrupt Record, Interrupt Processing
148@end ifinfo
149@section Interrupt Levels
150
151Thirty-two levels (0-31) of interrupt priorities are
152supported by the i960CA microprocessor with level thirty-one
153(31) being the highest priority.  Level zero (0) indicates that
154interrupts are fully enabled.  Interrupt requests for interrupts
155with priorities less than or equal to the current interrupt mask
156level are ignored.
157
158Although RTEMS supports 256 interrupt levels, the
159i960CA only supports thirty-two.  RTEMS interrupt levels 0
160through 31 directly correspond to i960CA interrupt levels.  All
161other RTEMS interrupt levels are undefined and their behavior is
162unpredictable.
163
164@ifinfo
165@node Interrupt Processing Disabling of Interrupts by RTEMS, Interrupt Processing Register Cache Flushing, Interrupt Processing Interrupt Levels, Interrupt Processing
166@end ifinfo
167@section Disabling of Interrupts by RTEMS
168
169During the execution of directive calls, critical
170sections of code may be executed.  When these sections are
171encountered, RTEMS disables interrupts to level thirty-one (31)
172before the execution of this section and restores them to the
173previous level upon completion of the section.  RTEMS has been
174optimized to insure that interrupts are disabled for less than
175RTEMS_MAXIMUM_DISABLE_PERIOD microseconds on a
176RTEMS_MAXIMUM_DISABLE_PERIOD_MHZ Mhz i960CA with zero wait states.
177These numbers will vary based the number of wait states and
178processor speed present on the target board.  [NOTE:  This
179calculation was most recently performed for Release
180RTEMS_RELEASE_FOR_MAXIMUM_DISABLE_PERIOD.]
181
182Non-maskable interrupts (NMI) cannot be disabled, and
183ISRs which execute at this level MUST NEVER issue RTEMS system
184calls.  If a directive is invoked, unpredictable results may
185occur due to the inability of RTEMS to protect its critical
186sections.  However, ISRs that make no system calls may safely
187execute as non-maskable interrupts.
188
189@ifinfo
190@node Interrupt Processing Register Cache Flushing, Interrupt Processing Interrupt Stack, Interrupt Processing Disabling of Interrupts by RTEMS, Interrupt Processing
191@end ifinfo
192@section Register Cache Flushing
193
194The i960CA version of the RTEMS interrupt manager is
195optimized to insure that the flushreg instruction is only
196executed when a context switch is necessary.  The flushreg
197instruction flushes the i960CA register set cache and takes (14
198+ 23 * number of sets flushed) cycles to execute.  As the i960CA
199supports caching of from five to sixteen register sets, this
200instruction takes from 129 to 382 cycles (3.90 to 11.57
201microseconds at 33 Mhz) to execute given no wait state memory.
202RTEMS flushes the register set cache only at the conclusion of
203the outermost ISR when a context switch is necessary.  The
204register set cache will not be flushed as part of processing a
205nested interrupt or when a context switch is not necessary.
206This optimization is essential to providing high-performance
207interrupt management on the i960CA.
208
209@ifinfo
210@node Interrupt Processing Interrupt Stack, Default Fatal Error Processing, Interrupt Processing Register Cache Flushing, Interrupt Processing
211@end ifinfo
212@section Interrupt Stack
213
214On the i960CA, RTEMS allocates the interrupt stack
215from the Workspace Area.  The amount of memory allocated for the
216interrupt stack is determined by the interrupt_stack_size field
217in the CPU Configuration Table.  During the initialization
218process, RTEMS will install its interrupt stack.
219
220
Note: See TracBrowser for help on using the repository browser.