diff --git a/core/include/queue.h b/core/include/queue.h index d7a122e50..ae377409d 100644 --- a/core/include/queue.h +++ b/core/include/queue.h @@ -23,6 +23,7 @@ void queue_add_head(queue_node_t* root, queue_node_t* new_obj); queue_node_t *queue_remove_head(queue_node_t* root); void queue_priority_add(queue_node_t* root, queue_node_t* new_obj); void queue_priority_add_generic(queue_node_t* root, queue_node_t* new_obj, int(*cmp)(queue_node_t*,queue_node_t*)) ; +void queue_remove(queue_node_t* root, queue_node_t *node); /** @} */ #endif // __QUEUE_H diff --git a/core/include/sched.h b/core/include/sched.h index bce386431..9f9712249 100644 --- a/core/include/sched.h +++ b/core/include/sched.h @@ -27,13 +27,13 @@ void sched_run(); void sched_set_status(tcb_t *process, unsigned int status); void sched_switch(uint16_t current_prio, uint16_t other_prio, int in_isr); -volatile unsigned int sched_context_switch_request; +extern volatile unsigned int sched_context_switch_request; -volatile tcb_t *sched_threads[MAXTHREADS]; -volatile tcb_t *active_thread; +extern volatile tcb_t *sched_threads[MAXTHREADS]; +extern volatile tcb_t *active_thread; extern volatile int num_tasks; -volatile int thread_pid; +extern volatile int thread_pid; //#define SCHEDSTATISTICS #if SCHEDSTATISTICS diff --git a/core/sched.c b/core/sched.c index 9b33d386d..51fdaef62 100644 --- a/core/sched.c +++ b/core/sched.c @@ -25,6 +25,13 @@ volatile int num_tasks = 0; +volatile unsigned int sched_context_switch_request; + +volatile tcb_t *sched_threads[MAXTHREADS]; +volatile tcb_t *active_thread; + +volatile int thread_pid; + clist_node_t *runqueues[SCHED_PRIO_LEVELS]; static uint32_t runqueue_bitcache = 0;