diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-10-21 16:06:00 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2022-10-21 16:06:00 +0300 |
| commit | a06dbb8a63d825ebb1ad65372ce1ce1f572891bc (patch) | |
| tree | 342f74db0777a76eed64830ded71db16399e983d /arch/riscv64/kernel/entry.S | |
| parent | 00d3ae26dfd7c91c0817e71d71636982680d0b28 (diff) | |
| download | kmi-a06dbb8a63d825ebb1ad65372ce1ce1f572891bc.tar.gz kmi-a06dbb8a63d825ebb1ad65372ce1ce1f572891bc.zip | |
initial spawn implementation
Diffstat (limited to 'arch/riscv64/kernel/entry.S')
| -rw-r--r-- | arch/riscv64/kernel/entry.S | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/riscv64/kernel/entry.S b/arch/riscv64/kernel/entry.S index 8ff642a..db662bb 100644 --- a/arch/riscv64/kernel/entry.S +++ b/arch/riscv64/kernel/entry.S @@ -87,7 +87,8 @@ handle_syscall: * twice */ csrr s0, CSR_SEPC addi s0, s0, 4 - csrw CSR_SEPC, s0 + /* store execution continuation point */ + sr s0, 0(tp) /* allocate space for sys_ret structure on stack and shift argument * registers down one to make room for the pointer to this structure */ addi sp, sp, -sizeof_sys_ret @@ -112,6 +113,9 @@ handle_syscall: /* get associated kernel stack */ mv sp, tp addi sp, sp, -sizeof_registers + /* set execution continuation */ + lr s0, 0(tp) + csrw CSR_SEPC, s0 /* restore system call result */ j restore_noreturn |
