CS452 - Real-Time Programming - Spring 2009

Lecture 15 - Interrupt Handling

Practical Detail

Interrupt Servicing

How to do it

  1. Find source of the interrupt
  2. Save state of interrupted task
  3. Restore kernel state
  4. EITHER, process interrupt in kernel
    1. acquire volatile data from device
    2. turn off interrupt source
      • in device
      • in PIC
    3. set up return value for AwaitEvent
    4. schedule
    5. exit from kernel
      • movs, or equivalent, moves SPSR to CPSR
      • goes to user mode
      • turns on interrupts

    OR, process interrupt in notifier

    1. exit, without scheduling, to notifier in svc mode
    2. acquire volatile data from device
    3. turn off interrupt source
      • in device
      • in PIC
    4. turn on interrupts & return to user mode in one instruction

Your code should operate correctly if there is another interrupt waiting which is taken immediately after interrupts are enabled.

Four Interrupt Servicing Methods





ARM Specific

Two controllers, nested

Registers at

47 registers per controller


  1. FIQ-configured interrupts (not vectored)
  2. IRQ-configured vectored interrupts
  3. IRQ-configured non-vectored interrupts

Return to: