Kernel: MMU::get() is now MMU::kernel

MMU is can now be locked with RecursiveSpinLock.

Scheduler now has get_current_tid() that works before the Scheduler
is initialized. This allows RecursiveSpinLock usage early on.
This commit is contained in:
2023-05-28 16:18:18 +03:00
parent a2ee543fa1
commit 869de7283f
11 changed files with 100 additions and 63 deletions

View File

@@ -146,10 +146,10 @@ APIC* APIC::create()
return nullptr;
}
MMU::get().identity_map_page(apic->m_local_apic, MMU::Flags::ReadWrite | MMU::Flags::Present);
MMU::kernel().identity_map_page(apic->m_local_apic, MMU::Flags::ReadWrite | MMU::Flags::Present);
for (auto& io_apic : apic->m_io_apics)
{
MMU::get().identity_map_page(io_apic.address, MMU::Flags::ReadWrite | MMU::Flags::Present);
MMU::kernel().identity_map_page(io_apic.address, MMU::Flags::ReadWrite | MMU::Flags::Present);
io_apic.max_redirs = io_apic.read(IOAPIC_MAX_REDIRS);
}