Skip to content

Comments

Modifications to OSEK's CortexM4 context switching code#43

Merged
martinribelotta merged 28 commits intociaa:masterfrom
glpuga:features/cortexM4contextswitching
Feb 12, 2018
Merged

Modifications to OSEK's CortexM4 context switching code#43
martinribelotta merged 28 commits intociaa:masterfrom
glpuga:features/cortexM4contextswitching

Conversation

@glpuga
Copy link
Contributor

@glpuga glpuga commented Jan 27, 2018

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:

  • CortexM4 (edu-ciaa-nxp)
  • CortexM4 (pico-ciaa)
  • x86 (ciaa_sim_ia64)
  • LEON3 (leon3_fpga_nfp)

It has also been tested running blinky on an Edu-CIAA.

…ove legibility and to analyze the way it works. Also noted a couple of weaknesses in the code.
…orkings of the context switching algorithms.
…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.
…. This will create a conflict with the features/cortexM0contextSwitching branch down the road.
@martinribelotta martinribelotta merged commit c7a000d into ciaa:master Feb 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants