MIPS to determine if hardware I / O interruption has occurred?

In my MIPS32 exception handler, I want to determine if an exception was caused by an I / O interrupt. It is necessary to check the bits of register Cause 2-6 inclusive. What is the MIPS build code to determine this?

+4
source share
1 answer

You must mask every bit to check where the interrupt came from. The exception handling procedure is shown here: Exchandler You can see the manual for your equipment that says where the interrupt came from, and there are often error codes that you can load into the register and compare with the EPIE register to find out if the exception was a trap or an interrupt, do not forget to reset the EPIE (register error state) before returning from the error and turning on the interrupt bits in the processor control register so that the hardware can create interrupts.

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

Assembly language MIPS , MIPS: interrupts and exceptions p. 22

+2
source

Source: https://habr.com/ru/post/1308101/


All Articles