mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 02:54:54 +03:00
Kernel: Ensure SMP mode is not enabled if IOAPIC mode is disabled
We need to use the IOAPIC in SMP mode, so if the user requested to disable it, we can't enable SMP mode either.
This commit is contained in:
parent
f11fbb6415
commit
30659040ed
Notes:
sideshowbarker
2024-07-17 22:33:13 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/30659040edc Pull-request: https://github.com/SerenityOS/serenity/pull/11315 Reviewed-by: https://github.com/bgianfo
@ -108,9 +108,18 @@ UNMAP_AFTER_INIT bool CommandLine::is_ide_enabled() const
|
||||
|
||||
UNMAP_AFTER_INIT bool CommandLine::is_smp_enabled() const
|
||||
{
|
||||
// Note: We can't enable SMP mode without enabling the IOAPIC.
|
||||
if (!is_ioapic_enabled())
|
||||
return false;
|
||||
return lookup("smp"sv).value_or("off"sv) == "on"sv;
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT bool CommandLine::is_smp_enabled_without_ioapic_enabled() const
|
||||
{
|
||||
auto smp_enabled = lookup("smp"sv).value_or("off"sv) == "on"sv;
|
||||
return smp_enabled && !is_ioapic_enabled();
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT bool CommandLine::is_ioapic_enabled() const
|
||||
{
|
||||
auto value = lookup("enable_ioapic"sv).value_or("on"sv);
|
||||
|
@ -60,6 +60,7 @@ public:
|
||||
[[nodiscard]] bool is_boot_profiling_enabled() const;
|
||||
[[nodiscard]] bool is_ide_enabled() const;
|
||||
[[nodiscard]] bool is_ioapic_enabled() const;
|
||||
[[nodiscard]] bool is_smp_enabled_without_ioapic_enabled() const;
|
||||
[[nodiscard]] bool is_smp_enabled() const;
|
||||
[[nodiscard]] bool is_physical_networking_disabled() const;
|
||||
[[nodiscard]] bool is_vmmouse_enabled() const;
|
||||
|
@ -40,7 +40,9 @@ UNMAP_AFTER_INIT void InterruptManagement::initialize()
|
||||
{
|
||||
VERIFY(!InterruptManagement::initialized());
|
||||
s_interrupt_management = new InterruptManagement();
|
||||
|
||||
if (!kernel_command_line().is_smp_enabled_without_ioapic_enabled()) {
|
||||
dbgln("Can't enable SMP mode without IOAPIC mode being enabled");
|
||||
}
|
||||
if (!kernel_command_line().is_ioapic_enabled() && !kernel_command_line().is_smp_enabled())
|
||||
InterruptManagement::the().switch_to_pic_mode();
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user