summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-14 11:18:13 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-17 08:46:38 +0100
commit8a9568d2e708d9c33e75b7de5993c8e99354933a (patch)
treed52e101f444a004ef73a525f9e5196198248200d
parentsparc: Add atomic support for SPARC V8 (diff)
downloadrtems-8a9568d2e708d9c33e75b7de5993c8e99354933a.tar.bz2
Require presence of <stdatomic.h> for SMP support
-rw-r--r--cpukit/aclocal/check-atomic.m419
-rw-r--r--cpukit/configure.ac10
-rw-r--r--cpukit/rtems/Makefile.am2
-rw-r--r--cpukit/rtems/preinstall.am2
-rw-r--r--cpukit/score/Makefile.am6
-rw-r--r--cpukit/score/preinstall.am17
-rw-r--r--testsuites/smptests/Makefile.am2
-rw-r--r--testsuites/smptests/configure.ac2
8 files changed, 15 insertions, 45 deletions
diff --git a/cpukit/aclocal/check-atomic.m4 b/cpukit/aclocal/check-atomic.m4
deleted file mode 100644
index 69cca509a7..0000000000
--- a/cpukit/aclocal/check-atomic.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-dnl
-AC_DEFUN([RTEMS_CHECK_ATOMIC],
-[dnl
-AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])dnl
-
-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; 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"])
- ])
-])
diff --git a/cpukit/configure.ac b/cpukit/configure.ac
index 211f52771a..5dd323efa6 100644
--- a/cpukit/configure.ac
+++ b/cpukit/configure.ac
@@ -159,7 +159,9 @@ RTEMS_CHECK_MULTIPROCESSING
RTEMS_CHECK_POSIX_API
RTEMS_CHECK_NETWORKING
RTEMS_CHECK_SMP
-RTEMS_CHECK_ATOMIC
+if test "${RTEMS_HAS_SMP}" = "yes"; then
+ AC_CHECK_HEADERS([stdatomic.h],[],[AC_MSG_ERROR([<stdatomic.h> is required for SMP support])])
+fi
rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
@@ -202,11 +204,6 @@ RTEMS_CPUOPT([RTEMS_NETWORKING],
[1],
[if networking is enabled])
-RTEMS_CPUOPT([RTEMS_ATOMIC],
- [test x"$rtems_cv_ATOMIC" = xyes],
- [1],
- [if cpu supports atomic operations])
-
RTEMS_CPUOPT([RTEMS_VERSION],
[true],
["]_RTEMS_VERSION["],
@@ -327,7 +324,6 @@ AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"])
AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
-AM_CONDITIONAL([ATOMIC],[test x"$rtems_cv_ATOMIC" = x"yes"])
AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
diff --git a/cpukit/rtems/Makefile.am b/cpukit/rtems/Makefile.am
index 6688317061..ea461deabc 100644
--- a/cpukit/rtems/Makefile.am
+++ b/cpukit/rtems/Makefile.am
@@ -53,7 +53,7 @@ include_rtems_rtems_HEADERS += include/rtems/rtems/tasksimpl.h
include_rtems_rtems_HEADERS += include/rtems/rtems/timer.h
include_rtems_rtems_HEADERS += include/rtems/rtems/timerimpl.h
include_rtems_rtems_HEADERS += include/rtems/rtems/types.h
-if ATOMIC
+if HAS_SMP
include_rtems_rtems_HEADERS += include/rtems/rtems/atomic.h
endif
include_rtems_rtems_HEADERS += mainpage.h
diff --git a/cpukit/rtems/preinstall.am b/cpukit/rtems/preinstall.am
index 72fa775077..850ff84a8a 100644
--- a/cpukit/rtems/preinstall.am
+++ b/cpukit/rtems/preinstall.am
@@ -191,7 +191,7 @@ $(PROJECT_INCLUDE)/rtems/rtems/types.h: include/rtems/rtems/types.h $(PROJECT_IN
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/types.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/types.h
-if ATOMIC
+if HAS_SMP
$(PROJECT_INCLUDE)/rtems/rtems/atomic.h: include/rtems/rtems/atomic.h $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/atomic.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/atomic.h
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index 871d44ea39..267e8b2556 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -84,10 +84,6 @@ include_rtems_score_HEADERS += include/rtems/score/watchdogimpl.h
include_rtems_score_HEADERS += include/rtems/score/wkspace.h
include_rtems_score_HEADERS += include/rtems/score/cpuopts.h
include_rtems_score_HEADERS += include/rtems/score/basedefs.h
-if ATOMIC
-include_rtems_score_HEADERS += include/rtems/score/atomic.h
-include_rtems_score_HEADERS += include/rtems/score/cpustdatomic.h
-endif
if HAS_PTHREADS
include_rtems_score_HEADERS += include/rtems/score/corespinlock.h
@@ -106,6 +102,8 @@ include_rtems_score_HEADERS += include/rtems/score/threadmp.h
endif
if HAS_SMP
+include_rtems_score_HEADERS += include/rtems/score/atomic.h
+include_rtems_score_HEADERS += include/rtems/score/cpustdatomic.h
include_rtems_score_HEADERS += include/rtems/score/schedulersimplesmp.h
endif
diff --git a/cpukit/score/preinstall.am b/cpukit/score/preinstall.am
index f43fc9d733..a3c9685dc5 100644
--- a/cpukit/score/preinstall.am
+++ b/cpukit/score/preinstall.am
@@ -319,15 +319,6 @@ $(PROJECT_INCLUDE)/rtems/score/basedefs.h: include/rtems/score/basedefs.h $(PROJ
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/basedefs.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/basedefs.h
-if ATOMIC
-$(PROJECT_INCLUDE)/rtems/score/atomic.h: include/rtems/score/atomic.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/atomic.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/atomic.h
-
-$(PROJECT_INCLUDE)/rtems/score/cpustdatomic.h: include/rtems/score/cpustdatomic.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/cpustdatomic.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/cpustdatomic.h
-endif
if HAS_PTHREADS
$(PROJECT_INCLUDE)/rtems/score/corespinlock.h: include/rtems/score/corespinlock.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/corespinlock.h
@@ -367,6 +358,14 @@ $(PROJECT_INCLUDE)/rtems/score/threadmp.h: include/rtems/score/threadmp.h $(PROJ
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/threadmp.h
endif
if HAS_SMP
+$(PROJECT_INCLUDE)/rtems/score/atomic.h: include/rtems/score/atomic.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/atomic.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/atomic.h
+
+$(PROJECT_INCLUDE)/rtems/score/cpustdatomic.h: include/rtems/score/cpustdatomic.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/cpustdatomic.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/cpustdatomic.h
+
$(PROJECT_INCLUDE)/rtems/score/schedulersimplesmp.h: include/rtems/score/schedulersimplesmp.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulersimplesmp.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulersimplesmp.h
diff --git a/testsuites/smptests/Makefile.am b/testsuites/smptests/Makefile.am
index ba44b76755..023b7e9ed6 100644
--- a/testsuites/smptests/Makefile.am
+++ b/testsuites/smptests/Makefile.am
@@ -10,9 +10,7 @@ SUBDIRS += smp05
SUBDIRS += smp07
SUBDIRS += smp08
SUBDIRS += smp09
-if ATOMIC
SUBDIRS += smpatomic01
-endif
SUBDIRS += smplock01
SUBDIRS += smpmigration01
SUBDIRS += smpschedule01
diff --git a/testsuites/smptests/configure.ac b/testsuites/smptests/configure.ac
index 063ae97bd5..fa2d05cb6a 100644
--- a/testsuites/smptests/configure.ac
+++ b/testsuites/smptests/configure.ac
@@ -22,7 +22,6 @@ RTEMS_PROG_CC_FOR_TARGET
RTEMS_PROG_CXX_FOR_TARGET
RTEMS_CANONICALIZE_TOOLS
-RTEMS_CHECK_CPUOPTS([RTEMS_ATOMIC])
RTEMS_CHECK_CPUOPTS([RTEMS_POSIX_API])
RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
@@ -33,7 +32,6 @@ RTEMS_CHECK_CPUOPTS([RTEMS_SMP])
AM_CONDITIONAL(SMPTESTS,test "$rtems_cv_RTEMS_SMP" = "yes")
-AM_CONDITIONAL([ATOMIC],[test x"$rtems_cv_RTEMS_ATOMIC" = xyes])
AM_CONDITIONAL([HAS_POSIX],[test x"${rtems_cv_RTEMS_POSIX_API}" = xyes])
# Explicitly list all Makefiles here