Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Optimize tricore arch task switching process, now most other archs have already implemented task switching optimizations, such as:
Directly using tcb->xcp.regs instead of up_current_regs to determine whether to switch tasks.
Removing interfaces like up_set_current_regs/up_current_regs.
Inlining up_switch_context, etc.
For ARM implementation references:
03af486
4972a8e
Impact
The logic during doirq.c and svcall.c for determining whether a task needs to be switched has changed;
The interrupt flag interface has changed.
Testing
Run ostest multiple times and observe whether the task switch is normal.
The main test items in ostest:
task create/exit/restart.
semaphore wait/post test
message queue test
signal process test
wdog test
...