[rtems commit] tests: atomic support for RTEMS. Uniprocessor tests for atomic ops.

wei.a.yang at gmail.com wei.a.yang at gmail.com
Fri Feb 8 16:09:08 UTC 2013


In the atomic.inl it has a comment 
 " *
+ *  In the event that a CPU does not support a specific atomic function it has, the 
+ *  CPU dependent routine does nothing (but does exist).
+ */
"
If the architecture does not support atomic it should have a min stub to make compile ok.

But I wonder whether there is a necessary to define a macro HAVE_ATOMIC like HAVE_SMP

在 2013-2-8,9:36,Chris Johns <chrisj at rtems.org> 写道:

> Gedare Bloom wrote:
>> I suppose the question is whether we want to let code that includes
>> the atomics compile for an unsupported CPU. I think we should define a
>> minimal stub that allows the code to compile and assert(false) so that
>> any user that actually tries it will get an obvious failure.
> 
> I suppose this comes down to the place conditional support for atomics is placed and their use in the kernel. If RTEMS only supported SMP systems all archs would need to provide them and asserts would work. As RTEMS does not it would mean every place an atomic is used a conditional define is needed (yuck) or the atomic call becomes a 'nop' on archs with no atomic instructions or when being built for a single cpu system where atomic locking is not needed.
> 
>> An alternate solution would be to use automagic to prevent the
>> spatomic* from being included.
> 
> No thanks.
> 
>> Maybe if we had an experimental flag :)
> 
> :)
> 
> Chris
> 
> _______________________________________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-devel




More information about the devel mailing list