fix: irq manager handle controller
Enable/disable hardware interrupts in the IRQ's controller through IRQ manager.
This commit is contained in:
@@ -26,8 +26,6 @@ void arch::init() {
|
|||||||
|
|
||||||
static constexpr hwirq_t PIT_HWIRQ = 0x00;
|
static constexpr hwirq_t PIT_HWIRQ = 0x00;
|
||||||
|
|
||||||
m_picController.enable(PIT_HWIRQ);
|
|
||||||
|
|
||||||
irq_t pitIrq = m_irqManager.allocate();
|
irq_t pitIrq = m_irqManager.allocate();
|
||||||
m_irqManager.bind(pitIrq, m_picController, PIT_HWIRQ, 0x20);
|
m_irqManager.bind(pitIrq, m_picController, PIT_HWIRQ, 0x20);
|
||||||
m_irqManager.register_handler(pitIrq, pit::handler, &m_pit);
|
m_irqManager.register_handler(pitIrq, pit::handler, &m_pit);
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ bool irq_manager::enable(irq_t irq) {
|
|||||||
auto* entry = at(irq);
|
auto* entry = at(irq);
|
||||||
if (entry == nullptr) return false;
|
if (entry == nullptr) return false;
|
||||||
entry->enabled = true;
|
entry->enabled = true;
|
||||||
|
entry->controller->enable(entry->hwirq);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,6 +72,7 @@ bool irq_manager::disable(irq_t irq) {
|
|||||||
auto* entry = at(irq);
|
auto* entry = at(irq);
|
||||||
if (entry == nullptr) return false;
|
if (entry == nullptr) return false;
|
||||||
entry->enabled = false;
|
entry->enabled = false;
|
||||||
|
entry->controller->disable(entry->hwirq);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user