diff options
Diffstat (limited to 'na/arch')
| -rw-r--r-- | na/arch/riscv/trap/swtch.S | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/na/arch/riscv/trap/swtch.S b/na/arch/riscv/trap/swtch.S index 8be7904..dbae43d 100644 --- a/na/arch/riscv/trap/swtch.S +++ b/na/arch/riscv/trap/swtch.S @@ -76,4 +76,21 @@ kthread_entry_trampoline: /* kthread_entry should never return, but if it does: */ wfi - j kthread_entry_trampoline + 12 /* loop on wfi */
\ No newline at end of file + j kthread_entry_trampoline + 12 /* loop on wfi */ + +/* ======================================================================== + * ret_from_fork + * + * Trampoline for newly forked processes. + * Context is set up by fork() so that s0 contains the TrapFrame pointer. + * + * Calls the MI-layer C++ function: + * void fork_child_entry(TrapFrame* tf); + * ======================================================================== */ + .globl ret_from_fork + .align 2 +ret_from_fork: + mv a0, s0 /* a0 = TrapFrame pointer */ + call fork_child_entry /* does not return, eventually calls userret */ + wfi + j ret_from_fork + 8
\ No newline at end of file |
