mm: rename vmm api to mm

This commit is contained in:
Matheus
2026-07-01 14:57:05 -03:00
parent c650036cfe
commit 239c267ed3
47 changed files with 402 additions and 413 deletions
+5 -5
View File
@@ -144,7 +144,7 @@ static int mmap(int minor, void *addr, uintmax_t offset, int flags) {
if (flags & V_FFLAGS_SHARED) {
// make sure offset is ALWAYS page aligned when doing a shared mapping
__assert((offset % PAGE_SIZE) == 0);
return arch_mmu_map(current_vmm_context()->pagetable, FROM_HHDM((void *)((uintptr_t)fbs[minor]->address + offset)), addr, vnodeflagstommuflags(flags)) ? 0 : ENOMEM;
return arch_mmu_map(current_mm_context()->pagetable, FROM_HHDM((void *)((uintptr_t)fbs[minor]->address + offset)), addr, mm_vnode_flags_to_mmu_flags(flags)) ? 0 : ENOMEM;
} else {
size_t size = offset + PAGE_SIZE < end ? PAGE_SIZE : end - offset;
paddr = mm_alloc_page(MEMORY_SECTION_DEFAULT);
@@ -153,7 +153,7 @@ static int mmap(int minor, void *addr, uintmax_t offset, int flags) {
memcpy(MAKE_HHDM(paddr), (void *)((uintptr_t)fbs[minor]->address + offset), size);
if (arch_mmu_map(current_vmm_context()->pagetable, paddr, addr, vnodeflagstommuflags(flags) | ARCH_MMU_FLAGS_WC) == false) {
if (arch_mmu_map(current_mm_context()->pagetable, paddr, addr, mm_vnode_flags_to_mmu_flags(flags) | ARCH_MMU_FLAGS_WC) == false) {
mm_release_page(paddr);
return ENOMEM;
}
@@ -163,9 +163,9 @@ static int mmap(int minor, void *addr, uintmax_t offset, int flags) {
}
static int munmap(int minor, void *addr, uintmax_t offset, int flags) {
void *phys = arch_mmu_getphysical(current_vmm_context()->pagetable, addr);
bool release = (flags & V_FFLAGS_SHARED) && arch_mmu_iswritable(current_vmm_context()->pagetable, addr);
arch_mmu_unmap(current_vmm_context()->pagetable, addr);
void *phys = arch_mmu_getphysical(current_mm_context()->pagetable, addr);
bool release = (flags & V_FFLAGS_SHARED) && arch_mmu_iswritable(current_mm_context()->pagetable, addr);
arch_mmu_unmap(current_mm_context()->pagetable, addr);
arch_mmu_invalidate_range(addr, PAGE_SIZE);
if (release)
mm_release_page(phys);