mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:27:34 +00:00
PATA: Ignore interrupts that weren't generated by the disk
This commit is contained in:
parent
a2fd824dff
commit
5674a77bd6
1 changed files with 9 additions and 2 deletions
|
@ -183,12 +183,19 @@ void PATAChannel::wait_for_irq()
|
||||||
|
|
||||||
void PATAChannel::handle_irq(const RegisterState&)
|
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>();
|
u8 status = m_io_base.offset(ATA_REG_STATUS).in<u8>();
|
||||||
|
|
||||||
m_entropy_source.add_random_event(status);
|
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) {
|
if (status & ATA_SR_ERR) {
|
||||||
print_ide_status(status);
|
print_ide_status(status);
|
||||||
m_device_error = m_io_base.offset(ATA_REG_ERROR).in<u8>();
|
m_device_error = m_io_base.offset(ATA_REG_ERROR).in<u8>();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue