Question

I am working on a MIPS32 like CPU and I am wondering how the MIPS32 exception and interrupt handling works exactly. The MIPS32 Privileged Resource Architecture guide doesn't give much information. I am wondering about several things which are:

  1. What happens if there is an exception or interrupt in an exception or interrupt handler?

  2. MIPS32 has 5 hardware interrupts and 2 software interrupts in the cause register. Are the software interrupts exceptions or are exceptions just shown in the exception code value?

  3. Is there a different interrupt and exception vector?

  4. What happens if there are 2 exceptions that go off in the pipeline before it clears itself for the exception? For example there is an overflow exception followed by another exception, and an interrupt. What happens?

Links to any useful resources will be appreciated.

Was it helpful?

Solution

  1. Exception handlers should not re-enable exceptions until after they have saved EPC, SR etc.
  2. The software interrupts are exceptions.
  3. Some MIPS CPUs have been built with different interrupt and exception vectors, but this turns out not to be very useful.
  4. MIPS has precise exceptions: i.e. exceptions appear in instruction sequence and only the first exception in the pipeline will be architecturally visible.

See MIPS Run Linux is the best and most readable reference for MIPS exceptions and the MIPS PRA.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top