Hello Jean-Christophe, I'm the original author of this patch and I add in copy my colleague Frederic.
On 02/01/2018 12:13, Jean-Christophe DUBOIS wrote: > I am wondering if the IRQMP code in hw/intc/grlib_irqmp.c is correct > when it comes to acknowledging interrupts. > > With the actual code an interrupt can be lowered/acked only by an > "ack" from the processor which means that the trap handler related to > this external interrupt needs to be run for the ack to happen. > > In particular this means that the interrupt cannot be acked only by > software. Even if the software clears the "pending" interrupts (by > writing to the CLEAR_OFFSET register before the interrupt handler is > run) this does not clear the interrupt to the processor (which is kept > asserted until the handler is run and the interrupt acked by the > processor). Do you know if this is indeed the intended behavior (I > understand that for most operating system the interrupt handler will > be run at last and this does not make a difference)? > > I would expect that clearing interrupt through software (by writing to > the CLEAR_OFFSET register) would have the same effect as the processor > acknowledgment (and could avoid to run the interrupt handler if things > have already been taken care of by software). > > Unfortunately the documentation I got (on the web) on the IRQMP is not > very clear on the topic. > I don't remember all the details of this CPU on top of my head, I worked on this years ago. If you have access to a real board the best would be to compare the behavior of the CPU on it. There's also a cycle accurate simulator of Leon3, you can download an evaluation version here: http://www.gaisler.com/index.php/downloads/simulators > Anyway you can find below the patch I'd like to provide for IRQMP. > Can you explain the reason for this change? Why can't you use the current interrupt handling? Regards,