<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 05/05/14 11:50, Sebastian Huber
wrote:<br>
</div>
<blockquote cite="mid:53676D04.50404@embedded-brains.de" type="cite">On
2014-05-05 12:43, Andre Marques wrote: <br>
<blockquote type="cite"> <br>
Any thoughts on this? <br>
</blockquote>
<br>
Why not use C11 atomic operations? <br>
<br>
</blockquote>
<br>
Well, I didn't know they existed, thank you!<br>
<br>
Since I have not used them before, please check if I'm thinking this
right.<br>
<br>
1. Include rtems/score/atomic.h<br>
<br>
2. Initialize variable with ATOMIC_INITIALIZER_* as per<br>
<br>
<a class="moz-txt-link-freetext" href="http://www.rtems.org/onlinedocs/doxygen/cpukit/html/group__RTEMS.html#ga676563e3ec750e9faa2727eea8ed99e1">http://www.rtems.org/onlinedocs/doxygen/cpukit/html/group__RTEMS.html#ga676563e3ec750e9faa2727eea8ed99e1</a><br>
<br>
3. Use _Atomic_Load_* to read the variable value and _Atomic_Store_*
to set a new value to the variable<br>
<br>
4. As for memory models I'm thinking in using ATOMIC_ORDER_ACQUIRE
to load and ATOMIC_ORDER_RELEASE to store.<br>
<br>
Am I missing anything obvious?<br>
<br>
--André Marques<rtems score="" atomic.h=""></rtems><rtems score=""
atomic.h=""></rtems><rtems score="" atomic.h=""></rtems>
</body>
</html>