kernel/ATA: Read the Busmaster base port and verify it
This commit is contained in:
parent
aa6c5e09b1
commit
72deaa2025
@ -187,6 +187,14 @@ namespace ATA
|
|||||||
m_io_base = io_base_address;
|
m_io_base = io_base_address;
|
||||||
m_control_base = control_port_base_address + 2;
|
m_control_base = control_port_base_address + 2;
|
||||||
|
|
||||||
|
auto io_busmaster = m_controller->device().getBAR(4);
|
||||||
|
if (!io_busmaster.is_iospace())
|
||||||
|
{
|
||||||
|
kwarnln("ata: Channel %d's busmaster base BAR is not in IO space", m_channel_index);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
m_busmaster_base = io_busmaster.port() + (u16)(m_channel_index * 8u);
|
||||||
|
|
||||||
if (m_is_pci_native_mode) m_interrupt_line = PCI::read8(m_controller->device().address, PCI::InterruptLine);
|
if (m_is_pci_native_mode) m_interrupt_line = PCI::read8(m_controller->device().address, PCI::InterruptLine);
|
||||||
else
|
else
|
||||||
m_interrupt_line = m_channel_index ? 15 : 14;
|
m_interrupt_line = m_channel_index ? 15 : 14;
|
||||||
|
@ -120,6 +120,7 @@ namespace ATA
|
|||||||
|
|
||||||
u16 m_io_base;
|
u16 m_io_base;
|
||||||
u16 m_control_base;
|
u16 m_control_base;
|
||||||
|
u16 m_busmaster_base;
|
||||||
|
|
||||||
u8 m_current_drive = (u8)-1;
|
u8 m_current_drive = (u8)-1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user