summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-02-01 14:43:11 -0500
committerFreya Murphy <freya@freyacat.org>2024-02-01 14:43:11 -0500
commit341c95f5357c451e2420fb81e64ec6b42c40e124 (patch)
tree725afc747d5f0ca9ad4b5e8558f5f1cf178fae9b /src/arch
parentacpi, fix mboot memory map, fix kalloc, fix virtalloc node allocator, add kpr... (diff)
downloadcorn-341c95f5357c451e2420fb81e64ec6b42c40e124.tar.gz
corn-341c95f5357c451e2420fb81e64ec6b42c40e124.tar.bz2
corn-341c95f5357c451e2420fb81e64ec6b42c40e124.zip
update makefile
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/amd64/paging.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/arch/amd64/paging.c b/src/arch/amd64/paging.c
index 3ea79f1..18eb079 100644
--- a/src/arch/amd64/paging.c
+++ b/src/arch/amd64/paging.c
@@ -88,6 +88,8 @@ load_pml4(
void *phys
) {
static struct pte *pt = &paging_pt[0];
+ if ((uint64_t)phys >> 12 == pt->address)
+ return;
pt->address = (uint64_t)phys >> 12;
pt->flags = F_PRESENT | F_WRITEABLE;
invlpg(pml4_mapped);
@@ -98,6 +100,8 @@ load_pdpt(
void *phys
) {
static struct pte *pt = &paging_pt[1];
+ if ((uint64_t)phys >> 12 == pt->address)
+ return;
pt->address = (uint64_t)phys >> 12;
pt->flags = F_PRESENT | F_WRITEABLE;
invlpg(pdpt_mapped);
@@ -108,6 +112,8 @@ load_pd(
void *phys
) {
static struct pte *pt = &paging_pt[2];
+ if ((uint64_t)phys >> 12 == pt->address)
+ return;
pt->address = (uint64_t)phys >> 12;
pt->flags = F_PRESENT | F_WRITEABLE;
invlpg(pdpt_mapped);
@@ -118,6 +124,8 @@ load_pt(
void *phys
) {
static struct pte *pt = &paging_pt[3];
+ if ((uint64_t)phys >> 12 == pt->address)
+ return;
pt->address = (uint64_t)phys >> 12;
pt->flags = F_PRESENT | F_WRITEABLE;
invlpg(pt_mapped);