vmmcache: initial implementation

This commit is contained in:
Matheus
2024-05-24 18:03:24 -03:00
parent 7673a365e8
commit 48b7fb4324
21 changed files with 772 additions and 134 deletions
+7
View File
@@ -175,6 +175,13 @@ bool arch_mmu_iswritable(pagetableptr_t table, void *vaddr) {
return entry == NULL ? false : *entry & ARCH_MMU_FLAGS_WRITE;
}
#define ARCH_MMU_FLAGS_DIRTY (1 << 6)
bool arch_mmu_isdirty(pagetableptr_t table, void *vaddr) {
uint64_t *entry = get_page(table, vaddr);
return entry == NULL ? false : *entry & ARCH_MMU_FLAGS_DIRTY;
}
void arch_mmu_switch(pagetableptr_t table) {
asm volatile("mov %%rax, %%cr3" : : "a"(table));
}