diff --git a/sys/riscv/riscv/vm_machdep.c b/sys/riscv/riscv/vm_machdep.c --- a/sys/riscv/riscv/vm_machdep.c +++ b/sys/riscv/riscv/vm_machdep.c @@ -179,6 +179,8 @@ tf->tf_sp = STACKALIGN((uintptr_t)stack->ss_sp + stack->ss_size); tf->tf_sepc = (register_t)entry; tf->tf_a[0] = (register_t)arg; + tf->tf_ra = 0; /* Tell unwinders there is no return address. */ + tf->tf_s[0] = 0; /* Tell unwinders there is no stack frame above. */ return (0); }