mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
PATA: Ignore interrupts that weren't generated by the disk
This commit is contained in:
parent
a2fd824dff
commit
5674a77bd6
Notes:
sideshowbarker
2024-07-19 05:17:38 +09:00
Author: https://github.com/tomuta Commit: https://github.com/SerenityOS/serenity/commit/5674a77bd69 Pull-request: https://github.com/SerenityOS/serenity/pull/2513
1 changed files with 9 additions and 2 deletions
|
@ -183,12 +183,19 @@ void PATAChannel::wait_for_irq()
|
|||
|
||||
void PATAChannel::handle_irq(const RegisterState&)
|
||||
{
|
||||
// FIXME: We might get random interrupts due to malfunctioning hardware, so we should check that we actually requested something to happen.
|
||||
|
||||
u8 status = m_io_base.offset(ATA_REG_STATUS).in<u8>();
|
||||
|
||||
m_entropy_source.add_random_event(status);
|
||||
|
||||
u8 bstatus = m_bus_master_base.offset(2).in<u8>();
|
||||
if (!(bstatus & 0x4)) {
|
||||
// interrupt not from this device, ignore
|
||||
#ifdef PATA_DEBUG
|
||||
klog() << "PATAChannel: ignore interrupt";
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
if (status & ATA_SR_ERR) {
|
||||
print_ide_status(status);
|
||||
m_device_error = m_io_base.offset(ATA_REG_ERROR).in<u8>();
|
||||
|
|
Loading…
Add table
Reference in a new issue