From 04ca9f393f35aa0572b2affd62d58ea83bc43010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Holz?= Date: Thu, 7 Mar 2024 23:38:01 +0100 Subject: [PATCH] Kernel/riscv64: Implement create_thread --- Kernel/Syscalls/thread.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Kernel/Syscalls/thread.cpp b/Kernel/Syscalls/thread.cpp index cedb1042884..31dd0560ad5 100644 --- a/Kernel/Syscalls/thread.cpp +++ b/Kernel/Syscalls/thread.cpp @@ -77,7 +77,13 @@ ErrorOr Process::sys$create_thread(void* (*entry)(void*), Userspacepage_directory().satp(); }); + + // Set up the argument registers expected by pthread_create_helper. + regs.x[9] = (FlatPtr)params.entry; + regs.x[10] = (FlatPtr)params.entry_argument; + regs.x[11] = (FlatPtr)params.stack_location; + regs.x[12] = (FlatPtr)params.stack_size; #else # error Unknown architecture #endif