Wrap raw task routine with an platform specific wrapper #700
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.
Change Description
Instead of calling a user provided task routine directly, call the routine from a platform specific task wrapper function.
Rationale
Different platforms have different function definitions for task routines.
void * task(void *)
int task(int arg1, ..., int arg10)
F' provides a generic task definition:
void task(void *)
. Right now we're force casting this function to the OS specific function definition. However, casting a function with a void return value to functions with non-void return values is undefined behavior that should be avoided (and is also triggering static analysis warnings). A platform-specific wrapper is used as the task entrypoint, which then calls the F' task entrypoint.Future Work
The VxWorks task implmentation should be updated to use this new pattern.
For consistency, we may want to update the bare metal schedule to use the execRoutine function.