Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The task switch function in task context rt_hw_context_switch might not be switched due to higher level interrupt happened before software interrupt to switch context, in the higher level interrupt if it triggered switch interrupt in interrupt context, the task context will be messed up. want to switch TA -> TB : interrupt entered | In TA context now Interrupt triggered, want to switch to TC | Still in TA context, but it assumed in TB context software interrupt switch task, task switch TB -> TC, but actually it is still in TA context so TA's context is actually saved to TB's stack, which is not right. So we changed task switch here to use interrupt switch flow: want to switch TA -> TB, interrupt entered | in TA context now Interrupt triggered, want to switch to TC | still in TA context, but now it will do TA -> TC software interrupt switch tasl, now do TA -> TC, which is correct now In this case, it want to do two task switch, A->B, B->C, but accuatually only 1 task switch is done, A->C due to higher interrupt handler entered before software interrupt, and in higher interrupt handler, it also triggered task switch Signed-off-by: Huaqi Fang <[email protected]>
- Loading branch information