Interrupt controller made into state machine.