summaryrefslogtreecommitdiff
path: root/kc/core/task.h
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2026-05-26 21:32:27 +0000
committerAda Christine <adachristine18@gmail.com>2026-05-26 21:32:27 +0000
commita10aabfcd52f702057316018cd7847ab2bfe4aa1 (patch)
treecc4652d2b602798934e8a48b4939cfb20eda1989 /kc/core/task.h
parent90c29fdde317c39384011a6ba97077c138f13ad6 (diff)
we're bringing kjarna back and not doing the crazy stuff with trying to have task management during efi. that was a bit extra.kjarna
Diffstat (limited to 'kc/core/task.h')
-rw-r--r--kc/core/task.h35
1 files changed, 20 insertions, 15 deletions
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);