[PATCH 2/5] Require presence of <stdatomic.h> for SMP support
Sebastian Huber
sebastian.huber at embedded-brains.de
Fri Feb 14 13:07:25 UTC 2014
---
cpukit/aclocal/check-atomic.m4 | 19 -------------------
cpukit/configure.ac | 10 +++-------
cpukit/rtems/Makefile.am | 2 +-
cpukit/rtems/preinstall.am | 2 +-
cpukit/score/Makefile.am | 6 ++----
cpukit/score/preinstall.am | 17 ++++++++---------
testsuites/smptests/Makefile.am | 2 --
testsuites/smptests/configure.ac | 2 --
8 files changed, 15 insertions(+), 45 deletions(-)
delete mode 100644 cpukit/aclocal/check-atomic.m4
diff --git a/cpukit/aclocal/check-atomic.m4 b/cpukit/aclocal/check-atomic.m4
deleted file mode 100644
index 69cca50..0000000
--- 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 211f527..5dd323e 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 6688317..ea461de 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 72fa775..850ff84 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 871d44e..267e8b2 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 f43fc9d..a3c9685 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 ba44b76..023b7e9 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 063ae97..fa2d05c 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
--
1.7.7
More information about the devel
mailing list