X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/45e1f8b055043e54be35462852ab6649d634da7c..refs/heads/cor/lrud:/lunaix-os/includes/lunaix/sched.h diff --git a/lunaix-os/includes/lunaix/sched.h b/lunaix-os/includes/lunaix/sched.h index 7cb3130..94afa72 100644 --- a/lunaix-os/includes/lunaix/sched.h +++ b/lunaix-os/includes/lunaix/sched.h @@ -1,25 +1,44 @@ #ifndef __LUNAIX_SCHEDULER_H #define __LUNAIX_SCHEDULER_H +#include +#include + #define SCHED_TIME_SLICE 300 +#define MAX_THREAD_PP 1024 #define PROC_TABLE_SIZE 8192 #define MAX_PROCESS (PROC_TABLE_SIZE / sizeof(ptr_t)) struct scheduler { - struct proc_info** _procs; + struct proc_info** procs; + struct llist_header* threads; + struct llist_header* proc_list; + struct llist_header sleepers; + int procs_index; int ptable_len; + int ttable_len; }; void sched_init(); -void +void noret schedule(); +void noret +run(struct thread* thread); + void -sched_yieldk(); +cleanup_detached_threads(); + +static inline struct scheduler* +scheduler() +{ + extern struct scheduler sched_ctx; + return &sched_ctx; +} #endif /* __LUNAIX_SCHEDULER_H */