On 28.04.2016 16:04, Alan Cox wrote: >> We generate code: >> 1) >> save regs >> ... >> restore regs >> reti >> 2) >> di >> save regs >> ... >> restore regs >> ei >> reti >> 3) >> save regs >> ... >> restore regs >> retn >> >> Out of these, 3) looks correct to me. But 1) fails to reenable >> interrupts at the end (I think there should be an ei before the reti). >> And 2) is completly wrong, I think it should be: >> ei >> save regs >> ... >> restore regs >> reti >> >> Did I miss something? > > When I looked at this ages ago I came to the same conclusion but never > worried about it as I couldn't use those methods anyway because I needed > to be able to save/restore interrupt state.
What's the problem with the interrupt state? The interrupts are unconditionally enabled, but since we're in an interrupt handler, they were enabled before. There should be no need to save/restore state. Any other reason why __interrupt is not suitable for you? Philipp P.S.: W.r.t save/restore of interrupt state, there is bug #2321, but it affects __critical used without __interrupt.
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user