Kernel: Add actual register values to x86_64 kernel panic

Very hackish implementation, but we now get actual registers at the
time of the interrupt happening
This commit is contained in:
2023-01-30 18:52:38 +02:00
parent bfe3426f6d
commit 6dc22b7251
8 changed files with 77 additions and 66 deletions

View File

@@ -358,8 +358,11 @@ void APIC::EnableIrq(uint8_t irq)
ioapic->Write(IOAPIC_REDIRS + gsi * 2 + 1, redir.hi_dword);
}
void APIC::GetISR(uint32_t out[8])
bool APIC::IsInService(uint8_t irq)
{
for (uint32_t i = 0; i < 8; i++)
out[i] = ReadFromLocalAPIC(LAPIC_IS_REG + i * 0x10);
uint32_t dword = (irq + IRQ_VECTOR_BASE) / 32;
uint32_t bit = (irq + IRQ_VECTOR_BASE) % 32;
uint32_t isr = ReadFromLocalAPIC(LAPIC_IS_REG + dword * 0x10);
return isr & (1 << bit);
}