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

Henrik Maier hmlists at focus-sw.com
Tue Feb 26 04:27:15 CET 2008


Hi Ole,

Thanks for the additional arguments taken from a broader perspective which
convinced me too.
But then I opt for implementing the "idiot-proof" version which takes a
parameter (crit_section_t) to store the status so we don't have any other
possible side-effects and deprecate, but keep
NutEnterCritical/NuExitCritical.

Henrik

> -----Original Message-----
> From: en-nut-discussion-bounces at egnite.de [mailto:en-nut-discussion-
> bounces at egnite.de] On Behalf Of Ole Reinhardt
> Sent: Tuesday, 26 February 2008 2:46 AM
> To: Ethernut User Chat (English)
> Subject: Re: [En-Nut-Discussion] Not fixed!!!: Re: confirmed!!! Re: NutOS
> 4.4.0 on ARM7: possibly bug in NutEnterCritical / NutExitCritical
> 
> Hi Henrik,
> 
> > The only reason why we would have to involve the stack is
> > a) to allow nesting of critical sections
> > or
> > b) we don't know the interrupt state before entering the section
> 
> with your simple solution you assume two things:
> 
> - Software developers always know what they do :)
> - You may not nest critical sections
> - You may never call any function you did not write yourself from within
>   a critical section.
> 
> All these assumptions might be ok for 90% of the people but if 10% fail
> because they don't think about this problem your design does not work.
> 
> Next problem is that caused by historical reasons there might be several
> applications out there that still use NutEnterCritical at points where
> no critical section would be needed. Will say: In reality we need a good
> working critical section routine.
> 
> The other point is, that you have to take care if you call a function
> from within an interrupt context or from outside. In other words a
> ringbuffer for example using the critical section would need two pairs
> of functions to read and write from within interrupt conetext and from
> outside.
> 
> You are totaly right that normaly nobody needs critical section (where
> global interrupts are swiched off) but in real world there _will_ come
> up cases where you need them. And then you also need good working
> functions. Latest when NutOS learns using caches and mmu we will need
> these functions.
> 
> 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         |
> |_____________________________________________________________|
> 
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion




More information about the En-Nut-Discussion mailing list