[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] COMPILER Frame pointer bug!!!
From: |
Bernd Felsche |
Subject: |
Re: [avr-gcc-list] COMPILER Frame pointer bug!!! |
Date: |
Sun, 18 Nov 2001 21:52:41 +0800 (WST) |
Christoph Plattner tapped away at the keyboard with:
> No the code is OK, you simple have overseen the interrupt handling.
>
> Using cli/sei is ALWAYS WRONG and many old operating system errors
> have to be searched. The correct handling is (used C style to
> explain):
>
> flags = save_cpu_flags (); /* inlcuding Interrupt Enable bit */
> cli (); /* disable interrupts */
>
> < critical code >
>
> restore_cpu_flags (flags); /* set the old IE state !!! */
Unfortunately, there's the opportunity for an interrupt to occur
between the save and the interrupt disable. Or did I miss something
in the instruction set details?
This is pretty much a short-coming of the AVR. If the cli() and
sei() were both save the previous status of the interrupt flag to
(say) the carry bit, then the previous state could be restored
reliably, under all circumstances.
[snip]
--
/"\ Bernd Felsche - Innovative Reckoning, Perth, Western Australia
\ / ASCII ribbon campaign | I'm a .signature virus! |
X against HTML mail | Copy me into your ~/.signature|
/ \ and postings | to help me spread! |
- [avr-gcc-list] AVR Studio doesn't like avr-gcc .obj files, Leon Heller, 2001/11/09
- [avr-gcc-list] Re: AVR Studio doesn't like avr-gcc .obj files, Gunnar Henne, 2001/11/09
- Re: [avr-gcc-list] COMPILER Frame pointer bug!!!, Larry Barello, 2001/11/18
- Re: [avr-gcc-list] COMPILER Frame pointer bug!!!, Christoph Plattner, 2001/11/18
- Re: [avr-gcc-list] COMPILER Frame pointer bug!!!,
Bernd Felsche <=
- Re: [avr-gcc-list] COMPILER Frame pointer bug!!!, Christoph Plattner, 2001/11/18
- Re: [avr-gcc-list] COMPILER Frame pointer bug!!!, Bernd Felsche, 2001/11/18
- Re: [avr-gcc-list] COMPILER Frame pointer bug!!!, Marek Michalkiewicz, 2001/11/19