mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-29 05:38:21 +00:00
vmmcache: initial implementation
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include <kernel/mouse.h>
|
||||
#include <kernel/tty.h>
|
||||
#include <kernel/pty.h>
|
||||
#include <kernel/vmmcache.h>
|
||||
|
||||
static cpu_t bsp_cpu;
|
||||
|
||||
@@ -64,6 +65,9 @@ void kernel_entry() {
|
||||
arch_apic_timerinit();
|
||||
sched_init();
|
||||
arch_smp_wakeup();
|
||||
|
||||
vmmcache_init();
|
||||
|
||||
vfs_init();
|
||||
tmpfs_init();
|
||||
devfs_init();
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user