vm: implement private and shared address space mappings

whether a mapping is private or shared determines how the mapping is handled
when a task is duplicated.
This commit is contained in:
2026-04-21 21:12:00 +01:00
parent 8b7382fa13
commit 278fe39c0d
9 changed files with 63 additions and 24 deletions
+4
View File
@@ -120,6 +120,7 @@ static kern_status_t map_executable_exec(
bsp->bsp_vmo,
text_foffset,
bsp->bsp_trailer.bsp_text_size,
VM_SHARED,
VM_PROT_READ | VM_PROT_EXEC | VM_PROT_USER,
&text_base);
if (status != KERN_OK) {
@@ -132,6 +133,7 @@ static kern_status_t map_executable_exec(
data,
data_foffset,
bsp->bsp_trailer.bsp_data_size,
VM_PRIVATE,
VM_PROT_READ | VM_PROT_WRITE | VM_PROT_USER,
&data_base);
if (status != KERN_OK) {
@@ -165,6 +167,7 @@ kern_status_t bsp_launch_async(struct bsp *bsp, struct task *task)
user_stack,
0,
BOOTSTRAP_STACK_SIZE,
VM_PRIVATE,
VM_PROT_READ | VM_PROT_WRITE | VM_PROT_USER,
&stack_buffer);
@@ -178,6 +181,7 @@ kern_status_t bsp_launch_async(struct bsp *bsp, struct task *task)
bsp->bsp_vmo,
0,
bsp->bsp_trailer.bsp_exec_offset,
VM_PRIVATE,
VM_PROT_READ | VM_PROT_USER,
&bsp_data_base);