[Top][All Lists]

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

Re: [avr-gcc-list] Avr-gcc Produces Incorrect Code with -Os

From: hutchinsonandy
Subject: Re: [avr-gcc-list] Avr-gcc Produces Incorrect Code with -Os
Date: Thu, 22 May 2008 13:48:06 -0400

You can do it this way but you won't have precise control over disable/restore timing. So you will typically disable interrupts longer than is needed.

Also disabling all interrupts is often not what you need. Disabling specfic interrupts is more palatable on real time systems.

NMI is a feature not a limitation - it supposed to stop such software hanging up the CPU.

BTW gcc provides atomic operations on other ports.


-----Original Message-----
From: Anatoly Sokolov <address@hidden>
To: Weddington, Eric <address@hidden>; David Brown <address@hidden>; address@hidden
Sent: Thu, 22 May 2008 1:08 pm
Subject: Re: [avr-gcc-list] Avr-gcc Produces Incorrect Code with -Os


An alternative way to handle this sort of thing would be to implement
"critical" function attribute like in the msp430 port of gcc - a
function with this attribute has interrupts disabled at the start,
restored at the end.

 It will work for for tiny and mega devices, but xmega devices have
Non-Maskable Interrupts, and clearing of the I-bit does not guarantee
full continuity execution of a code.

I shall make a patch for "critical" attribute.


AVR-GCC-list mailing list

reply via email to

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