[libcpu][risc-v] Fix PLIC interrupt processing order#11305
[libcpu][risc-v] Fix PLIC interrupt processing order#11305FurryAcetylCoA 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: libcpu_riscvReviewers: @Yaochenger Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-03-31 20:05 CST)
📝 Review Instructions
|
Description / 描述
This PR fixes the PLIC interrupt handling order in the RISC-V virt64 libcpu. The previous code called
plic_completebefore executing the interrupt handler, which violated the correct interrupt flow. According to Section 1.5 Interrupt Flow of the RISC-V Platform-Level Interrupt Controller Specification, the interrupt should be handled first and then completed.本次 PR 修复了 RISC-V virt64 中的 PLIC 中断处理顺序。以往的代码在执行中断 handler 之前调用了
plic_complete。根据 RISC-V Platform-Level Interrupt Controller Specification 的 1.5. Interrupt Flow 节的说明,应当先运行 handler,然后再 complete。Modified Files / 修改文件
libcpu/risc-v/virt64/plic.c: Fixedplic_handle_irqby movingplic_completeafter the handler call.