Add explanatory comment for portFPU_REG_OFFSET in RISC-V port - #1457
Open
wanghengZzz wants to merge 1 commit into
Open
Add explanatory comment for portFPU_REG_OFFSET in RISC-V port#1457wanghengZzz wants to merge 1 commit into
wanghengZzz wants to merge 1 commit into
Conversation
Explain that the initial (2 * portWORD_SIZE) offset reserves space for the fcsr register and maintains proper memory and ABI stack alignment for both RV32 and RV64 architectures.
|
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.



Description
Clarify FPU context offset calculation in RISC-V portContext.h
This PR adds an explanatory comment to
portFPU_REG_OFFSET()inportContext.hfor the RISC-V port to improve code readability and maintainability.In
portContext.h, the macroportFPU_REG_OFFSET( regIndex )uses( 2 * portWORD_SIZE )as the base offset for saving floating-point registers. Without documentation, this offset design is not immediately obvious to developers reading the kernel porting code.The
( 2 * portWORD_SIZE )reservation serves two critical purposes:fcsr).fld/fsd).Checklist:
Related Issue
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.