aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/memory/mmu.cpp
blob: ea232781c9bf559c08085b37dd017f3b2d6bdf81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "arch/memory/mmu.hpp"

#include "kapi/memory.hpp"

#include "arch/cpu/registers.hpp"

namespace arch::memory
{
  auto tlb_flush(kapi::memory::linear_address address) -> void
  {
    asm volatile("invlpg (%[input])" : /* no output from call */ : [input] "r"(address) : "memory");
  }

  auto tlb_flush_all() -> void
  {
    auto paging_root = cpu::cr3::read();
    cpu::cr3::write(paging_root);
  }
}  // namespace arch::memory