mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
Fixed number of args in ahci interrupt log call
This commit is contained in:
@@ -76,7 +76,7 @@ hba::hba(pci_device *device)
|
|||||||
unsigned ports = (icap & 0xf) + 1;
|
unsigned ports = (icap & 0xf) + 1;
|
||||||
unsigned slots = ((icap >> 8) & 0x1f) + 1;
|
unsigned slots = ((icap >> 8) & 0x1f) + 1;
|
||||||
|
|
||||||
log::debug(logs::driver, " %d ports", ports);
|
log::debug(logs::driver, " %d ports: %08x", ports, m_data->port_impl);
|
||||||
log::debug(logs::driver, " %d command slots", slots);
|
log::debug(logs::driver, " %d command slots", slots);
|
||||||
|
|
||||||
auto *pd = reinterpret_cast<port_data volatile *>(
|
auto *pd = reinterpret_cast<port_data volatile *>(
|
||||||
|
|||||||
@@ -383,7 +383,7 @@ port::issue_command(int slot)
|
|||||||
void
|
void
|
||||||
port::handle_interrupt()
|
port::handle_interrupt()
|
||||||
{
|
{
|
||||||
log::debug(logs::driver, "AHCI port %d got an interrupt");
|
log::debug(logs::driver, "AHCI port %d got an interrupt", m_index);
|
||||||
|
|
||||||
// TODO: handle other states in interrupt_status
|
// TODO: handle other states in interrupt_status
|
||||||
|
|
||||||
@@ -407,8 +407,11 @@ port::handle_interrupt()
|
|||||||
|
|
||||||
uint32_t ci = m_data->cmd_issue;
|
uint32_t ci = m_data->cmd_issue;
|
||||||
for (int i = 0; i < 32; ++i) {
|
for (int i = 0; i < 32; ++i) {
|
||||||
|
// Skip commands still listed as "issued"
|
||||||
if (ci & (1 << i)) continue;
|
if (ci & (1 << i)) continue;
|
||||||
|
|
||||||
|
// Any commands not still listed as "issued" that are still pending for
|
||||||
|
// the driver are now finished, so handle them.
|
||||||
pending &p = m_pending[i];
|
pending &p = m_pending[i];
|
||||||
switch (p.type) {
|
switch (p.type) {
|
||||||
case command_type::read:
|
case command_type::read:
|
||||||
@@ -421,6 +424,8 @@ port::handle_interrupt()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clear the whole status register to mark it as handled
|
||||||
m_data->interrupt_status = m_data->interrupt_status;
|
m_data->interrupt_status = m_data->interrupt_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user