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.
Wrap all irq handler code in
disable_then_restore
to avoid deadlocks in the case where an interrupt is fired whilepic::MASTER.lock().ack();
is executing.Also, let's move the
ack()
for the timer handler so that the timer interrupt is enabled after expensivePIT_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.