diff options
Diffstat (limited to 'include/sys')
-rw-r--r-- | include/sys/schedule.h | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/include/sys/schedule.h b/include/sys/schedule.h index d0d938c..18b2f7f 100644 --- a/include/sys/schedule.h +++ b/include/sys/schedule.h @@ -1,5 +1,6 @@ #ifndef SYS_SCHEDULE_H #define SYS_SCHEDULE_H +#include <lib/queue.h> #define TQUEUE_MAX 0x800 #define STACK_SIZE 0x4000 @@ -13,12 +14,6 @@ enum ThreadStatus { THREAD_SWAIT = 2, }; -enum EntryTypes { - THREAD_ENTRY = 0, - START_ENTRY = 1, - END_ENTRY = 2, -}; - struct Thread { void* pc; void* sp; // Store r0-r12,lr on stack @@ -35,22 +30,12 @@ struct Thread { unsigned short s_reserved; }; -struct ThreadEntry { - struct Thread* thread; - struct ThreadEntry* next; - unsigned long entry_type; -}; - -struct ThreadQueue { - struct ThreadEntry start; - struct ThreadEntry end; -}; - struct Scheduler { struct Thread* rthread; - struct ThreadQueue ready[PRIORITIES]; - struct ThreadQueue mwait[PRIORITIES]; - struct ThreadQueue swait[PRIORITIES]; + struct Queue ready[PRIORITIES]; + struct Queue mwait[PRIORITIES]; + struct Queue swait[PRIORITIES]; + struct Queue free_threads; }; void init_scheduler(void); |