1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 20:25:07 +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

@ -85,7 +85,6 @@ namespace Kernel {
[[noreturn]] static void init_stage2();
static void setup_serial_debug();
static void setup_interrupts();
static void setup_time_management();
VirtualConsole* tty0;
@ -121,7 +120,7 @@ extern "C" [[noreturn]] void init()
for (ctor_func_t* ctor = &start_ctors; ctor < &end_ctors; ctor++)
(*ctor)();
setup_interrupts();
InterruptManagement::initialize();
ACPI::initialize();
new VFS;
@ -358,28 +357,6 @@ extern "C" int __cxa_atexit(void (*)(void*), void*, void*)
return 0;
}
void setup_interrupts()
{
InterruptManagement::initialize();
if (!kernel_command_line().contains("smp")) {
InterruptManagement::the().switch_to_pic_mode();
return;
}
auto smp = kernel_command_line().get("smp");
if (smp == "off") {
InterruptManagement::the().switch_to_pic_mode();
return;
}
if (smp == "on") {
InterruptManagement::the().switch_to_ioapic_mode();
return;
}
klog() << "smp boot argmuent has an invalid value.";
hang();
}
void setup_time_management()
{
if (!kernel_command_line().contains("time")) {