mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09: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:
parent
f33fb151b4
commit
a3fa40fc07
Notes:
sideshowbarker
2024-07-19 08:52:53 +09:00
Author: https://github.com/supercomputer7
Commit: a3fa40fc07
Pull-request: https://github.com/SerenityOS/serenity/pull/1355
Reviewed-by: https://github.com/awesomekling
3 changed files with 19 additions and 8 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue