Module: xenomai-3
Branch: next
Commit: 418e3c1f73056f1a010d6bac413d58e759aeaf91
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=418e3c1f73056f1a010d6bac413d58e759aeaf91

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Jul 23 11:04:26 2015 +0200

testsuite: assume modern sched_setaffinity() is available

---

 configure.ac                      |   25 -------------------------
 testsuite/clocktest/clocktest.c   |   15 ---------------
 testsuite/switchtest/switchtest.c |   19 +------------------
 3 files changed, 1 insertion(+), 58 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6f55a4b..701d9fd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -610,31 +610,6 @@ dnl debugging with valgrind, instrumented glibc etc.
 AM_CONDITIONAL(XENO_TLSF,[test x$rtcore_type = xcobalt -o x$debug_mode = x])
 test x$rtcore_type = xcobalt -o x$debug_mode = x && 
AC_DEFINE(CONFIG_XENO_TLSF,1,[config])
 
-AC_MSG_CHECKING([for sched_setaffinity])
-AC_CACHE_VAL(ac_cv_sched_setaffinity,
- save_CFLAGS="$CFLAGS"
- CFLAGS="-Wimplicit-function-declaration -Werror -D_GNU_SOURCE"
- [AC_TRY_LINK([#include <sched.h>],
- [cpu_set_t cpu_set; sched_setaffinity(0, sizeof(cpu_set), &cpu_set);],
- [ac_cv_sched_setaffinity=new],
- [ac_cv_sched_setaffinity=bad])]
- if test $ac_cv_sched_setaffinity = bad ; then
-   [AC_TRY_LINK([#include <sched.h>],
-   [cpu_set_t cpu_set; sched_setaffinity(0, &cpu_set);],
-   [ac_cv_sched_setaffinity=old],
-   [ac_cv_sched_setaffinity=no])]
- fi
- if test $ac_cv_sched_setaffinity = old ; then
-     AC_MSG_RESULT(old)
-     AC_DEFINE(HAVE_OLD_SETAFFINITY,1,[config])
- elif test $ac_cv_sched_setaffinity = new ; then
-     AC_MSG_RESULT(ok)
-     AC_DEFINE(HAVE_RECENT_SETAFFINITY,1,[config])
- else
-     AC_MSG_RESULT(no)
- fi
- CFLAGS="$save_CFLAGS")
-
 dnl Check for atomic builtins. For now we only check for the legacy
 dnl interface, i.e. __sync_*.
 
diff --git a/testsuite/clocktest/clocktest.c b/testsuite/clocktest/clocktest.c
index c551a1e..a40fcac 100644
--- a/testsuite/clocktest/clocktest.c
+++ b/testsuite/clocktest/clocktest.c
@@ -35,21 +35,6 @@
 
 extern struct xnvdso *cobalt_vdso;
 
-#ifndef HAVE_RECENT_SETAFFINITY
-#ifdef HAVE_OLD_SETAFFINITY
-#define sched_setaffinity(pid, len, mask)      sched_setaffinity(pid, mask)
-#else /* !HAVE_OLD_SETAFFINITY */
-#ifndef __cpu_set_t_defined
-typedef unsigned long cpu_set_t;
-#endif
-#define sched_setaffinity(pid, len, mask)      do { } while (0)
-#ifndef CPU_ZERO
-#define CPU_ZERO(set)                          memset(set, 0, sizeof(*set))
-#define CPU_SET(n, set)                                do { } while (0)
-#endif
-#endif /* !HAVE_OLD_SETAFFINITY */
-#endif /* !HAVE_RECENT_SETAFFINITY */
-
 /*
  * We can't really trust POSIX headers to check for features, since
  * some archs may not implement all of the declared uClibc POSIX
diff --git a/testsuite/switchtest/switchtest.c 
b/testsuite/switchtest/switchtest.c
index 2df927e..c940b86 100644
--- a/testsuite/switchtest/switchtest.c
+++ b/testsuite/switchtest/switchtest.c
@@ -39,25 +39,8 @@
 #include <cobalt/trace.h>
 #include <rtdm/testing.h>
 
-#ifdef HAVE_RECENT_SETAFFINITY
-#define do_sched_setaffinity(pid,len,mask) sched_setaffinity(pid,len,mask)
-#else /* !HAVE_RECENT_SETAFFINITY */
-#ifdef HAVE_OLD_SETAFFINITY
-#define do_sched_setaffinity(pid,len,mask) sched_setaffinity(pid,mask)
-#else /* !HAVE_OLD_SETAFFINITY */
-#ifndef __cpu_set_t_defined
-typedef unsigned long cpu_set_t;
-#endif
-#define do_sched_setaffinity(pid,len,mask) 0
-#ifndef CPU_ZERO
-#define         CPU_ZERO(set)          do { *(set) = 0; } while(0)
-#define         CPU_SET(n,set) do { *(set) |= (1 << n); } while(0)
-#endif
-#endif /* HAVE_OLD_SETAFFINITY */
-#endif /* HAVE_RECENT_SETAFFINITY */
-
 #if CONFIG_SMP
-#define smp_sched_setaffinity(pid,len,mask) do_sched_setaffinity(pid,len,mask)
+#define smp_sched_setaffinity(pid,len,mask) sched_setaffinity(pid,len,mask)
 #else /* !CONFIG_SMP */
 #define smp_sched_setaffinity(pid,len,mask) 0
 #endif /* !CONFIG_SMP */


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to