only by a context switch, the FPU registers are saved in the task context
This commit is contained in:
parent
4f237a9069
commit
c90a533521
1 changed files with 6 additions and 6 deletions
|
@ -1268,12 +1268,6 @@ void scheduler(void)
|
|||
if (curr_task->status == TASK_FINISHED)
|
||||
curr_task->status = TASK_INVALID;
|
||||
|
||||
/* if the task is using the FPU, we need to save the FPU context */
|
||||
if (curr_task->flags & TASK_FPU_USED) {
|
||||
save_fpu_state(&(curr_task->fpu));
|
||||
curr_task->flags &= ~TASK_FPU_USED;
|
||||
}
|
||||
|
||||
spinlock_irqsave_lock(&runqueues[core_id].lock);
|
||||
|
||||
// check timers
|
||||
|
@ -1358,6 +1352,12 @@ get_task_out:
|
|||
spinlock_irqsave_unlock(&runqueues[core_id].lock);
|
||||
|
||||
if (curr_task != orig_task) {
|
||||
/* if the original task is using the FPU, we need to save the FPU context */
|
||||
if ((orig_task->flags & TASK_FPU_USED) && (orig_task->status == TASK_READY)) {
|
||||
save_fpu_state(&(orig_task->fpu));
|
||||
orig_task->flags &= ~TASK_FPU_USED;
|
||||
}
|
||||
|
||||
//kprintf("schedule from %u to %u with prio %u on core %u\n",
|
||||
// orig_task->id, curr_task->id, (uint32_t)curr_task->prio, CORE_ID);
|
||||
switch_task(curr_task->id);
|
||||
|
|
Loading…
Add table
Reference in a new issue