-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[libcpu][cortex-a] Refactor FPU stack initialization for maintainability #10919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
Co-authored-by: BernardXiong <[email protected]>
|
|
libcpu/arm/cortex-a/stack.c
Outdated
| { | ||
| rt_uint32_t *stk; | ||
| #ifdef RT_USING_FPU | ||
| rt_uint32_t i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot 不希望定义 i 变量,可以直接使用 rt_memset 的方式取代循环。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: BernardXiong <[email protected]>
|
cc @Xenithya |
|
贡献里可以留下我ID吗?
寻迎亚
***@***.***
…------------------ 原始邮件 ------------------
发件人: "Bernard ***@***.***>;
发送时间: 2025年11月12日(星期三) 凌晨4:34
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [RT-Thread/rt-thread] [libcpu][cortex-a] Refactor FPU stack initialization for maintainability (PR #10919)
Merged #10919 into master.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
Referenced #10906 which fixed FPU stack initialization bugs. This PR refactors the implementation for better code quality while maintaining identical functionality.
你的解决方案是什么 (what is your solution)
Refactored FPU initialization using constants and rt_memset:
VFP_DATA_NRconstant (64 words) incpuport.hfollowing cortex-r4 patternrt_memsetfor cleaner codecontext_gcc.SBefore:
After:
Stack layout (high to low): FPEXC (1 word) → FPSCR (1 word) → D16-D31 (32 words) → D0-D15 (32 words)
Changes:
libcpu/arm/cortex-a/cpuport.h: +5 lines (VFP_DATA_NR definition)libcpu/arm/cortex-a/stack.c: Usesrt_memsetto initialize FPU registers, no loop variable needed请提供验证的bsp和config (provide the config and bsp)
BSP: Code-only refactoring, no functional change from [libcpu][arm] fix: correct FPU stack initialization order and alignment on Cortex-A #10906
.config:
CONFIG_RT_USING_FPU=y(Cortex-A only)action: N/A (architecture-specific, requires Cortex-A hardware/QEMU)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned upOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.