mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[kernel] Stop creating user stacks in the kernel
Stop creating stacks in user space for user threads, that should be done by the thread's creator. This change adds process and stack_top arguments to the thread_create syscall, so that threads can be created in other processes, and given a stack address. Also included is a fix in add_thunk_user due to the r11/flags change. THIS COMMIT BREAKS USERSPACE. See subsequent commits for the user side changes related to this change.
This commit is contained in:
@@ -70,7 +70,7 @@ inline T * push(uintptr_t &rsp, size_t size = sizeof(T)) {
|
||||
void
|
||||
scheduler::create_kernel_task(void (*task)(), uint8_t priority, bool constant)
|
||||
{
|
||||
thread *th = process::kernel_process().create_thread(priority, false);
|
||||
thread *th = process::kernel_process().create_thread(0, priority);
|
||||
auto *tcb = th->tcb();
|
||||
|
||||
th->add_thunk_kernel(reinterpret_cast<uintptr_t>(task));
|
||||
|
||||
Reference in New Issue
Block a user