mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:57:35 +00:00
Kernel: Fix GenericInterruptHandler problems with virtual functions
Because registering and unregistering interrupt handlers triggers calls to virtual functions, we can't do this in the constructor and destructor. Fixes #5539
This commit is contained in:
parent
183ebaee91
commit
32d9534c67
11 changed files with 112 additions and 39 deletions
|
@ -36,7 +36,9 @@ namespace Kernel {
|
|||
|
||||
UNMAP_AFTER_INIT void SharedIRQHandler::initialize(u8 interrupt_number)
|
||||
{
|
||||
new SharedIRQHandler(interrupt_number);
|
||||
auto* handler = new SharedIRQHandler(interrupt_number);
|
||||
handler->register_interrupt_handler();
|
||||
handler->disable_interrupt_vector();
|
||||
}
|
||||
|
||||
void SharedIRQHandler::register_handler(GenericInterruptHandler& handler)
|
||||
|
@ -71,7 +73,6 @@ SharedIRQHandler::SharedIRQHandler(u8 irq)
|
|||
#if INTERRUPT_DEBUG
|
||||
klog() << "Shared Interrupt Handler registered @ " << interrupt_number();
|
||||
#endif
|
||||
disable_interrupt_vector();
|
||||
}
|
||||
|
||||
SharedIRQHandler::~SharedIRQHandler()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue