forked from Bananymous/banan-os
Kernel: Map all ACPI tables on initialization
This makes their usage much easier and less error prone They won't mapped be processes when we get to there, so this won't be a problem
This commit is contained in:
@@ -91,15 +91,13 @@ APIC* APIC::create()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto header_or_error = Kernel::ACPI::get().get_header("APIC");
|
||||
if (header_or_error.is_error())
|
||||
const MADT* madt = (const MADT*)Kernel::ACPI::get().get_header("APIC");
|
||||
if (madt == nullptr)
|
||||
{
|
||||
dprintln("{}", header_or_error.error());
|
||||
dprintln("Could not find MADT header");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const MADT* madt = (const MADT*)header_or_error.value();
|
||||
|
||||
APIC* apic = new APIC;
|
||||
apic->m_local_apic = madt->local_apic;
|
||||
for (uint32_t i = 0x00; i <= 0xFF; i++)
|
||||
@@ -139,8 +137,6 @@ APIC* APIC::create()
|
||||
madt_entry_addr += entry->length;
|
||||
}
|
||||
|
||||
Kernel::ACPI::get().unmap_header(madt);
|
||||
|
||||
if (apic->m_local_apic == 0 || apic->m_io_apics.empty())
|
||||
{
|
||||
dprintln("MADT did not provide necessary information");
|
||||
|
||||
Reference in New Issue
Block a user