1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:07:43 +00:00

Kernel: Enable IRQs before sending commands to devices

Without this fix, a very fast IRQ can preempt the enable_irq() call,
leaving that IRQ being unhandled.
This commit is contained in:
Liav A 2020-03-06 03:22:53 +02:00 committed by Andreas Kling
parent f33fb151b4
commit a3fa40fc07
3 changed files with 19 additions and 8 deletions

View file

@ -220,8 +220,6 @@ void SB16::handle_irq(RegisterState&)
void SB16::wait_for_irq()
{
cli();
enable_irq();
Thread::current->wait_on(m_irq_queue);
disable_irq();
}
@ -260,6 +258,9 @@ ssize_t SB16::write(FileDescription&, const u8* data, ssize_t length)
sample_count -= 1;
cli();
enable_irq();
dsp_write(command);
dsp_write(mode);
dsp_write((u8)sample_count);