hardware interrupt arrival




idtIRQ() (idtIRQ.S)
CLI (hard)


RTAI mounted?



No Yes
•if (IP7) jalr (rthal.mips_timer_interrupt)

mips_timer_interrupt()
(normal kernel)
•mask & ack irq
sti()
do_timer(regs)
•update compare
cli()
•re-enable irq
•return 1
dispatch_mips_timer_interrupt()
(in rtai)
mask & ack irq
save regs [IRQ_TIMER]
•if global handler { call it; }
else {assert pending irq}
hard_sti()
•if(in_rt) { linux_sti(); return 1;}

linux_sti()
call linux_isr for all pending linux irqs




()
call linux_isr for all pending linux irqs






call rtai_handler for all pending srqs



call rtai_handler for all pending srqs

else return 0;







else jalr (rthal.idt_interrupt) idt_interrupt()
(normal kernel dispatch)
•mask & ack irq
sti()
run action handlers
cli()
re-enable irq
return 1 (always)
dispatch_idt_interrupt()
(in rtai)

mask & ack irq
save regs [IRQ_GENERAL]
assert pending irq
hard_sti()
•if(in_rt) { linux_sti(); return 1;}
else return 0;
•if(v0) jr (ret_from_irq)