From 8a9568d2e708d9c33e75b7de5993c8e99354933a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Feb 2014 11:18:13 +0100 Subject: Require presence of for SMP support --- 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 ++++++++--------- 6 files changed, 15 insertions(+), 41 deletions(-) delete mode 100644 cpukit/aclocal/check-atomic.m4 (limited to 'cpukit') 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 ]], - [[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([ 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 -- cgit v1.2.3