From 341c95f5357c451e2420fb81e64ec6b42c40e124 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Thu, 1 Feb 2024 14:43:11 -0500 Subject: update makefile --- src/arch/amd64/paging.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/arch/amd64/paging.c') 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); -- cgit v1.2.3-freya