[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Interrupt prologues

From: E. Weddington
Subject: Re: [avr-gcc-list] Interrupt prologues
Date: Mon, 31 Jan 2005 17:08:45 -0700
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

Curtis Maloney wrote:

All looks sane enough. Saving the zero, temp, and status regs, and the two regs the ISR uses.

However, why save the zero and tmp regs, when they are not used at all in the function? Is this because they're "hidden" from GCC, and saved as a precaution?

Well it's not "hidden" from GCC. GCC knows about them. But it's part of the ABI that the zero and tmp regs can be used by any function. So, an interrupt happens, and the ISR needs to save and restore it as your generated code in the ISR could use those registers, for example assigning zero to a variable.

If you're absolutely sure that your ISR won't use them and you need faster timing, I think the method you can use is to declare your ISR with a naked attribute, and then do the prologue and epilogue yourself. I haven't used that method, but search this list. IIRC, it was talked about recently.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]