mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-07 20:31:04 +03:00
Kernel/riscv64: Implement fork
This commit is contained in:
parent
faede8c93a
commit
65724efac3
Notes:
sideshowbarker
2024-07-17 05:58:46 +09:00
Author: https://github.com/spholz Commit: https://github.com/SerenityOS/serenity/commit/65724efac3 Pull-request: https://github.com/SerenityOS/serenity/pull/23514 Reviewed-by: https://github.com/ADKaster ✅
@ -150,9 +150,13 @@ ErrorOr<FlatPtr> Process::sys$fork(RegisterState& regs)
|
|||||||
child_regs.elr_el1 = regs.elr_el1;
|
child_regs.elr_el1 = regs.elr_el1;
|
||||||
child_regs.sp_el0 = regs.sp_el0;
|
child_regs.sp_el0 = regs.sp_el0;
|
||||||
#elif ARCH(RISCV64)
|
#elif ARCH(RISCV64)
|
||||||
(void)child_regs;
|
for (size_t i = 0; i < array_size(child_regs.x); ++i)
|
||||||
(void)regs;
|
child_regs.x[i] = regs.x[i];
|
||||||
TODO_RISCV64();
|
child_regs.x[9] = 0; // fork() returns 0 in the child :^)
|
||||||
|
child_regs.sstatus = regs.sstatus;
|
||||||
|
child_regs.pc = regs.sepc;
|
||||||
|
dbgln_if(FORK_DEBUG, "fork: child will begin executing at {:p} with stack {:p}, kstack {:p}",
|
||||||
|
child_regs.pc, child_regs.sp(), child_regs.kernel_sp);
|
||||||
#else
|
#else
|
||||||
# error Unknown architecture
|
# error Unknown architecture
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user