mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:47:35 +00:00
Kernel: Simplify disable_irq() and enable_irq() methods in IRQHandler
Setting the m_enabled variable to true or false can help with monitoring the IRQHandler object(s) later, and there's no good reason to have an if-else statement in those methods anyway.
This commit is contained in:
parent
cb676f1211
commit
8b38be3072
1 changed files with 3 additions and 4 deletions
|
@ -36,6 +36,7 @@ IRQHandler::IRQHandler(u8 irq)
|
||||||
: GenericInterruptHandler(irq)
|
: GenericInterruptHandler(irq)
|
||||||
, m_responsible_irq_controller(InterruptManagement::the().get_responsible_irq_controller(irq))
|
, m_responsible_irq_controller(InterruptManagement::the().get_responsible_irq_controller(irq))
|
||||||
{
|
{
|
||||||
|
disable_irq();
|
||||||
}
|
}
|
||||||
|
|
||||||
IRQHandler::~IRQHandler()
|
IRQHandler::~IRQHandler()
|
||||||
|
@ -60,10 +61,9 @@ void IRQHandler::enable_irq()
|
||||||
#ifdef IRQ_DEBUG
|
#ifdef IRQ_DEBUG
|
||||||
dbg() << "Enable IRQ " << interrupt_number();
|
dbg() << "Enable IRQ " << interrupt_number();
|
||||||
#endif
|
#endif
|
||||||
|
m_enabled = true;
|
||||||
if (!m_shared_with_others)
|
if (!m_shared_with_others)
|
||||||
m_responsible_irq_controller->enable(*this);
|
m_responsible_irq_controller->enable(*this);
|
||||||
else
|
|
||||||
m_enabled = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRQHandler::disable_irq()
|
void IRQHandler::disable_irq()
|
||||||
|
@ -71,10 +71,9 @@ void IRQHandler::disable_irq()
|
||||||
#ifdef IRQ_DEBUG
|
#ifdef IRQ_DEBUG
|
||||||
dbg() << "Disable IRQ " << interrupt_number();
|
dbg() << "Disable IRQ " << interrupt_number();
|
||||||
#endif
|
#endif
|
||||||
|
m_enabled = false;
|
||||||
if (!m_shared_with_others)
|
if (!m_shared_with_others)
|
||||||
m_responsible_irq_controller->disable(*this);
|
m_responsible_irq_controller->disable(*this);
|
||||||
else
|
|
||||||
m_enabled = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRQHandler::change_irq_number(u8 irq)
|
void IRQHandler::change_irq_number(u8 irq)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue