diff options
| author | Ada Christine <adachristine18@gmail.com> | 2026-05-20 23:04:06 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2026-05-20 23:04:06 +0000 |
| commit | edc42358664e9d70227e274273321ab032394a7e (patch) | |
| tree | 54fd2de509c9c3cae911cad04328308f28afb0cc /kc/core/task.h | |
| parent | 0e61096ab498c12ffd0fd2eb993deb31a0a50b09 (diff) | |
new thread code works fine
Diffstat (limited to 'kc/core/task.h')
| -rw-r--r-- | kc/core/task.h | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/kc/core/task.h b/kc/core/task.h index bea4756..e5e9d92 100644 --- a/kc/core/task.h +++ b/kc/core/task.h @@ -4,6 +4,8 @@ enum kc_thread_status { + AVAILABLE, + CREATED, READY, RUNNING, SLEEPING, @@ -11,27 +13,23 @@ enum kc_thread_status 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; + uint64_t sleep_expiration; }; -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); |
