fine tuning by using the irq fast lane
This commit is contained in:
parent
a748ac7257
commit
4fe2562839
3 changed files with 14 additions and 6 deletions
|
@ -275,13 +275,10 @@ void irq_handler(struct state *s)
|
|||
#endif
|
||||
|
||||
leave_handler:
|
||||
#ifdef CONFIG_ROCKCREEK
|
||||
// add fast lane for the driver task
|
||||
if (s->int_no >= 32)
|
||||
scheduler();
|
||||
#else
|
||||
// timer interrupt?
|
||||
if ((s->int_no == 32) || (s->int_no == 123))
|
||||
scheduler(); // switch to a new task
|
||||
#endif
|
||||
// exists a new (driver) task with a higher priority?
|
||||
else if ((s->int_no >= 32) && (get_highest_priority(CORE_ID) > per_core(current_task)->prio))
|
||||
scheduler();
|
||||
}
|
||||
|
|
|
@ -176,6 +176,13 @@ size_t get_idle_task(uint32_t id);
|
|||
*/
|
||||
int sys_execve(const char* fname, char** argv, char** env);
|
||||
|
||||
/** @brief determines the highest priority of all ready tasks on core core_id
|
||||
*
|
||||
* @param core_id core id
|
||||
* @return highest priority
|
||||
*/
|
||||
uint32_t get_highest_priority(uint32_t core_id);
|
||||
|
||||
/** @brief Call to rescheduling
|
||||
*
|
||||
* This is a purely assembled procedure for rescheduling
|
||||
|
|
|
@ -68,6 +68,10 @@ task_t* get_current_task(void) {
|
|||
return per_core(current_task);
|
||||
}
|
||||
|
||||
uint32_t get_highest_priority(uint32_t core_id) {
|
||||
return last_set(runqueues[core_id].prio_bitmap);
|
||||
}
|
||||
|
||||
int multitasking_init(void) {
|
||||
if (BUILTIN_EXPECT(task_table[0].status != TASK_IDLE, 0)) {
|
||||
kputs("Task 0 is not an idle task\n");
|
||||
|
|
Loading…
Add table
Reference in a new issue