diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2021-12-21 12:23:00 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2021-12-21 12:36:00 +0200 |
| commit | 41c405fdb18b139bbde475063230e14a59304ef6 (patch) | |
| tree | 7ec7b02cb29df577be6f15f826c0781973483093 /arch/riscv/kernel | |
| parent | 61291639524e4aebf93a3315661e7180ac1b9c1e (diff) | |
| download | kmi-41c405fdb18b139bbde475063230e14a59304ef6.tar.gz kmi-41c405fdb18b139bbde475063230e14a59304ef6.zip | |
Modified vmem internals to use pages
Diffstat (limited to 'arch/riscv/kernel')
| -rw-r--r-- | arch/riscv/kernel/main.c | 6 |
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); |
