4
votes

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.

1
This is about hardware architecture - not a good fit for a programming-related Q&A site. Please study the FAQ and respect it - thanks!marc_s
Of course, I found some computer architecture related items here so I though that it would be ok to post on Stackoverflow since there is no stack exchange site that is dedicated for computer architecture. This is somewhat related to programming so I thought it was fine.Alex
This is about how hardware and software interact, so it's just fine for stackoverflow.markgz

1 Answers

2
votes
  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.