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

@@ -1,6 +1,7 @@
#ifndef KERNEL_THREAD_H_
#define KERNEL_THREAD_H_
#include <kernel/machine/thread.h>
#include <kernel/msg.h>
#include <kernel/object.h>
#include <kernel/vm-controller.h>
@@ -22,7 +23,7 @@ enum thread_flags {
};
struct thread {
struct object thr_base;
struct object tr_base;
enum thread_state tr_state;
enum thread_flags tr_flags;
@@ -38,6 +39,7 @@ struct thread {
virt_addr_t tr_ip, tr_sp, tr_bp;
virt_addr_t tr_cpu_user_sp, tr_cpu_kernel_sp;
struct ml_thread tr_ml;
struct runqueue *tr_rq;
struct queue_entry tr_parent_entry;
@@ -61,4 +63,17 @@ extern void idle(void);
extern struct thread *create_kernel_thread(void (*fn)(void));
extern struct thread *create_idle_thread(void);
extern kern_status_t thread_config_get(
struct thread *thread,
kern_config_key_t key,
void *out,
size_t max);
extern kern_status_t thread_config_set(
struct thread *thread,
kern_config_key_t key,
const void *ptr,
size_t len);
DEFINE_OBJECT_LOCK_FUNCTION(thread, tr_base)
#endif