vm: replace vm-region with address-space

address-space is a non-recursive data structure, which contains a flat list of vm_areas representing
mapped vm-objects.

userspace programs can no longer create sub-address-spaces. instead, they can reserve portions of
the address space, and use that reserved space to create mappings.
This commit is contained in:
2026-03-13 19:44:50 +00:00
parent c6b0bee827
commit c628390f4a
28 changed files with 1719 additions and 2612 deletions

View File

@@ -1,3 +1,4 @@
#include <kernel/address-space.h>
#include <kernel/compiler.h>
#include <kernel/libc/stdio.h>
#include <kernel/memblock.h>
@@ -7,7 +8,6 @@
#include <kernel/task.h>
#include <kernel/types.h>
#include <kernel/vm-object.h>
#include <kernel/vm-region.h>
#include <kernel/vm.h>
#include <mango/status.h>
@@ -363,12 +363,20 @@ kern_status_t pmap_handle_fault(
}
struct task *task = current_task();
struct vm_region *space = task->t_address_space;
if (!task) {
return KERN_FATAL_ERROR;
}
struct address_space *space = task->t_address_space;
if (!space) {
return KERN_FATAL_ERROR;
}
unsigned long lock_flags;
vm_region_lock_irqsave(space, &lock_flags);
kern_status_t status = vm_region_demand_map(space, fault_addr, flags);
vm_region_unlock_irqrestore(space, lock_flags);
address_space_lock_irqsave(space, &lock_flags);
kern_status_t status
= address_space_demand_map(space, fault_addr, flags);
address_space_unlock_irqrestore(space, lock_flags);
return status;
}