On Thursday 14 May 2009 07:42, Sean D'Epagnier wrote: [...] > Also, there is the issue of longjmp setting EIND and not restoring it. > It gets a little tricky with interrupts that can potentially set EIND > as well.
Yes, the longjmp() sets EIND. It is impossible to restore EIND, as the EIJMP is the *last* instruction of this function. The alternative is to emulate EIJMP with RET instruction. Note, the usage of EIJMP is the very old behavior. IMHO, the status of EIND as 'never-change' is a doubtful design. For example, the status 'call-scratch' is better in conjunction the presence of option 'my-trampolines-are-at-low-memory'. (In case of this option the compiler must not use EIND entirely). In any case, the rules of EIND usage must be documented. Regards, Dmitry. _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list