mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +00:00
Kernel: Simplify scanning BIOS/EBDA and MP parser initialization
Add a MappedROM::find_chunk_starting_with() helper since that's a very common usage pattern in clients of this code. Also convert MultiProcessorParser from a persistent singleton object to a temporary object constructed via a failable factory function.
This commit is contained in:
parent
84b7bc5e14
commit
4b847810bf
8 changed files with 47 additions and 101 deletions
|
@ -129,9 +129,9 @@ PhysicalAddress InterruptManagement::search_for_madt()
|
|||
{
|
||||
dbg() << "Early access to ACPI tables for interrupt setup";
|
||||
auto rsdp = ACPI::StaticParsing::find_rsdp();
|
||||
if (rsdp.is_null())
|
||||
if (!rsdp.has_value())
|
||||
return {};
|
||||
return ACPI::StaticParsing::find_table(rsdp, "APIC");
|
||||
return ACPI::StaticParsing::find_table(rsdp.value(), "APIC");
|
||||
}
|
||||
|
||||
InterruptManagement::InterruptManagement()
|
||||
|
@ -189,8 +189,10 @@ void InterruptManagement::switch_to_ioapic_mode()
|
|||
}
|
||||
APIC::init();
|
||||
APIC::enable_bsp();
|
||||
MultiProcessorParser::initialize();
|
||||
locate_pci_interrupt_overrides();
|
||||
|
||||
if (auto mp_parser = MultiProcessorParser::autodetect()) {
|
||||
m_pci_interrupt_overrides = mp_parser->get_pci_interrupt_redirections();
|
||||
}
|
||||
}
|
||||
|
||||
void InterruptManagement::locate_apic_data()
|
||||
|
@ -231,9 +233,4 @@ void InterruptManagement::locate_apic_data()
|
|||
}
|
||||
}
|
||||
|
||||
void InterruptManagement::locate_pci_interrupt_overrides()
|
||||
{
|
||||
m_pci_interrupt_overrides = MultiProcessorParser::the().get_pci_interrupt_redirections();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue