[En-Nut-Discussion] Fwd: Not fixed!!!: Re: confirmed!!! Re: NutOS 4.4.0 on ARM7: possibly bug in NutEnterCritical / NutExitCritical

Matthias Ringwald mringwal at inf.ethz.ch
Fri Feb 22 19:09:15 CET 2008


Bouncing Ole's mail:

> From: Ole Reinhardt <ole.reinhardt at embedded-it.de>
> Date: 22. Februar 2008 18:56:57 GMT+01:00
>
> Hi,
>
>> Does GCC produce such code? Couldn't it reserve this extra space in  
>> the
>> beginning of the function similar to local variables.
>>
>> I do see the potential problem. But is there an example that this
>> happens, or is this hypothetical?
>
> Sorry I don't have any disassemblated code example, but I saw this in
> real world. Yes! After caling NutEnterCritical / NutExitCritical the
> stack was moved about two bytes!!!
>
> I first saw this problem when using gmtime. No, not in Interrupt  
> context
> and I now know that it's not necessary to put it into a critical  
> section
> but the effect was there.
>
> I had a similar effect at another part of my program when using
> NutEnterCritical / ExitCritical. Ok again, not realy necessary. But  
> the
> effect was there.
>
> I'm quite shure the compiler will use the stack temporarily as long as
> there is enough space in the stack. Will say: variable values will not
> be stored on the stack every time but at least there is enough space  
> to
> store them on stack if needed.
>
> At least I don't know any reason why other operating systems need  
> saving
> the status flags in a variable in critical sections if this would be  
> an
> academic question :-)
>
> Bye,
>
> Ole
>
> -- 
> _____________________________________________________________
> |                                                             |
> | Embedded-IT          Hard- und Softwarelösungen             |
> |                                                             |
> | Ole Reinhardt        Tel. / Fax:        +49 (0)271  7420433 |
> | Luisenstraße 29      Mobil:             +49 (0)177  7420433 |
> | 57076 Siegen         eMail:    ole.reinhardt at embedded-it.de |
> | Germany              Web:         http://www.embedded-it.de |
> |                      UstID / VAT:       DE198944716         |
> |_____________________________________________________________|
>




More information about the En-Nut-Discussion mailing list