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

Alain M. alainm at pobox.com
Mon Feb 25 15:52:37 CET 2008


Harald Kipp escreveu:
> (Maintainer hat on)
>  From the view of the developer this might not hurt much. From my view, 
> this will cause a lot of trouble, because it will break almost all 
> existing applications, which make use of critical sections. I definitely 
> know, that many organizations and companies out there are using Nut/OS 
> based applications, while the original developers are no longer 
> available. I'd really hate to tell them, that there is a bug fix for 
> their strange crashes, but they need to rewrite some device driver code.
> (Maintainer hat off)

You have a point here, a very important one.

 From all that followed during the weekend, the *inline function* seems 
the best to do the job, because:
a) it will not break code,
b) it will be compatible for all achitectures
c) it will be optimized by the compiler so it will be fast.

=> I would like to add one alternative: a local variable can be created 
using the macro "__func__" (which is standard C99) as part of the name. 
This can be created automaticaly within ENTER_CRITICAL_SECTION as to 
maintain compatibility. Of course a test is needed if it is used twice 
within the same fucntion. BUT, it is possible that the inline function 
would be simpler and just as good!

Alain
PS: I will restrict myself to usefull comments on this matter as it is 
growing too much ;-)





More information about the En-Nut-Discussion mailing list