diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-10-30 14:23:07 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-11-01 10:27:45 +0200 |
| commit | dc71f4f38f49ed3a3b67098b7926a0731e9ce225 (patch) | |
| tree | 92c3bdd34504d86c19a7dbd8f1059018799add68 /src | |
| parent | f139fff6ae7063c1965fa3085bb2585d7d838d72 (diff) | |
| download | kmi-dc71f4f38f49ed3a3b67098b7926a0731e9ce225.tar.gz kmi-dc71f4f38f49ed3a3b67098b7926a0731e9ce225.zip | |
remember to set regs to some valid address
+ Worked in qemu, failed in visionfive2, fixed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/proc.c | 3 | ||||
| -rw-r--r-- | src/tcb.c | 1 |
2 files changed, 2 insertions, 2 deletions
@@ -56,6 +56,8 @@ stat_t init_proc(void *fdt, vm_t *proc_fdt, vm_t *proc_initrd) * save them here before we switch */ use_tcb(t); + set_stack(t, t->rpc_stack - BASE_PAGE_SIZE); + /* allocate stacks etc after ELF file to make sure nothing of importance * clashes */ stat_t ret = prepare_proc(t, get_init_base(fdt), 0); @@ -72,7 +74,6 @@ stat_t init_proc(void *fdt, vm_t *proc_fdt, vm_t *proc_initrd) *proc_initrd = map_shared_fixed_uvmem(t, initrd, get_initrdsize(fdt), VM_V | VM_R | VM_U); - info("mapped fdt at %lx\n", *proc_fdt); info("mapped initrd at %lx\n", *proc_initrd); return OK; @@ -119,7 +119,6 @@ static stat_t __init_free_thread(struct tcb *t) return ERR_OOMEM; } - t->regs = t->rpc_stack - sizeof(struct call_ctx); t->pid = t->tid; t->eid = t->tid; t->rid = t->tid; |
