diff options
| author | Ada Christine <adachristine18@gmail.com> | 2022-02-18 21:19:27 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2022-02-18 21:19:27 +0000 |
| commit | d07a644f542a7344941d1e4fed28c09531ba12c2 (patch) | |
| tree | 2faf0ddb229759bb8da8955ac7a3fa062c62324b /kc/core/task.h | |
| parent | 21bcfa6b707403a43ea8ac4a285114951cf29059 (diff) | |
thread switching and sleeping appears to be working
Diffstat (limited to 'kc/core/task.h')
| -rw-r--r-- | kc/core/task.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kc/core/task.h b/kc/core/task.h index 346630a..bea4756 100644 --- a/kc/core/task.h +++ b/kc/core/task.h @@ -5,8 +5,8 @@ enum kc_thread_status { READY, - STARTED, - YIELDED, + RUNNING, + SLEEPING, BLOCKED, TERMINATED }; @@ -20,9 +20,9 @@ struct kc_thread_state struct kc_thread { - struct kc_thread *prev; struct kc_thread *next; uint64_t time_elapsed; + uint64_t sleep_expiration; enum kc_thread_status status; struct kc_thread_state state; }; @@ -33,4 +33,5 @@ extern void cpu_set_thread( uint64_t *cpu_tss_rsp0); void task_init(void); +void task_schedule(void); |
