
ML671000 User’s Manual
Chapter 4 Interrupt Controller
4-15
4.4.2.3. Interrupt Level Control Example
Figure 4-9 gives an example of a level 2 interrupt service routine interrupted by a level 7 interrupt
request, which in turn is interrupted by an FIQ interrupt request.
t1. Level 2 interrupt request
The interrupt controller sets the interrupt request level register (IRLR) to 2. It simultaneously
asserts the nIRQ signal to produce an IRQ exception request to the CPU.
t2. IRQ exception acceptance
The CPU accepts the request and switches to the IRQ handler.
t3. INR readout
The IRQ handler reads the interrupt number register (INR). Because the interrupt request
level register (IRLR) contains 2, the interrupt controller sets bit 2 (CILR[2]) in the current
interrupt level register (CILR) to “1,” negating the nIRQ signal.
t4. Shift to level 2 interrupt service routine
To prepare to accept interrupt requests with higher interrupt levels, the level 2 interrupt service
routine saves the link register (R14_irq) and the saved program status register (SPSR_irq) to
the stack. It then resets the I bit in CPSR to “0.”
t5. Level 7 interrupt request
The interrupt controller sets the interrupt request level register (IRLR) to 7. It simultaneously
asserts the nIRQ signal to produce an IRQ exception request to the CPU.
t6. IRQ exception acceptance
The CPU accepts the request and switches to the IRQ handler.
t7. INR readout
The IRQ handler reads the interrupt number register (INR). Because the interrupt request level
register (IRLR) contains 7, the interrupt controller sets bit 7 (CILR[7]) in the current interrupt
level register (CILR) to “1,” negating the nIRQ signal.
t8. Shift to level 7 interrupt service routine
To prepare to accept interrupt requests with higher interrupt levels, the level 7 interrupt service
routine saves the link register (R14_irq) and the saved program status register (SPSR_irq) to
the stack. It then resets the I bit in CPSR to “0.”
t9. FIQ interrupt request
The interrupt controller asserts the nFIQ signal to produce an FIQ exception request to the
CPU.
t10. FIQ exception acceptance
The CPU accepts the request and switches to the FIQ handler.
t11. EFIQR clear
The FIQ handler resets the EFIQR bit to “0” to clear the interrupt request, negating the nFIQ
signal.
t12. Return from FIQ handler
The FIQ handler executes the SUBS PC, R14_fiq, #4 instruction to restore the link register
(R14_irq) and the saved program status register (SPSR_irq) to their contents before the FIQ
interrupt request.