aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv/kernel')
-rw-r--r--arch/riscv/kernel/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/riscv/kernel/main.c b/arch/riscv/kernel/main.c
index 794b71b..914dcba 100644
--- a/arch/riscv/kernel/main.c
+++ b/arch/riscv/kernel/main.c
@@ -251,12 +251,14 @@ static void init_proc(void *fdt, struct vm_branch_t *b)
sp_mem_init(&t->sp_r, SZ_4K, SZ_256G);
/* binary itself */
- size_t sz = align_up(get_init_size(fdt), BASE_PAGE_SIZE);
+ size_t sz = get_init_size(fdt);
+ /* these need to be fixed and actually map the addresses that the ELF
+ * binary wants, instead of willy nilly */
t->bin = alloc_uvmem(t, sz, VM_V | VM_X | VM_R | VM_W | VM_U);
/* stack */
t->stack = alloc_uvmem(t, SZ_2M, VM_V | VM_R | VM_W | VM_U);
- /* if it needs heap, it'll ask for it */
+ /* should probably wrap this in like tlb_flush_all() or something */
__asm__ ("sfence.vma" : : : "memory");
move_init(fdt, (void *)t->bin);