[src][klibc]: Fixing hardware errors triggered by byte-aligned access…#11228
[src][klibc]: Fixing hardware errors triggered by byte-aligned access…#11228Maihuanyi wants to merge 1 commit intoRT-Thread:masterfrom
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: kernelReviewers: GorrayLi ReviewSun hamburger-os lianux-mm wdfk-prog xu18838022837 Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-02-26 09:06 CST)
📝 Review Instructions
|
… in the rt_memset function;
|
请给出测试用例以及测试截图谢谢 |
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent hardware faults reportedly triggered by byte-wise access in rt_memset() by changing how the word-sized fill buffer is constructed.
本 PR 旨在通过调整 rt_memset() 中字填充 buffer 的构造方式,避免据称由按字节访问触发的硬件错误。
Changes:
- Replaced byte-wise writes into
bufferwith a shift+OR construction loop inrt_memset(). - 用“左移 + 或运算”的方式替代对
buffer的逐字节写入。
You can also share your feedback on Copilot code review. Take the survey.
| for (i = 0; i < LBLOCKSIZE; i++) | ||
| { | ||
| *(((unsigned char *)&buffer)+i) = d; | ||
| buffer = (buffer << 8) | (char) d; |
… in the rt_memset function;
拉取/合并请求描述:(PR description)
[
]
当前拉取/合并请求的状态 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 up