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

Kernel: Allow switching to IOAPIC mode even without enabling SMP

This small change allows to use the IOAPIC by default without to enable
SMP mode, which emulates Uni-Processor setup with IOAPIC instead of
using the PIC.

This opens the opportunity to utilize other types of interrupts like MSI
and MSI-X interrupts.
This commit is contained in:
Liav A 2021-11-28 17:38:10 +02:00 committed by Andreas Kling
parent f57900a41b
commit ac7953f945
5 changed files with 41 additions and 29 deletions

View file

@ -41,10 +41,10 @@ UNMAP_AFTER_INIT void InterruptManagement::initialize()
VERIFY(!InterruptManagement::initialized());
s_interrupt_management = new InterruptManagement();
if (kernel_command_line().is_smp_enabled())
InterruptManagement::the().switch_to_ioapic_mode();
else
if (!kernel_command_line().is_ioapic_enabled() && !kernel_command_line().is_smp_enabled())
InterruptManagement::the().switch_to_pic_mode();
else
InterruptManagement::the().switch_to_ioapic_mode();
}
void InterruptManagement::enumerate_interrupt_handlers(Function<void(GenericInterruptHandler&)> callback)
@ -220,7 +220,7 @@ UNMAP_AFTER_INIT void InterruptManagement::locate_apic_data()
dbgln("Interrupts: Overriding INT {:#x} with GSI {}, for bus {:#x}",
interrupt_override_entry->source,
global_system_interrupt,
flags);
interrupt_override_entry->bus);
}
madt_entry = (ACPI::Structures::MADTEntryHeader*)(VirtualAddress(madt_entry).offset(entry_length).get());
entries_length -= entry_length;