[Xenomai] Safe to use GCC atomics within Xenomai

Philippe Gerum rpm at xenomai.org
Thu Jun 26 16:09:10 CEST 2014


On 06/26/2014 02:17 PM, Stefan S wrote:
> Hi all,
>
> GCC 4.6.3 (included in Ubuntu 12.04 LTS) supports atomic builtins.
> I would like to know whether it is safe to use the following builtins:
>
> * type __sync_fetch_and_or (type *ptr, type value, ...)
> * __sync_synchronize (...)
> * type __sync_lock_test_and_set (type *ptr, type value, ...)
> (Definitions taken from
> https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html)
>
> I know that in "asm/xenomai/atomic.h", there are some Xenomai specific
> defintions but not for the first one.
>
> My configuration:
>
> * Xenomai 2.6.3 with ipipe-core-3.10.32-x86-2 patch on a vanilla kernel
> * x86_64, Intel core i5
> * Ubuntu 12.04.4 LTS

I'm using gcc 4.8.2 (fedora) on x86 platforms currently, but I had no 
issue with using the atomic builtins of the 4.6.x series some time ago 
(Xenomai 3 depends on those builtins). So you should be ok.

-- 
Philippe.




More information about the Xenomai mailing list