This commit is contained in:
2026-09-16 04:37:37 +02:00
parent e71245c082
commit 3e9bdf72c9
74 changed files with 555 additions and 567 deletions
+6 -6
View File
@@ -1,6 +1,6 @@
#include <zinnia/alloc.h>
#include <zinnia/errno.h>
#include <zinnia/mem/alloc.h>
#include <zinnia/mem/pmap.h>
#include <zinnia/pmap.h>
#include <zinnia/spin.h>
#include <zinnia/vas.h>
#include <string.h>
@@ -15,7 +15,7 @@ errno_t pmap_kernel(struct pmap* pt, enum alloc_flags flags) {
struct pmap result = {
.root = addr,
.lock = (struct spinlock){0},
.lock = (spinlock_t){0},
.is_user = false,
};
@@ -35,7 +35,7 @@ errno_t pmap_new_user(struct pmap* pt, enum alloc_flags flags) {
struct pmap result = {
.root = user_l1,
.lock = (struct spinlock){0},
.lock = (spinlock_t){0},
.is_user = true,
};
@@ -67,7 +67,7 @@ static pte_t* get_pte(struct pmap* pt, uintptr_t vaddr, bool is_user, bool check
if (pte_is_present(pte)) {
// Get the next level.
*pte = pte_build(pte_address(pte), level_flags, CACHE_NONE);
*pte = pte_build(pte_address(pte), level_flags, CACHE_ANY);
current_head = HHDM_PTR(pte_address(pte));
} else {
// If the current level isn't present, we can skip the rest.
@@ -78,7 +78,7 @@ static pte_t* get_pte(struct pmap* pt, uintptr_t vaddr, bool is_user, bool check
if (mem_phys_alloc(1, 0, &addr) != 0)
return nullptr;
*pte = pte_build(addr, level_flags, CACHE_NONE);
*pte = pte_build(addr, level_flags, CACHE_ANY);
current_head = HHDM_PTR(addr);
}
}