summaryrefslogtreecommitdiff
path: root/src/arch/amd64/paging.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/amd64/paging.c')
-rw-r--r--src/arch/amd64/paging.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/arch/amd64/paging.c b/src/arch/amd64/paging.c
index 607267e..604e0a0 100644
--- a/src/arch/amd64/paging.c
+++ b/src/arch/amd64/paging.c
@@ -103,7 +103,7 @@ static void load_pd(void *phys) {
return;
pt->address = (uint64_t)phys >> 12;
pt->flags = F_PRESENT | F_WRITEABLE;
- invlpg(pdpt_mapped);
+ invlpg(pd_mapped);
}
static void load_pt(void *phys) {
@@ -456,10 +456,14 @@ static int map_pages(
page->address = (uint64_t)phys >> 12;
page->flags = F_PRESENT | flags;
- invlpg(virt);
+
+ if (flags & F_GLOBAL)
+ invlpg(virt);
}
+ __asm volatile("mov %cr3, %rax; mov %rax, %cr3;");
+
return 0;
failed: