From a10aabfcd52f702057316018cd7847ab2bfe4aa1 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Tue, 26 May 2026 21:32:27 +0000 Subject: we're bringing kjarna back and not doing the crazy stuff with trying to have task management during efi. that was a bit extra. --- kc/core/task.h | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'kc/core/task.h') diff --git a/kc/core/task.h b/kc/core/task.h index bea4756..5d9f39f 100644 --- a/kc/core/task.h +++ b/kc/core/task.h @@ -4,34 +4,39 @@ enum kc_thread_status { + AVAILABLE, + CREATED, READY, RUNNING, SLEEPING, BLOCKED, + WAITING, TERMINATED }; -struct kc_thread_state +union kc_thread_result { - uint64_t stack; - uint64_t stack_top; - uint64_t page_map; + uint64_t scalar; + void *pointer; }; struct kc_thread { - struct kc_thread *next; - uint64_t time_elapsed; - uint64_t sleep_expiration; - enum kc_thread_status status; - struct kc_thread_state state; + void *kernel_stack_head; + void *kernel_stack_pointer; + uint64_t time_elapsed; + union kc_thread_result result; + enum kc_thread_status status; + struct kc_thread *next; + union + { + uint64_t sleep_expiration; + struct kc_thread *wait_target; + }; }; -extern void cpu_set_thread( - struct kc_thread_state *current, - struct kc_thread_state *next, - uint64_t *cpu_tss_rsp0); - void task_init(void); -void task_schedule(void); + +void kct_terminate(union kc_thread_result result); +union kc_thread_result kct_wait(struct kc_thread *target); -- cgit v1.3.1-1-g115d