[En-Nut-Discussion] Not fixed!!!: Re: confirmed!!! Re: NutOS 4.4.0 on ARM7: possibly bug in NutEnterCritical / NutExitCritical
Ole Reinhardt
ole.reinhardt at embedded-it.de
Fri Feb 22 16:31:42 CET 2008
Hi,
> > NutEnterCriticalWithFlags(&flags)
> > NutExitCriticalWithFlags(flags)
>
> Is this a typo that the second line does not have "(&flags)"??
Not necessary a typo. Have to think about it...
> May I suggest that more than one option be available? Due to ARM's
> pipeline structure, a local memory takes too many cicles to write/read,
> so there could be:
>
> 1) a stack version, could be the old one and to be used with care,
> 2) a register version. Question: how to make sure it goes to a resister?
> This would be the fastest version, good for ISR.
> 3) a memory variable version, 100% safe, and leave it to the compiler to
> optimize to register if possible at all. It could even allocate it's own
> temorary variable.
>
> (1) and (2) would come with big warnings, leaving only (3) for most
> novice programers...
Good idea. I could think about a fourth version where we only disable a
special interrupt if the critical section is not vulnerable to other
interrupts. AFAIK linux also implements differen kind of spinlocks.
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