[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] Inserting code before context save in an ISR (fornest
From: |
Eric Weddington |
Subject: |
RE: [avr-gcc-list] Inserting code before context save in an ISR (fornested interrupts) |
Date: |
Mon, 06 Aug 2007 13:51:39 -0600 |
> -----Original Message-----
> From:
> address@hidden
> [mailto:address@hidden
> org] On Behalf Of David Brown
> Sent: Monday, August 06, 2007 6:49 AM
> To: address@hidden
> Subject: Re: [avr-gcc-list] Inserting code before context
> save in an ISR (fornested interrupts)
>
> David Carr wrote:
> > Hi all,
> >
> > I'm working on a hard realtime application where I need to
> keep the time
> > where interrupts are disabled as small as possible. I've
> noticed that a
> > typical ISR can take 40+ cycles to push registers onto the
> stack before
> > executing any user ISR code. I'd like for interrupts to be
> re-enabled
> > immediately upon entering the ISR (before the context save).
> >
> > The only way that I can think of to do this is to add the
> naked attribute
> > to my ISRs. Unfortunately, this is very unattractive
> because then I have
> > to do all context save operations manually. My ISRs are
> written in C and
> > therefore I wouldn't know which registers would need to be
> saved and would
> > be forced to save all of them --- an expensive proposition.
> >
> > Is there a way to inject a simple sei() into the start of
> an ISR before
> > the automatic context save?
> >
> > Thanks,
> > David Carr
> >
>
> If you use the "interrupt" attribute instead of the "signal"
> attribute,
> nested interrupts are enabled as soon as possible in the
> interrupt routine.
>
And to do this using avr-libc, is to use the INTERRUPT() macro (instead of
ISR()):
INTERRUPT(<vectorname>)
{
// code here
}
Eric
- [avr-gcc-list] Inserting code before context save in an ISR (for nested interrupts), David Carr, 2007/08/06
- Re: [avr-gcc-list] Inserting code before context save in an ISR (for nested interrupts), Klaus Rudolph, 2007/08/06
- Re: [avr-gcc-list] Inserting code before context save in an ISR (for nested interrupts), Paulo Marques, 2007/08/06
- Re: [avr-gcc-list] Inserting code before context save in an ISR (for nested interrupts), David Brown, 2007/08/06
- RE: [avr-gcc-list] Inserting code before context save in an ISR (fornested interrupts),
Eric Weddington <=
- Re: [avr-gcc-list] Inserting code before context save in an ISR (fornested interrupts), Joerg Wunsch, 2007/08/07
- Re: [avr-gcc-list] Inserting code before context save in an ISR (fornested interrupts), David Carr, 2007/08/07
- RE: [avr-gcc-list] Inserting code before context save in an ISR(fornested interrupts), Eric Weddington, 2007/08/07
- Re: [avr-gcc-list] Inserting code before context save in an ISR (fornested interrupts), Christian Ludlam, 2007/08/13
- RE: [avr-gcc-list] Inserting code before context save in an ISR(fornested interrupts), Eric Weddington, 2007/08/13
- Re: [avr-gcc-list] Inserting code before context save in an ISR (fornested interrupts), Joerg Wunsch, 2007/08/13
- RE: [avr-gcc-list] Inserting code before context save in an ISR(fornested interrupts), Stu Bell, 2007/08/13
- Re: [avr-gcc-list] Inserting code before context save in an ISR(fornested interrupts), Joerg Wunsch, 2007/08/13
- RE: [avr-gcc-list] Inserting code before context save in anISR(fornested interrupts), Eric Weddington, 2007/08/13