aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/memory/cpu/tlb.cpp
blob: 591d9fc7cd43c9596783996ae1338000d628bfbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "arch/memory/cpu/tlb.hpp"

#include "arch/memory/cpu/control_register.hpp"

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

  auto tlb_flush_all() -> void
  {
    write_control_register(cpu::control_register::CR3, read_control_register(cpu::control_register::CR3));
  }
}  // namespace teachos::arch::memory::cpu