我正在寻找 RISC-V 处理器如何处理中断请求。
我查看了互联网上的指令集手册和信息。重点是准确解释标题设置的内容:指令集。在我看来,如何处理中断是所谓的处理器“程序员模型”的问题。它不适合关于指令集的文档,因为部分中断处理没有在指令中表达。显然,跳转到 ISR并不是出现在程序代码中任何地方的指令。指令集手册提供了 saymret和 的描述mstatus,但未能提供整体视图。
对于一个假设的架构,中断处理可能是这样描述的:
If the IRQ line is high and the I-bit in the status register is set,
the processor executes the following steps atomically:
- Push the PC of the next instruction onto the stack.
- Push the status register onto the stack.
- Clear the I-bit in the status register.
- The PC is set to the location specified in the INTHNDLR register.
Run Code Online (Sandbox Code Playgroud)
这是我正在寻找的 RISC-V 架构的信息。