sched: thread: implement cloning of userspace thread contexts

This commit is contained in:
2026-04-01 18:29:54 +01:00
parent 61050fd54b
commit 6c5bf2344f
4 changed files with 66 additions and 0 deletions
+15
View File
@@ -80,6 +80,21 @@ extern kern_status_t ml_thread_prepare_user_context(
return KERN_OK;
}
kern_status_t ml_thread_clone_user_context(
const struct ml_cpu_context *src_ctx,
uintptr_t return_value,
virt_addr_t *kernel_sp)
{
(*kernel_sp) -= sizeof(struct ml_cpu_context);
struct ml_cpu_context *ctx = (struct ml_cpu_context *)(*kernel_sp);
memcpy(ctx, src_ctx, sizeof *ctx);
ctx->rax = return_value;
return KERN_OK;
}
kern_status_t ml_thread_config_get(
struct thread *thread,
kern_config_key_t key,