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

@@ -2,15 +2,17 @@
#include <kernel/cpu.h>
#include <kernel/machine/thread.h>
#include <kernel/object.h>
#include <kernel/printk.h>
#include <kernel/task.h>
#include <kernel/thread.h>
#include <mango/signal.h>
#define THREAD_CAST(p) OBJECT_C_CAST(struct thread, thr_base, &thread_type, p)
#define THREAD_CAST(p) OBJECT_C_CAST(struct thread, tr_base, &thread_type, p)
static struct object_type thread_type = {
.ob_name = "thread",
.ob_size = sizeof(struct thread),
.ob_header_offset = offsetof(struct thread, thr_base),
.ob_header_offset = offsetof(struct thread, tr_base),
};
kern_status_t thread_object_type_init(void)
@@ -185,3 +187,31 @@ struct thread *create_idle_thread(void)
return thr;
}
kern_status_t thread_config_get(
struct thread *thread,
kern_config_key_t key,
void *out,
size_t max)
{
switch (key) {
default:
break;
}
return ml_thread_config_get(thread, key, out, max);
}
kern_status_t thread_config_set(
struct thread *thread,
kern_config_key_t key,
const void *ptr,
size_t len)
{
switch (key) {
default:
break;
}
return ml_thread_config_set(thread, key, ptr, len);
}