One key point is that UIRQ, SIRQ, and MIRQ are just names; the letters
U, S, and M don't actually connote anything about privilege. UIRQ,
SIRQ, and MIRQ are three different interrupt lines on equal footing.
The prefix letters merely reflect the intended use case. So only one
version of this description is necessary. I'll try to rewrite a
version with a few corrections. It's easiest to break it down by the
delegation settings:
If UIRQ is asserted and MIE.UEIE is set, and if MIDELEG.UEI=0, and the
processor is running in M-mode with MSTATUS.MIE=1, or running in
U-mode or S-mode regardless of MSTATUS.MIE, then the trap will be
taken into M-mode.
If UIRQ is asserted and MIE.UEIE is set, and if MIDELEG.UEI=1 and
SIDELEG.UEI=0, and the processor is running in S-mode with
MSTATUS.SIE=1, or running in U-mode regardless of MSTATUS.SIE, then
the trap will be taken into S-mode. The interrupt will never be taken
when running in M-mode.
If UIRQ is asserted and MIE.UEIE is set, and if MIDELEG.UEI=1 and
SIDELEG.UEI=1, and the processor is running in U-mode with
MSTATUS.UIE=1, then the trap will be taken into U-mode. The interrupt
will never be taken when running in M-mode or S-mode.
>
> --
> Samuel A. Falvo II
>
> To view this discussion on the web visit
https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CAEz%3Dsonhe-9eTZTyuSp7o1dAzB4E4eids2R-5pquiU%3DU-E_Vng%40mail.gmail.com.