aboutsummaryrefslogtreecommitdiff
path: root/src/elf.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-07-06 18:14:04 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-07-06 18:14:04 +0300
commit76517486919657ecadda9867125dc6730f29a5b7 (patch)
tree02d975db2b911ec7b92c4b1be7c5a2510b418ae1 /src/elf.c
parent608f44306a6f0d5692f5c81bcbfe7a621ec254ba (diff)
downloadkmi-76517486919657ecadda9867125dc6730f29a5b7.tar.gz
kmi-76517486919657ecadda9867125dc6730f29a5b7.zip
pretty massive virtual memory rewrite
+ The system is now a bit simpler and hopefully easier to understand, while also extending the shared memory to be 1:N, where there is one owner who may become a zombie while waiting for the N to die.
Diffstat (limited to 'src/elf.c')
-rw-r--r--src/elf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/elf.c b/src/elf.c
index da47502..a38f3c2 100644
--- a/src/elf.c
+++ b/src/elf.c
@@ -65,15 +65,15 @@ static void __map_exec(struct tcb *t, vm_t bin, uint8_t ei_c, vm_t phstart,
vm_t va = program_header_prop(ei_c, runner, p_vaddr);
size_t vsz = program_header_prop(ei_c, runner, p_memsz);
- vm_t start = alloc_fixed_region(&t->sp_r, va, vsz, &vsz,
- default_flags);
+ vm_t start = alloc_fixed_uvmem(t, va, vsz, default_flags);
if (!start)
return; /* out of memory or something */
uint8_t elf_flags = program_header_prop(ei_c, runner, p_flags);
uint8_t uvflags = __elf_to_uvflags(elf_flags);
- map_allocd_region(t->proc.vmem, start, vsz, default_flags, 0);
+ map_region(t->proc.vmem, start, vsz, max_order(),
+ default_flags);
memset((void *)start, 0, vsz);
vm_t vo = bin + program_header_prop(ei_c, runner, p_offset);