X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/0067bc210e621ccda286092d081a7890d65e1c18..7b8d4c08afde96dbfc24c7f91227b0fcafdf7ef7:/lunaix-os/includes/lunaix/sched.h diff --git a/lunaix-os/includes/lunaix/sched.h b/lunaix-os/includes/lunaix/sched.h index 618c324..c011adb 100644 --- a/lunaix-os/includes/lunaix/sched.h +++ b/lunaix-os/includes/lunaix/sched.h @@ -1,15 +1,40 @@ #ifndef __LUNAIX_SCHEDULER_H #define __LUNAIX_SCHEDULER_H -#define SCHED_TIME_SLICE 200 +#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 llist_header* threads; + struct llist_header* proc_list; + struct llist_header sleepers; -struct scheduler { - struct proc_info* _procs; int procs_index; - unsigned int ptable_len; + int ptable_len; + int ttable_len; }; -void sched_init(); -void schedule(); +void +sched_init(); + +void noret +schedule(); + +void +sched_pass(); + +void noret +run(struct thread* thread); + +void +cleanup_detached_threads(); #endif /* __LUNAIX_SCHEDULER_H */