Gsoc2012: Atomic operation for RTEMS

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Jun 5 14:33:48 UTC 2012


On 06/05/2012 04:19 PM, wei.a.yang at gmail.com wrote:
>> For
>> >
>> >  typedef unsigned int ATOMIC_ptr;
>> >
>> >  you can use
>> >
>> >  typedef uintptr_t ATOMIC_ptr;
> Right, I am not very familial with the basic date type on the Rtems.

This type is part of <stdint.h>.

http://pubs.opengroup.org/onlinepubs/007904975/basedefs/stdint.h.html

>> >
>> >  Maybe it is work to introduce a atomic_cpu_generic.h which can be used like (atomic_cpu.h)
>> >
>> >  #include<rtems/score/atomic_cpu_generic.h>
>> >
>> >  since I suppose this atomic_cpu.h will use the same type definitions on nearly all architectures.
> Do you mean introduce both the atomic_cpu.h and atomic_cpu_generic.h? The atomic_cpu.h is the same on the different architecture and atomic_cpu_generic.h provide different definitions on different architecture, right?

No, the "atomic_cpu_generic.h" should provide the type definitions for 
reasonable architectures.  It is good to have architecture specific types like 
Atomic_Int, but I think on most architectures it will be "typedef Atomic_Int 
int".  For all architectures with straight forward type definitions we can use 
"atomic_cpu_generic.h".

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list