sched: thread: implement cloning of userspace thread contexts
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user