mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:57:35 +00: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
3 changed files with 13 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue