[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] interrupt optimization
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] interrupt optimization |
Date: |
Fri, 3 Feb 2006 07:18:04 +0100 (MET) |
Lars Noschinski <address@hidden> wrote:
> If the function call is the last thing you need to do, you can also
> replace the call by a jmp instruction (of course, you may not push
> something to the stack).
You'd need to enable interrupts before, otherwise you'll end up stuck
with interrupts disabled, as there won't be a final RETI.
However, unless you're very sure about what that called function is
doing, this is not going to be a bright idea. You'd basically get
away with the same things the compiler is doing, namely saving all
call-clobbered registers as the called function is free to use them.
Also, keep in mind that ISRs need to also save __tmp_reg__ and
__zero_reg__, and need to make __zero_reg__ a 0 again (alas), so these
would need to be restored upon return (normal functions won't handle
that).
Compared to that, the overhead of an additional call vs. jump is
neglicible.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
RE: [avr-gcc-list] interrupt optimization, Nigel Winterbottom, 2006/02/01
Re: [avr-gcc-list] interrupt optimization, Joerg Wunsch, 2006/02/01
Re: [avr-gcc-list] interrupt optimization, David Brown, 2006/02/02