> This looks wrong. Of course, so does nios2_cpu_set_irq, from which you've > cribbed this.
> For our purposes, I think simply re-using env->regs[CR_IPENDING] as the > external hw > request word is the right thing to do. But we need to update RDCTL to > compute the > correct value from CR_IPENDING & CR_IENABLE, and update WRCTL to ignore > writes. Since you've already fixed that on " target/nios2: Rewrite interrupt handling" patchset, I guess I'll need to rebase on it once it's merged. Until then for my next version I plan to just keep that with a "TODO" comment. > > + if (cpu->rnmi) { > > + return !(env->regs[CR_STATUS] & CR_STATUS_NMI); > > + } > I think this should be a separate > #define CPU_INTERRUPT_NMI CPU_INTERRUPT_TGT_EXT_0 The NMI is not a separate interrupt line. It's part of the interrupt sideband and is set just like the Requested-Handler-Address or any other EIC field. Could you explain why NMI should be separate? What makes it different from other EIC fields? Amir