开发者

MIPS assembly to determine whether hardware I/O interrupt has occurred?

In my MIPS32 exception handler, I want to determine whether the exception was caused by a I/O interrupt. The Cause register bits 2-6 inclusive开发者_如何学编程 has to be checked. What's the MIPS assembly code to determine this?


You have to mask out each bit to check where the interrupt came from. The exception handler procedure is shown here:

MIPS assembly to determine whether hardware I/O interrupt has occurred?

You can see the manual for your hardware that says where the interrupt came from and theres often error codes that u can load into a register and compare with the EPIE register to see if the exception was a trap or interrupt, remember to reset the EPIE (error status register) before you return from the error and enable the interrupt bits in the processors control register to allow the hardware to make interrupts.

This is the scheme i used when coding an exception handler for Nios II, the procedure should be similar for MIPS32.

MIPS assembly language, MIPS: Interrupts and Exceptions page 22

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜