sched: implement user-configurable fs and gs segment base addresses

This commit is contained in:
2026-03-18 21:07:05 +00:00
parent 63703a3d34
commit 24f9ef85bf
14 changed files with 274 additions and 9 deletions

View File

@@ -3,6 +3,10 @@
#include <kernel/sched.h>
struct ml_thread {
virt_addr_t tr_gsbase, tr_fsbase;
};
struct ml_cpu_context;
/* switch from one thread to another. the stack of the `to` thread must have
@@ -28,4 +32,15 @@ extern kern_status_t ml_thread_prepare_user_context(
const uintptr_t *args,
size_t nr_args);
extern kern_status_t ml_thread_config_get(
struct thread *thread,
kern_config_key_t key,
void *out,
size_t max);
extern kern_status_t ml_thread_config_set(
struct thread *thread,
kern_config_key_t key,
const void *ptr,
size_t len);
#endif