Kernel: Add invalidate() to MMU

This commit is contained in:
Bananymous 2023-05-28 18:05:30 +03:00
parent 187bb046aa
commit 3e93dae53c
2 changed files with 7 additions and 0 deletions

View File

@ -149,6 +149,12 @@ namespace Kernel
s_current = this; s_current = this;
} }
void MMU::invalidate(vaddr_t vaddr)
{
ASSERT(this == s_current);
asm volatile("invlpg (%0)" :: "r"(vaddr) : "memory");
}
void MMU::identity_map_page(paddr_t address, flags_t flags) void MMU::identity_map_page(paddr_t address, flags_t flags)
{ {
address &= PAGE_MASK; address &= PAGE_MASK;

View File

@ -43,6 +43,7 @@ namespace Kernel
vaddr_t get_free_page() const; vaddr_t get_free_page() const;
vaddr_t get_free_contiguous_pages(size_t page_count) const; vaddr_t get_free_contiguous_pages(size_t page_count) const;
void invalidate(vaddr_t);
void load(); void load();
void lock() const { m_lock.lock(); } void lock() const { m_lock.lock(); }