Skip to content

Conversation

@N3xed
Copy link

@N3xed N3xed commented Jul 28, 2021

Allows for much easier assembly access to the uxCoreAffinityMask field. This allows for the port implementation to pin the task to one or more cores much easier and without relying on hardcoded field offset constants.

One such occasion would be in the ESP32 port. The ESP32 port needs to pin the task to a single core when the FPU is used in a multi-core environment. This is because each core has its own FPU where its contents are lazily saved and restored only upon usage. When a task is switched to another core in the middle of a floating-point calculation, the state remains in the other core. To work around this without pinning the core, one would need to either save the FPU state for every task context switch or use some cross-core interrupt magic.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Allows for much easier assembly access to the field.
@N3xed N3xed requested a review from a team as a code owner July 28, 2021 09:18
@aggarg aggarg merged commit a2c8db1 into FreeRTOS:smp Jul 30, 2021
@mbruno-xmos
Copy link

mbruno-xmos commented Aug 6, 2021

This should have come with a corresponding adjustment to the xSTATIC_TCB struct in FreeRTOS.h

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.

3 participants