/* * thread.h * * Created on: Apr 13, 2015 * Author: tkl */ #ifndef THREAD_H_ #define THREAD_H_ #define MAX_THREAD_COUNT 32 enum thread_priority { THREAD_PRIO_IDLE = 0, THREAD_PRIO_LOW, THREAD_PRIO_MEDIUM, THREAD_PRIO_HIGH }; enum thread_status { THREAD_STATUS_INIT = 0, THREAD_STATUS_EXECUTING, THREAD_STATUS_WAITING, THREAD_STATUS_SLEEPING, THREAD_STATUS_BLOCKING }; struct thread_context { stack_t *sp; /**< thread's stack pointer */ stack_t *stack; /**< thread's stack start address */ unsigned int stack_size; /**< thread's stack size */ unsigned int pid; /**< thread's process id */ enum thread_priority priority; /**< thread's priority */ enum thread_status status; /**< thread's status */ unsigned long next_executing_time; void *wakeup_blocking_source; struct queue_node sem_queue_node; }; struct thread_list { unsigned int count; //