summaryrefslogtreecommitdiffstats
path: root/cpukit/aclocal
diff options
context:
space:
mode:
authorWeiY <wei.a.yang@gmail.com>2013-08-19 23:36:28 +0800
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-08-20 10:42:43 +0200
commit0432dff73fbcf73ed75a02c07fe0f0690b306aee (patch)
tree92616b3f7c084a700fef0098a8edd1274e5307c6 /cpukit/aclocal
parentsmp: Add Deterministic Priority SMP Scheduler (diff)
downloadrtems-0432dff73fbcf73ed75a02c07fe0f0690b306aee.tar.bz2
add compare_and_swap check in check-atomic.m4
Diffstat (limited to 'cpukit/aclocal')
-rw-r--r--cpukit/aclocal/check-atomic.m44
1 files changed, 3 insertions, 1 deletions
diff --git a/cpukit/aclocal/check-atomic.m4 b/cpukit/aclocal/check-atomic.m4
index 00149f8a12..69cca509a7 100644
--- a/cpukit/aclocal/check-atomic.m4
+++ b/cpukit/aclocal/check-atomic.m4
@@ -7,9 +7,11 @@ AC_CACHE_CHECK([whether CPU supports atomic operations],
[rtems_cv_ATOMIC],[
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <stdatomic.h>]],
- [[atomic_uint_fast32_t t; atomic_init(&t, 0);
+ [[atomic_uint_fast32_t t; uint_fast32_t m = 1;
+ atomic_init(&t, 0);
atomic_store( &t, 1 );
atomic_exchange( &t, 2 );
+ atomic_compare_exchange_strong( &t, &m, 2);
atomic_fetch_add( &t, 3 );]])],
[rtems_cv_ATOMIC="yes"],
[rtems_cv_ATOMIC="no"])