Modifications to OSEK's CortexM4 context switching code#43
Merged
martinribelotta merged 28 commits intociaa:masterfrom Feb 12, 2018
Merged
Modifications to OSEK's CortexM4 context switching code#43martinribelotta merged 28 commits intociaa:masterfrom
martinribelotta merged 28 commits intociaa:masterfrom
Conversation
…starting actual modifications.
…ove legibility and to analyze the way it works. Also noted a couple of weaknesses in the code.
…orkings of the context switching algorithms.
…g' into features/cortexM4contextswitching
…oximation based on the frozen-conext technique used on the SPARC port.
…red the functionality and having tested the changes. One of the comments includes a possible bug within the code.
… there's already a solution on the way
…ed using make rtostests
…r indicate their function.
…. This will create a conflict with the features/cortexM0contextSwitching branch down the road.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR is a rework of the context switching code in the CortexM4 port to address the atomicity gap right before the calls to JmpTask() and CallTask() in OSEK's schedule().
This fixes the source issue in PR ciaa/firmware_v1#458 but without requiring modifications to OSEK's HAL interface behaviour and therefore the other non-CortexM4 ports are not altered.
The main advantage of the new code is that it does not use the value of the arguments to JmpTask()/CallTask(), therefore avoiding the possibility of corruption of the state of the task scheduler if anocher instance of schedule is invoked after the next task has been chosen but before JmpTask() and CallTask() are actually executed.
After applying this PR the main ciaa/Firmware rtos submodule should be updated use the current ciaa/firmware.modules.rtos HEAD.
This PR includes modifications to files in the cortexM0 code base too, but those are of stylistic nature only, and do NOT modify behaviour (improving comments in the code, style corrections, format modifications, etc.).
These are there in preparation for a future PR that will complement this one, which will apply the same kind of improvements to the cortexM0 task context switcher.
This PR has been succesfully tested using "make rtostests" on the following ports and boards:
It has also been tested running blinky on an Edu-CIAA.