robert-w-gries / rxinu

Rust implementation of Xinu educational operating system
Apache License 2.0
34 stars 4 forks source link

Fix deadlocks in keyboard irq and avoid future deadlocks in irq handlers #52

Closed robert-w-gries closed 6 years ago

robert-w-gries commented 6 years ago

Wrap all irq handler code in disable_then_restore to avoid deadlocks in the case where an interrupt is fired while pic::MASTER.lock().ack(); is executing.

Also, let's move the ack() for the timer handler so that the timer interrupt is enabled after expensive PIT_TICKS calculation is completed. It'd be more costly to allow interrupts during the check of an atomic because it'd lead to more atomic checks.