Repository navigation
[RFC] RISC-V: initialize floating-point state for new tasks - #1537
Draft
ChrisX101010 wants to merge 1 commit into
Draft
ChrisX101010 wants to merge 1 commit into
ChrisX101010 wants to merge 1 commit into
Conversation
Mark new FPU contexts Initial and initialize FCSR and FP registers on first-task startup and normal restore entry. Related to FreeRTOS#1536. Developed with Codex assistance; local builds and QEMU checks were run by the contributor.
|
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.



Related to #1536.
New tasks currently start with FS marked Clean but no saved FP image. This change marks their state Initial and initializes FCSR and all 32 FP registers when entering the task. It covers both first-task startup and the normal restore path, while retaining the saved-image restore path for Dirty contexts.
I'm opening this as a draft for feedback on the approach. RV64/FLEN32 scheduler validation still traps, so this branch is not ready to merge.
Validation against ca75944, using Clang 18.1.3, LLD and QEMU 8.2.2 in WSL:
The entry checks use scheduler stubs. The separate scheduler fixture uses the actual kernel task/list/port code and checks ordinary FP values and task creation after the scheduler starts. Those fixtures are local and are not added to this PR yet. Physical hardware, GCC runtime builds, vector runtime behavior and the full upstream suite have not been tested.
I used Codex to help develop and review the change; I ran the builds and QEMU tests locally. I'd appreciate feedback on the initialization approach and where a focused regression test would best fit.