1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +00:00

Kernel: Simplify the Interrupt management initialization

This commit is contained in:
Liav A 2020-04-09 20:16:51 +03:00 committed by Andreas Kling
parent caa7a6c2fb
commit 8139688ef1
2 changed files with 7 additions and 24 deletions

View file

@ -28,6 +28,7 @@
#include <AK/StringView.h>
#include <Kernel/ACPI/MultiProcessorParser.h>
#include <Kernel/Arch/i386/CPU.h>
#include <Kernel/CommandLine.h>
#include <Kernel/Interrupts/APIC.h>
#include <Kernel/Interrupts/IOAPIC.h>
#include <Kernel/Interrupts/InterruptManagement.h>
@ -59,6 +60,11 @@ void InterruptManagement::initialize()
{
ASSERT(!InterruptManagement::initialized());
s_interrupt_management = new InterruptManagement();
if (kernel_command_line().lookup("smp").value_or("off") == "on")
InterruptManagement::the().switch_to_ioapic_mode();
else
InterruptManagement::the().switch_to_pic_mode();
}
void InterruptManagement::enumerate_interrupt_handlers(Function<void(GenericInterruptHandler&)> callback)