@c @c COPYRIGHT (c) 1988-2002. @c On-Line Applications Research Corporation (OAR). @c All rights reserved. @c @c $Id$ @c @chapter Interrupt Processing @section Introduction Different types of processors respond to the occurrence of an interrupt in its own unique fashion. In addition, each processor type provides a control mechanism to allow the proper handling of an interrupt. The processor dependent response to the interrupt which modifies the execution state and results in the modification of the execution stream. This modification usually requires that an interrupt handler utilize the provided control mechanisms to return to the normal processing stream. Although RTEMS hides many of the processor dependent details of interrupt processing, it is important to understand how the RTEMS interrupt manager is mapped onto the processor's unique architecture. Discussed in this chapter are the the processor's response and control mechanisms as they pertain to RTEMS. @section Vectoring of Interrupt Handler Upon receipt of an interrupt the i960CA automatically performs the following actions: @itemize @bullet @item saves the local register set, @item sets the Frame Pointer (FP) to point to the interrupt stack, @item increments the FP by sixteen (16) to make room for the Interrupt Record, @item saves the current values of the arithmetic-controls (AC) register, the process-controls (PC) register, and the interrupt vector number are saved in the Interrupt Record, @item the CPU sets the Instruction Pointer (IP) to the address of 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 to the level of the current interrupt, and @item disables tracing. @end itemize A nested interrupt is processed similarly by the i960CA with the exception that the Frame Pointer (FP) already points to the interrupt stack. This means that the FP is NOT overwritten before space for the Interrupt Record is allocated. The state flag bit of the saved PC register in the Interrupt Record is examined by RTEMS to determine when an outer most interrupt is being exited. Therefore, the user application code MUST NOT modify this bit. @section Interrupt Record The structure of the Interrupt Record for the i960CA which is placed on the interrupt stack by the processor in response 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
Saved Process Controls | NFP-16 |
Saved Arithmetic Controls | NFP-12 |
UNUSED | NFP-8 |
UNUSED | NFP-4 |