[GSOC] RPi BSP memory barrier

Andre Marques andre.lousa.marques at gmail.com
Thu May 8 16:51:04 UTC 2014


On 05/05/14 11:50, Sebastian Huber wrote:
> On 2014-05-05 12:43, Andre Marques wrote:
>>
>> Any thoughts on this?
>
> Why not use C11 atomic operations?
>

Well, I didn't know they existed, thank you!

Since I have not used them before, please check if I'm thinking this right.

1. Include rtems/score/atomic.h

2. Initialize variable with ATOMIC_INITIALIZER_* as per

http://www.rtems.org/onlinedocs/doxygen/cpukit/html/group__RTEMS.html#ga676563e3ec750e9faa2727eea8ed99e1

3. Use _Atomic_Load_* to read the variable value and _Atomic_Store_* to 
set a new value to the variable

4. As for memory models I'm thinking in using ATOMIC_ORDER_ACQUIRE to 
load and ATOMIC_ORDER_RELEASE to store.

Am I missing anything obvious?

--André Marques
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20140508/c41ec326/attachment-0001.html>


More information about the devel mailing list